../

Summary

The BBGW was announced in May 2016. It is very similar to the previous BBG. The three big differences are:

I've previously written a HOWTO on setting up BBB and BBG devices, but the BBGW is slightly different due to the lack of a network port. This page describes how I setup my own BBGW devices.

What You'll Need

These instructions make several assumptions. You'll need the following:

Every few months, Robert C. Nelson updates the BB images he makes available, so it is nearly useless to link directly to a specific disk image. Instead:

2016-Jul-02: It looks like the BBGW changes haven't yet made it to the Ubuntu image. While the Ubuntu image file listed above will boot on the BBGW, you wont have access to WIFI or Bluetooth. The images that have the required packages for full use of the BBGW are in https://rcn-ee.com/rootfs/bb.org/testing/, such as BBGW-blank-debian-8.5-seeed-iot-armhf-2016-06-19-4gb.img.xz.

Installing

Run the following commands to extract the installation image and write it to the Micro SD card:

unxz BBB-eMMC-flasher-ubuntu-16.04-console-armhf-2016-06-09-2gb.img.xz sudo dd status=progress if=BBB-eMMC-flasher-ubuntu-16.04-console-armhf-2016-06-09-2gb.img of=/dev/sdx

2016-Jul-02: Similarly, if using the Debian BBGW images, these are the commands to run:

unxz BBGW-blank-debian-8.5-seeed-iot-armhf-2016-06-19-4gb.img.xz sudo dd status=progress if=BBGW-blank-debian-8.5-seeed-iot-armhf-2016-06-19-4gb.img of=/dev/sdx

Note the newer test image requires a 4 GiB Micro SD card, while the older Ubuntu images were 2 GiB in size.

At near 4 MB/s, expect the 3.4 GiB image to take 15 minutes to write.

Once the write is complete, eject the Micro SD card and move it to the BBGW. While holding down the boot switch in the bottom left corner, insert the USB cable into the BBGW to power it on. Holding down the boot switch will make it boot from the Micro SD instead of the on-board 4 GiB eMMC.

Once the 4 LEDs in the upper right begin their "sweep" pattern, you can release the boot switch. The BBGW will automatically power down once the installation is finished, at which time you can safely remove the Micro SD.

After you've removed the Micro SD card, press the reset switch, or remove and put back the USB power cable to get the BBGW to boot.

Configuring

The USB cable will be used to establish a ethernet-over-usb network connection between the desktop/laptop and the BBGW. Run the following command:

grep usb /var/log/syslog ... kernel: [388275.378936] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 kernel: [388275.378937] usb 3-2: Product: BeagleBoneGreen kernel: [388275.378939] usb 3-2: Manufacturer: Seeed kernel: [388275.378940] usb 3-2: SerialNumber: BBGW16053927 mtp-probe: checking bus 3, device 2: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2" kernel: [388275.399882] cdc_ether 3-2:1.0 eth1: register 'cdc_ether' at usb-0000:00:14.0-2, CDC Ethernet Device, 88:c2:55:80:d6:e7 kernel: [388275.399964] usbcore: registered new interface driver cdc_ether kernel: [388275.400046] usbcore: registered new interface driver cdc_subset NetworkManager[1112]: [info] [1467215443.2340] devices added (path: .../net/enx88c25580d6e7, iface: enx88c25580d6e7) NetworkManager[1112]: [info] [1467215443.2340] device added (path: .../net/enx88c25580d6e7, iface: enx88c25580d6e7): no ifupdown configuration found. ModemManager[1029]: [info] Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2': not supported by any plugin

From the three highlighted lines above (you may need to scroll) we can see the new interface on my desktop computer is called enx88c25580d6e7. To confirm this, run the following command:

ifconfig ... enx88c25580d6e7 Link encap:Ethernet HWaddr 88:c2:55:80:d6:e7 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:32 errors:0 dropped:0 overruns:0 frame:0 TX packets:128 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3962 (3.9 KB) TX bytes:25142 (25.1 KB) ...

Note how that interface doesn't have an IPv4 address. On the BBGW, the default address is 192.168.7.2. On the desktop/laptop, give the new interface the address 192.168.7.1 so they're both on the same network:

sudo ifconfig enx88c25580d6e7 192.168.7.1 ifconfig ... enx88c25580d6e7 Link encap:Ethernet HWaddr 88:c2:55:80:d6:e7 inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0 ...

You can now confirm that the ethernet-over-usb connection has been setup:

ping 192.168.7.2 PING 192.168.7.2 (192.168.7.2) 56(84) bytes of data. 64 bytes from 192.168.7.2: icmp_seq=1 ttl=64 time=0.584 ms 64 bytes from 192.168.7.2: icmp_seq=2 ttl=64 time=0.548 ms 64 bytes from 192.168.7.2: icmp_seq=3 ttl=64 time=0.506 ms

