Monday, December 21, 2015

Warning: it's easy to screw this stuff up and lose the ability to ssh into the beaglebone when you reboot. Usually it was as simple as manually setting the IP address on my laptop, but you may not be so lucky. You may not want to attempt this if you don't have a good handle on TCP/IP networking.My Keebox W150NU seems to be doing a good job with a BeagleBone black as a wifi access point. (I get about 3MB/s beaglebone -> laptop). Beware that lots of other adapters (eg., Edimax and D-Link) work really poorly or not at all with the BeagleBone.

With a newer BeagleBone green, the W150NU was recognized out of the box, but on an older BBB with another adapter I had to update the kernel first:

Update kernel if your wifi adapter isn't detected (or if you just want to be up to date):

First I did 'sudo apt-get update ; sudo apt-get dist-upgrade'

Then I upgraded the kernel so it'd recognize the usb wifi adapter:

'cd /opt/scripts/tools ; git pull ; ./update_kernel.sh'

On BeagleBone Green they tweaked a file to say "BBG" instead of "BBB", so I had to revert it with: 'cd /opt/scripts ; git checkout tools/eMMC/init-eMMC-flasher-v3.sh' then 'git pull' again before I could run the 'update_kernel.sh' script.

Rebooting, the W150NU appeared as wifi2.Next, I followed the instructions here to set up hostapd. First, 'sudo apt-get install dnsmasq hostapd'Here's my /etc/hostapd/hostapd.conf (beware leading and trailing spaces, or hostapd.conf will refuse to start):

And don't forget to set this in /etc/defaults/hostapd:DAEMON_CONF="/etc/hostapd/hostapd.conf"I couldn't get dnsmasq or isc-dhcp-server to work consistently, though. Turns out that 'netstat -nlp' showed udhcpd was binding to 0.0.0.0 on port 67 (which is a bug, since it ignores the "interface" option), so the other dhcp servers can't start.Hint: /var/log/daemon.log is where a lot of the error messages show up.I fixed that with 'mv /usr/sbin/udhcpd /usr/sbin/udhcpd.disabled', although it would probably have been better to 'apt-get purge udhcpd'.Here's my /etc/dnsmasq.conf:interface=usb0dhcp-range=192.168.7.1,192.168.7.1,4hinterface=wlan0dhcp-range=192.168.4.2,192.168.4.10,4h

And I also added this to /etc/network/interfaces:auto wlan0iface wlan0 inet static address 192.168.4.1 netmask 255.255.255.0 network 192.168.4.0 gateway 192.168.4.1That seems to do it, except that I have to "ifup wlan0" after startup on my BeagleBone Green. The Black doesn't seem to need that for some reason I haven't figured out yet.

Looks like the way to get kernel updates is to use /opt/scripts/tools/update_kernel.sh. When I first tried it, I got errors like "The certificate of `rcn-ee.net' is not trusted".

So the first step was to "git pull" down the latest version of the update_kernel.sh script, then run it. Upon reboot, it recognized the wifi adapter.

Also note that beaglebone doesn't always do USB hotplug right, so I made sure to reboot after plugging in the adapter.

Also, even after updating the kernel, my Edimax and D-Link adapters show up but won't associate to an access point. The Keebox W150NU seems to be working well, though.

Update: Even with the W150NU, I had trouble connecting to public networks. I noticed this in dmesg: "deauthenticating from by local choice (reason=3)", which led me to a page recommending that I kill wpa_supplicant, and that fixed it.

Wednesday, December 16, 2015

USB Host (big type A jack): 20MB/s writing to a Seagate USB3 2TB portable (spinning) hard disk (required plugging a 5V 4A power supply into the BeagleBone Black's power jack). On BeagleBone Green, I got corruption with the Seagate disk, even when I powered the board from a bench supply. With thisSamsung 64GB USB flash drive I get 14-18MB/s write on both BeagleBone Green and Black.Disk: 4.3MB/s writing to onboard flash, and 7.1MB/s to a SanDisk Ultra 64GB microSD card. On BeagleBone Green, I get 9.4MB/s to onboard flash, and 6.8MB/s to the same SanDisk microSD card.Network: Using netcat with the USB ethernet interface, I get 7.6MB/s upstream (to my laptop). With the 100baseT jack I get 11.2MB/s upstream. If I use ssh with its default cipher, I get about 10MB/s, but that goes back up to 11.1MB/s if I use "-c arcfour".Compression: gzip -1 gives me 4.1MB/s on text generated by "cat /dev/urandom data | od -x". I tried lz4 as well and it was almost exactly the same speed.