Developing for the Holybro Pixhawk4 Mini QAV250 Kit

I’m currently based out of China, from the U.S. I was given a QAV250 kit to build and start playing with. It has been a learning experience. I’ll give you a bit of a backstory though so you know where I am with this.

November 14th, 2018 I took an Arduino class in Chengdu, Sichuan hosted by the legendary Mitch Altman. Prior to this class I didn’t know much about resistors, capacitors, current, volts, etc. That was a very fun class and after which I got my hands on a DFRobot Arduino kit. It was a bunch of small hardware projects to teach you how to wire things up and build different circuits. Once I played with that for a few days I decided to take the next leap and get myself a bind and fly drone. For ¥1,500 I got myself a full FPV bind and fly QAV250 with a Cleanflight SP Racing MOF3 v1 and a cheap radio and box goggles.

Prior to this I spent about 2 weeks, everyday, doing research on all the parts, how they fly, how to solder, Betaflight, etc. Once I got it I opened it and took the drone apart! I wanted to see if I could put it back together, the way I learned. Turns out I burnt up the FC and had to send it back … more research! I finally get it back and decide to not touch it. I take it out and fly and my first flight was amazing! … for about 5 seconds, then I nose dive into the concrete and break it. I send it back again for repairs. After that I decide to get a simulator, upgrade my radio and really learn to fly. After a few more crashes and self repairs I was really flying! I bet a lot of you can relate.

I then start connecting with some local people and finding out it’s actually pretty big in this area. A few more upgrades and a couple more drones and I’m making videos. Then something really cool happened. I was contacted by a friend and asked if I would like to test out some hardware and maybe work with her a bit, of course I say yes! In the beginning I was just wanting to fly and play with hardware, wasn’t expecting this. My background is software development, so naturally I start progressing towards figuring out how to program it and do other things. One thing leads to another and I’m contributing to MAVSDK-Swift and MAVSDK-Swift-Example repos.

So, right now, I’ve got in my hands the Holybro Pixhawk4 Mini QAV250 Kit. I’m trying to write some software for the iPhone and iPad that’ll allow me to control the drone using my phone. The software hasn’t been the problem though, it’s been the hardware. This kit comes with the Holybro 433Mhz 100mW Sik Telemetry Radio and mini. Connecting it to QGC on my MacBook has been fine, everything works. I even purchased an ESP8266 Wifi module and was told to wire it up to the larger radio then connect my iPhone/iPad to the wifi module, that worked great with QGC too. Although, I had to change the baud rate from 921600 to 57600 for it to work.

The problem came when I tried to connect the MAVSDK-Swift-Example app to the drone, it wouldn’t make a connection. Turns out, I think, it has something to do with the baud rate thing. So, after some discussions and research I found out that by connecting the ESP8266 to the radios was overkill. If I connected it to the PX4 directly then it would solve the baud rate problem and should work. So I attempted that and turns out there aren’t really any 3.3v ports available for this module, to my knowledge, for this kit. I’ve had to order the AMS1117 to take a 5v and drop it down to the 3.3v this module needs. Oh, and I had to order another ESP8266 because I think I blew this one up … oops!

Also, I found out, with some recent updates to MAVSDK-Swift and MAVSDK-Swift-Example I could actually use the ESP8266 and the radios by writing some code in Swift. drone.setMavlinkPort(mavlinkPort: "serial:///dev/ttyusb0:57600"). I have yet to test this though as my wifi module is in the mail. So, that’s where I’m at right now. If anyone has any tips, tricks, etc then that would be helpful. I’m learning as I’m going but I am making progress. I’m hoping to get this to all work soon and then I can start building some cool projects, maybe like an AR app to see where your drone is, we’ll see how that goes.

I’ll post my updates here.

1 Like

You can actually power an esp8266 directly on 5v. The spec sheet is conservative. There’s a thread from espressif about that somewhere on the internet…

1 Like

I’ve tried that, and the module I have blew up

I’ve just tried using the code

drone.setMavlinkPort(mavlinkPort: "serial:///dev/ttyusb0:57600")

and it didn’t work. This is the error message I’m receiving.

2019-07-20 12:48:51.380155+0800 DronecodeSDK_Swift_Example[1074:1642001] [DYMTLInitPlatform] platform initialization successful
2019-07-20 12:48:51.521163+0800 DronecodeSDK_Swift_Example[1074:1641842] creating player instance using shared library
Running backend in background (MAVLink port: serial:///dev/ttyUSB0:57600
[12:48:51|Info ] DronecodeSDK version: 0.17.0 (dronecode_sdk_impl.cpp:25)
[12:48:51|Debug] New: System ID: 0 Comp ID: 0 (dronecode_sdk_impl.cpp:338)
[12:48:51|Info ] Server set to listen on (grpc_server.cpp:44)
[12:48:51|Info ] Server started (grpc_server.cpp:28)
[12:48:51|Info ] Waiting to discover system... (connection_initiator.h:58)
[12:48:51|Error] open failed: No such file or directory (serial_connection.cpp:87)
[12:48:51|Error] Connection failed: Connection error (connection_initiator.h:47)

I’m probably going to put this on hold and take my second wifi module I’ve received today and connect it directly to the drone using the AMS1117.

UPDATE!! It now works, but I don’t know why.

So, as you know when I side load the Example App onto my iPhone it wasn’t establishing a connection using the ESP8266 Wifi Module wired to the HB Telemetry radio. However, today I used my computer and the Xcode Simulator to see if it would make the connection, and it did immediately. I was able to arm the drone and everything. So, I then connected my iPhone to the same Wifi network (Pixracer) and started the Example App. It took about 5 seconds to make a connection then after 4 seconds it disconnected. I waited another 15 second and it made the connection again. Now it seems to just be working.

I’m using drone.setMavlinkPort(mavlinkPort: "udp://:14550")