When the flasher image installed itself, it created a default user named "ubuntu" with a password of "temppwd".

2016-Jul-02: If using the Debian image, the default user is named "debian" with a password of "temppwd".

Start a new SSH session to the BBGW by running:

ssh ubuntu@192.168.7.2

Once logged in, run the typical configuration steps for a new BB system:

sudo rm /etc/ssh/ssh_host_* sudo dpkg-reconfigure openssh-server sudo dpkg-reconfigure tzdata sudo useradd --create-home --shell /bin/bash --user-group --groups sudo bob sudo passwd bob sudo passwd ubuntu sudo vi /etc/hostname /etc/hosts /etc/issue* /etc/motd

Apache2

Apache is setup to listen on port 8080, and provides zero content by default. (See /etc/apache2/ports.conf and /var/www/html/.) If you don't need it running, run:

sudo systemctl disable apache2

If it isn't needed at all and you want to remove it, then run:

sudo apt-get purge apache2 apache2-bin apache2-data apache2-utils

Setting up WIFI

When running ifconfig, there should be 4 interfaces listed:

  1. SoftAp0 is the software access point. The default image sets up the BBGW as an access point and uses the ip address 192.168.8.1.
  2. lo is the usual loopback at 127.0.0.1.
  3. usb0 is the ethernet-over-usb described above and uses the ip address 192.168.7.2.
  4. wlan0 is the wireless TI WiLink 8 (WL1835/WG7835-V0) IEEE 802.11b/g/n

Run the following commands:

sudo connmanctl technologies sudo connmanctl enable wifi sudo connmanctl scan wifi sudo connmanctl services

Assuming you are within range of your WIFI router, that last command should have given you two columns. For example, here is what it looks like for me:

sudo connmanctl services CCodeRun wifi_2cf7f1061eae_43436f646552756e_managed_psk Stinky Pete wifi_2cf7f1061eae_5374696e6b792050657465_managed_psk WiFiPlus3844-2.4G wifi_2cf7f1061eae_57694669506c7573333834342d322e3447_managed_psk

Make note of the service name (wifi_...) you want to connect to, because it will be needed in this next step. In this example, the wifi network to which my BBGW needs to connect is called CCodeRun, so the corresponding service name is wifi_2cf7f1061eae_43436f646552756e_managed_psk.

Create a new file where we'll store some information on the wifi network to which we want to connect:

sudo vi /var/lib/connman/CCodeRun.config

Paste this content into the new file. Make sure you set the highlighted fields correctly:

[service_wifi_2cf7f1061eae_43436f646552756e_managed_psk] Type = wifi Name = CCodeRun Passphrase = MyPassword

Since the file has our wifi password, set the permissions so only root has accesss:

sudo chmod 600 /var/lib/connman/CCodeRun.config

You should now have an address on your local wifi network. Run ifconfig to confirm.

If necessary, you can disconnect from one wifi network and connect to another. For example:

sudo connmanctl disconnect wifi_2cf7f1061eae_43436f646552756e_managed_psk sudo connmanctl connect wifi_2cf7f1061eae_57694669506c7573333834342d322e3447_managed_psk

Disabling SoftAp0

The SoftAp0 interface is set to address 192.168.8.1, and a nodejs process listens on port 80. For details, see /usr/bin/wifidog_pre, /etc/wifidog.conf, and /etc/default/wifidog-gateway. Since I use my BBGW as an end device and not a hotspot to which other computers can connect, I want this interface disabled.

The easiest way I found to do this was to edit the script /usr/bin/wifidog_pre:

Add this new line near the top of the script:

touch /tmp/wifi.up

Comment out this line at the bottom of the script, and add these 4 new lines below it:

# systemctl start wificonfig.service || true systemctl stop wificonfig.service || true systemctl disable wificonfig.service || true systemctl stop wifidog-gateway.service || true systemctl disable wifidog-gateway.service || true

Reboot the device after making these changes.

2016-Sep-09: The previous steps to disable WiFi Dog have caused me problems with the recent builds, where the wireless device wont come up at all.

Installing updates

Now that wifi is up and running, install NTP and download any pending updates:

sudo apt-get update sudo apt-get install ntp sudo apt-get dist-upgrade

Building on BBGW

The BBGW only has 512 MiB of RAM. If you try to build anything more complicated than a trivial application, gcc/g++ will run out of memory.

To alleviate this problem, you can setup a swap file:

sudo dd if=/dev/zero of=/swapfile bs=1K count=512K # 1024 * 512K = 512MiB sudo chown root:root /swapfile sudo chmod 0600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile

Add this line to the end of /etc/fstab so the swap file is automatically mounted on reboot:

/swapfile none swap sw 0 0

(Of course, a better solution is to setup cross-compiling for ARM.)

Last modified: 2016-09-09
Stéphane Charette, stephanecharette@gmail.com
../