This will be my first post here. Just sharing what I've been up to, and sort of documenting what I've done (particularly in the case that I have to back up a couple of steps and retrace them). I realize that I'm not the first to do a wifi based link, but I intend to document it well!
I've built a few multicopters with the DJI Naza. My first was a quad, which flew wonderfully until it lost a prop and fell out of the sky. My second was a flat hexcopter, which flew even better, until a battery puked midflight causing a bit of a rough dirt landing.
So now I have a list of "must have" items for my next build (which will salvage many of the parts from the prior two).
- Motor redundancy (Y6 configuration with Pixhawk oughta do it)
- GOOD telemetry. The OSD displaying voltage of a single cell didn't cut it. Pixhawk should have me covered there.
- Redundant bingo battery. I will have this switched in via relay whenever I (or the Pixhawk) commands RTL. Should ensure I get home no matter what... provided both batteries don't puke at the same time... :S
That's all well and good. But if I am going to rebuild, I might as well add some "like to have" features in there also. I've always been a bit disappointed in the quality of the analog video transmitters we use. They do their job just fine, but they are limited to 640 x 480, tend to be susceptible to interference, and require additional hardware to get the video to show up on the laptop I intend to use for a ground station.
In addition, my particular aircraft carry a 50 watt sound system for use at Burning Man. Long story there... :D Getting audio UP to the aircraft has been a challenge for me, I've tried both walkie talkies as well as an FM radio transmitter. Bleh. I needed a better way to do that as well, though this feature probably doesn't apply to everyone ;)
So long story short(er), I decided to use a Raspberry Pi computer with a camera module and a wifi adapter to connect to a laptop. The goal being to stream HD video to the laptop in real time. This has an added bonus as I can stream audio UP to the craft without pesky, noisy analog transmitters. I still needed telemetry, however.
Originally I wanted to use usbip to connect the Pixhawk virtually over the wifi network via USB, but both usbip and a similar program called USB-redirector have much difficulty installing properly on the Raspberry Pi. Those that have reported getting it to work are reporting somewhat frequent crashes, though some of that MIGHT be attributed to the Pi being very finicky about how much power it is getting (plugging in one extra usb device sometimes will cause a lockup or crash without proper power).
Luckily, the telemetry port on the Pixhawk is a simple serial I/O port! There's a very small and simple program called ser2net that allows the Raspberry Pi to share a serial port over TCP/IP. I could either use a USB to serial adapter, or use the built-in serial port on the Pi's GPIO connector. I chose the latter. After changing a few files to force the Pi to let go of it's serial port (ttyAMA0) I was able to assign it to a port on my wifi network. APM Planner 2 allows me to connect directly to this TCP port, and voila, telemetry over wifi.
Of course, this is all well and good, but how far out can I go? Most wifi only goes a couple hundred feet at best... going farther would surely break the bank, right?
I am happy to say that the answer is "NO!" Using a "Gemini Doctor 48db" (same as "Signal King 48db") adapter on the ground, and an ALFA awus036NHA on the "Pi in the sky" I was able to stream 25 fps video approximately 1/2 mile along the ground, using my hand as a crude gimbal pointing back at the house. My adapters were set at 800mw at most, but likely (due to Ubuntu) I was transmitting from the laptop at only 200mw. Either way it worked fine. I purposely "broke the link" by pointing the patch antenna away and back towards the house a couple of times. Everything synced back up nicely. In addition, the camera software allows me to capture 5mp still images, or record HD video onto the SD card on the Pi with a click of a button, and download to the laptop as well. Good stuff!
So what's the total cost?
- Raspberry Pi $25 (donated by my uncle, so free for me :D)
- Camera module $35 (also donated!)
- ALFA awus036NHA $30 (sometimes they sell for $60. Other adapters may work as well, but the ALFA awus036NHR V.2 is a BIG NONO. Won't connect reliably on the Pi, but works great on my windows box... go figure...)
- "Gemini Doctor Signal King" whatever adapter. $20. That's right. 20 bucks.
Total? $110. Less than most folks spend on an analog setup. I spent more on a fancy case for the Pi, and experimenting with the awus036NHR V.2. The system isn't very heavy, either. The Pi supposedly weighs 45 grams. The adapter is about the same. Camera module can't be more than 15 grams. And the other wifi adapter is on the ground so who cares XD
The real cost though, is grinding through getting everything to work properly. This was a huge trial and error process, and I'm happy to let everyone know what does and most certainly does NOT work. (speaking of, the awus036NHR V.2 doesn't provide a wifi hotspot in Linux either, so one can't even use it on the ground unless you have Win 7 or higher D:).
Things I still need to do:
The program I'm using to stream video is called RPi_Cam_Web_Interface. It is capable of streaming 1080p HD, but requires a larger browser window to do so. I have mine set to whatever the standard setting is right now, so I can tile the window along with APM planner for the viewing of telemetry and video on one window. It still records in HD and takes good pictures though :) No sense streaming full HD if I have to shrink the window in the end anyhow.
I'd like to develop a widget for APM planner to open a browser window inside of APM planner. That would be better than switching back and forth between APM planner and Firefox.
I need a tracking antenna. I've not gotten to the point of implementation yet. I can always hand-point the antenna in the direction I wish to fly (it has 2 omni antennas for up close - pretty sweet for 20 bucks). I'd prefer an ardupilot with GPS mounted on the back, and a winch servo to rotate past 360, and everything to automatically configure itself so my antenna happily points at my aircraft. A guy can dream....
I still.. um... need to build the actual aircraft. I have spent the past month getting the datalink to do ALL the things that I want it to do. I have enough parts to build a couple of multirotors, the issue was I plan to build this frame entirely around this datalink. I just didn't want to start until I got a proper range test. The pictures below are of prior multicopters.
Camera lenses. I'm going to mount a few cell phone lenses on a disk and use a servo to position them in front of the Pi camera. This will all be mounted in a tic-tac box. Mmmm fresh breath. :D
Portable GCS. I have a large toolbox that I can put everything inside. I plan to build a charging station, 12v and 120v in and out (for solar and shore charging and laptop power). It currently holds my flat hex, and a computer monitor adapted to receive analog video.
That's all I have for right now I think... I'll post more as I start the build.
(old photos below)