Graspop 2014
I would like to share with you a short video of Graspop 2014 on June 27th. This was crazy, the first band of the bay at noon, and everybody was already out to watch Alestorm. I didn’t know what to expect, but I certainly didn’t expect to end up at the bottom of a collapsed wall of death. It was an amazing experience, I’m looking forward to next year: 20th Graspop anniversary edition!
Firefly: The Boardgame
Two weeks ago we played Firefly: The Board Game. We weren’t able to finish it this time, it was only the second time we played it, and we still don’t have the rules quite down to play the game a little faster. The estimated 2hrs play-time indicated on the box is wildly optimistic.
It contains a lot of references to the Firefly series, and I’m a huge fan of everything Firefly, so that’s a really great plus, but the game has a bit too many obscure little rules that make us consult the manual way too often. After three hours of play we didn’t even get past the first goal (of three) and we had to give up. Hopefully the speed picks after a few plays, once we get familiar to the rules.
Boardgames: new additions to the collection
Quadcopter part 4: the parts have arrived
Quadcopter Part 3.2: Fixing the poor wireless performance
I stumbled upon this site from Adafruit. It talks about a number of problems with Wireless on the Beaglebone. One of that is poor driver support for RealTek based devices, which I’ve also ran into, and it informed me that the HDMI circuit causes a lot of signal interference, and that degrades the performance of small wireless USB dongles in particular because of their close proximity to that circuit.
So their solutions are worth a try as well.
To fix the HDMI interference they propose to:
- Disable the HMDI circuit in the bootloader configuration
- Move the USB dongle away from the board, either with a USB extension cord, or with a small USB hub.
In my quadcopter case, I’d rather not add more hardware, and I don’t need the HDMI interface, so I’ll just try to turn it off, following the steps on the Adafruit guide. To be honest, after doing the steps and rebooted the board I don’t see such a major improvement with the HDMI off.
To fix the driver issue, they don’t upgrade the kernel to the testing image, but instead upgrade to the latest stable and then install a service which will reset the wireless dongle during boot, in order to stabilize it. But in my case, when using the testing (3.16) kernel, it does more harm than good: the wireless connection doesn’t appear to come back up after reboot.
The wireless saga continues…
UPDATE: to give you some idea on the level of poor performance. I ran iperf from the beaglebone to my laptop over the wireless network here at home, and it report over a 1 minute interval an average speed of about 450Kbits/sec. If I move the dongle further away from the board, by using a USB hub, I get 730Kbit/sec, which is only marginally better.
UPDATE 2: even the wired network is very limited in bandwidth, more tests are needed to find out what is going in here. In the mean time I ordered a new type of USB dongle, one from the list on the beaglebone wiki. Hopefully that works.
Quadcopter part 3.1: Updating the kernel
Apparently, updating the Linux kernel with a pre-build image from Robert C Nelson on the beaglebone black is extremely easy. The scripts to do so are already installed available in the standard debian build I used.
Following these instructions on a clean debian install, gave a running debian with a 3.16 kernel (I used the testing image).
The LogiLink wireless dongle works out of the box with that kernel, no fiddling with the driver was necessary.
Quadcopter part 3: wireless on the beaglebone
UPDATE: It looks like updating the kernel is an easier solution than replacing the RealTek driver, see part 3.1 for more information.
UPDATE 2: The reason that the wireless performance is so poor on my setup, would be (according to the Adafruit site) because of signal interference with the HDMI circuits. The small USB wireless dongles in particular would be very susceptible to this because of their close proximity. See part 3.2 on how I tried to fix it.
In my previous mail I gave you the parts for my quadcopter project. That list also contained this LogiLink NANO WL0085a wireless dongle. These dongles arrived in the mail today, and right away I set out to try one on the beaglebone black boards, the one that I have already flashed with the debian image I found on the beagleboard website.
It was supposed to just work straight out of the box… It didn’t. This post will describe the things I had to do to make it work.
First thing, the dongle needs to be plugged in before you power on the device. For some reason, it won’t be detected when plugged in after bootup.
And secondly, make sure the beaglebone black is powered via the 5V DC connector. I was able to salvage an adapted from an old discarded routed that had the same connector. Although it was only rated for 1.2A, it does seem to power it properly.
Now, the dongle was receiving power, the networking parameters set, and still it wouldn’t connect to the wireless network here at home. So on with the hunt for a solution I first looked for the device information:
root@beaglebone:~# lsusb
Bus 001 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
With this in hand, Google points me to website stating that the realtek driver provided in the beaglebone image doesn’t work.
So I download the driver sources from the RealTek Drivers page, and copy the zip file to the beaglebone. I didn’t bother with setting up the whole toolchain and kernel headers on my local machine so I could cross compile a simple loadable kernel module for the arm, I decided it would be easier to set it up on the beaglebone itself, and have it compile there.
Before you are able to compile a kernel module, you also need the linux headers. Normally this would just be an “apt-get install linux-headers-3.8.13-bone50“, but this package doesn’t exist. So I had to go look elsewhere for it. And here it is: linux-headers-3.8.13-bone50_1.0precise_armhf.deb. Just install if like you would install any other debian package: “dpkg -i xxxxxx.deb“.
Back to the Realtek driver directory, there is a subdirectory called “driver”, cd into it, and unpack the tar ball. cd into the extracted directory and type in “make ARCH=arm“.
Error.
root@beaglebone:~/Projects/quadcopter/debian_image/realtek_driver/RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911/driver/rtl8188C_8192C_usb_linux_v4.0.2_9000.20130911# make -C /lib/modules/3.8.13-bone28/build M=/root/rfm12b-linux modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.13-bone28'
CC [M] /root/rfm12b-linux/rfm12b.o
In file included from include/linux/timex.h:65:0,
from include/linux/jiffies.h:8,
from include/linux/ktime.h:25,
from include/linux/timer.h:5,
from include/linux/workqueue.h:8,
from include/linux/srcu.h:34,
from include/linux/notifier.h:15,
from include/linux/memory_hotplug.h:6,
from include/linux/mmzone.h:761,
from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /root/rfm12b-linux/rfm12b.c:20:
/usr/src/linux-headers-3.8.13-bone28/arch/arm/include/asm/timex.h:18:24: fatal error: mach/timex.h: No such file or directory
A discussion I found online (here) suggested I just create an empty timex.h file in the linux headers, because it serves no purpose anyway:
root@beaglebone:~# cd /usr/src/linux-headers-3.8.13-bone50/arch/arm/include/
root@beaglebone:/usr/src/linux-headers-3.8.13-bone50/arch/arm/include# mkdir mach
root@beaglebone:/usr/src/linux-headers-3.8.13-bone50/arch/arm/include# touch mach/timex.h
The code compiles, run “make install” to install the module and blacklist the old ones like so:
cd /etc/modprobe.d
echo "install rtl8192cu /bin/false" >wifi_blacklist.conf
echo "install rtl8192c_common /bin/false" >>wifi_blacklist.conf
echo "install rtlwifi /bin/false" >>wifi_blacklist.conf
I rebooted the board, and there I had it: a wireless connection! But results are still a bit depressing. It is very slow, and it occasionally drops out. I read elsewhere online that later versions of the kernel (>=3.12) should work alot better, but I’m not sure whether there is a beaglebone standard image available for that. Maybe I have to cook my own instead, and set up a buildroot (or something) instead.
Quadcopter part 2: Parts ordered
I ordered the parts for the quadcopter this week. The frame will be 450mm wide (that would be the distance between the engines), and according to my calculations it will put about 1,1kg on the scale, while being to lift almost 3kg. That should leave me some room to install upgrades in the future (LED lighting, small camera, …), considering that the weight should not exceed half the lifting capability.
To power the Beaglebone Black board I was considering destroying a small USB charger that you would also see in your car. But then I’ve read that when powering the BBB via USB, you should be careful with power consumption of peripheral devices. It won’t be able to power USB devices on its host controller that way. And since I want to use a USB wireless dongle to connect to the quadcopter, and according to the specs I would need a 5V/2A power source connected to the DC plug for this, I had to consider something else. The idea now to use the 5V output of one the speed controllers BEC connector. This 5V is meant to power the receiver, so that’s what I’ll try to do. This 5V source is rated for a current up to 2A. Connecting it to the DC plug, means I get free use of the voltage regulators on the BBB as well.
I do need to investigate whether the 3.3V PWM output signals of the BBB are enough for the speed controllers, it should but if not I will need a level converter, or maybe just a few transistors to boost it to 5V.
Partslist:
The frame:
1x Q450 V3 Glass Fiber Quadcopter Frame 450mm – Integrated PCB Version
The speed controllers, motors and propellors:
5x TURNIGY Plush 30amp Speed Controller
5x NTM Prop Drive Series 28-30S 900kv / 270w (short shaft version)
2x 10×4.5 SF Props Black CW (2pc) CCW (2pc)
5x NTM Prop Drive 28 Series Accessory Pack
The battery, charger and low voltage alarm:
2x ZIPPY Compact 3700mAh 3S 35C Lipo Pack
1x On-Board Lipoly Low Voltage Alarm 2s~3s
1x HobbyKing® B3AC Compact Charger
Sensors (accelerometer, gyro, atmopheric presssure and magnetometric):
1x Arduino 10DOF (L3G4200D, ADXL345,HMC5883L & BMP085) Sensor Stick Breakout- for MWC/KK/ACM
Wireless dongle:
2x Logilink WLAN stick N150 nano WL0084A
Nuts and bolts:
1x Straight Pin Header 3 Row 30Pin 2.54mm Pitch (5PCS)
1x Straight Pin Header 2 Row 30 Pin 2.54mm Pitch (5PCS)
1x Pin Header 1x30Pin 2.54mm Pitch Straight (5PCS)
2x PolyMax 3.5mm Gold Connectors 10 PAIRS (20PC)
1x Polymax 5.5mm Gold Connectors 10 pairs (20pc)
1x DC connector cable 5.5mmx2.1mm
1x Assortiment solid core wire
The only thing missing here are some screws and nuts to bolt the BBB to the frame.
Quadcopter part 1: the beaglebone black
The first parts for the quadcopter have arrived: the beaglebone black boards that I would like to use as controllers. I bought two, one for use on the quad and another for experimentation and general tinkering. The beaglebone black comes with four PWM output pins I hope can be controlled at the same time, I still have some documentation to read and small experiments to make to find out which interfaces to use best. Next up would be to figure out which other parts to order first and to get a go at the design of the software to control the quad.