BeagleBone and LED

BeagleBone Green Wireless


The BeagleBone Green Wireless board is a new board from SeeedStudio; and I was lucky enough to find one on my desk last week.

BeagleBone Green Wireless

BeagleBone Green Wireless

The BeagleBone Green Wireless board is based upon the open-source hardware design of the BeagleBone Black, but has the advantage of a high performance WiFi and Bluetooth interface, and two Grove connectors to allow the board to be used with the Seeed Grove range of sensors.

The board has an impressive specification including:-

  • AM335x 1GHz ARM® Cortex-A8 Processor
  • 512MB DDR3 RAM
  • 4GB 8-bit eMMC on-board flash storage
  • 3D graphics accelerator
  • NEON floating-point accelerator
  • 2 x PRU (Programmable Real-Time Unit) 32-bit microcontrollers

In terms of connectivity, the board features the following:-

  • USB client for power & communications
  • USB host with 4-port hub
  • WiFi 802.11 b/g/n 2.4GHz
  • Bluetooth 4.1 with BLE
  • 2 x 46 pin headers
  • 2 x Grove connectors (1 for I2C and 1 for UART)

Getting started with the BeagleBone Green Wireless is really easy, and full instructions for this can be found at the following link:-

http://beagleboard.org/getting-started

The board comes with 2 wireless antennae, which need to be attached to the sockets on the board; which was a little fiddly.

Having done this, it’s simply a matter of plugging the board in to a USB socket, and installing any necessary drivers, as described in step 2 of the ‘getting started’ instructions. These drivers allow the board to show up as a separate drive containing web pages, applications, documents, drivers and scripts. There are also some FTDI USB to serial drivers to allow you to open a serial SSH connection to the board. At this stage, there isn’t even the necessity to download any software images for loading onto a micro SD card.

Once powered up, it is also possible to connect to the BeagleBone Green Wireless using a mobile device. Simply scan for the BeagleBone wireless connection, and connect to it. You will be prompted to sign in to a WiFi network, at which point you will need to select the SSID of the network to which you wish to connect the BeagleBone, and enter the password for this SSID. Once connected, the BeagleBone will be assigned an IP address, and it is possible to browse to this IP address using a browser, and to open an SSH connection to the BeagleBone.

Once connected to the BeagleBone through SSH, it is possible to explore the Linux shell, and to see how to use some of the devices on the board. Being able to control simple devices through the GPIO is always useful, so we took a look at this first.

Controlling the GPIO is fairly simple from the Linux command shell. The image below shows the commands that are required to light an LED connected to one of the GPIO pins.

GPIO Commands

GPIO Commands

BeagleBone and LED

BeagleBone and LED

The BeagleBone Linux shell also includes a Python interpreter, so it’s possible to run Python scripts, and controlling the BeagleBone GPIO through Python is quite simple; once you understand the GPIO pin setup. We found an excellent tutorial in the use of BeagleBone GPIO using Python at the following link:-

Beaglebone Black Lesson 4

Using this tutorial allowed us to knock together a fairly simple program to flash a couple of LEDs connected to pins 41 and 42 on header P9. The ground pins of the LEDs are connected to pins 43 and 44. Our simple program is shown below:-

Python Program

Python Program

BeagleBone and LED

BeagleBone and LED

BeagleBone and LED

BeagleBone and LED

 

Flashing new software

And then it all started going wrong. Having managed to do some basic stuff with the board, I decided to have a go at upgrading the board software. According to the instructions, this is done by downloading the latest software image, and writing the image to a micro SD card. Having done this, the BeagleBone needs to be booted with the micro SD card in the card slot. Once booted, it is necessary to open a command window using SSH, and to then edit the file /boot/uEnv.txt to remove the comment from the start of the line that controls the flashing of the eMMC on the board. Once this is done, the board needs to be rebooted. The instructions for flashing the eMMC on the BeagleBone Green Wireless vary, depending on where you look, and some of the instructions say that it is necessary to press the ‘User Boot’ button when the board is powered back up in order to flash the board, whereas other instructions do not mention this. I found it to be unnecessary to press the ‘User Boot’ button.

When the board is powered back up, the flashing of the eMMC should start, as indicated by the 4 blue LEDs next to the micro USB socket flashing in a back and forth motion. Once the flashing is complete, all 4 of these blue LEDs light up simultaneously for a few seconds, following which all LEDs on the board go out completely. This is the signal to unplug the board, remove the micro SD card from the card slot, and then restart the board by plugging it in again.

Unfortunately, once the board was restarted, I found a number of issues. The first issue was that when I tried to setup the board on the network, the board prompted for a password in order to connect to the BeagleBone SSID using WiFi. A quick search on Google showed that the password for this is ‘BeagleBone’. However, once connected, I also discovered that the BeagleBone no longer prompted me to select an SSID and password for the BeagleBone to connect to the WiFi network. Additionally, and bizarrely, I could no longer connect reliably to the board using the default USB IP address of 192.168.7.2. Sometimes it would connect, and other times it would not.

Luckily, it was still possible to connect to the board using the serial port. Having done this, I found that it was necessary to manually set up the WiFi for the board using the steps described in the following link:-

https://cdn-learn.adafruit.com/downloads/pdf/setting-up-wifi-with-beaglebone-black.pdf

Unfortunately, even once this had been done, although the WiFi did appear to automatically connect to the wireless access point following a reboot, and even to pick up an IP address through DHCP, I could not connect to the board over SSH using the assigned IP address, or to browse to the IP assigned IP address. This meant that it was necessary to login using serial SSH, and to manually stop and restart the wireless connection using the commands:-

wfdown wlan0

wfup wlan0

Even then, I found that I could not reliably SSH to the board using the assigned IP address until after I had browsed the IP address.

After much searching the internet for a solution to this problem, I eventually came across the following article:-

https://www.ccoderun.ca/programming/2016-06-29_BBGW/

Although some of the links from this particular web page appear to be dead, I found the following link did provide access to some images:-

https://rcn-ee.com/rootfs/bb.org/testing/

Unfortunately, even after trying a number of these images, I was still unable to reliably get my BeagleBone Green Wireless to connect to our wireless access point.

Despite these failures, I soldiered on; determined that I would find a solution. Further searching on Google eventually led me to the BeagleBoard forum, and ultimately to a particular post under the Newbie -> Seeed BeagleBone Green -> Software -> Support section. This post suggested that they had managed to solve this particular issue using the image below:-

https://rcn-ee.online/rootfs/bb.org/testing/2016-06-19/seeed-iot/BBGW-blank-debian-8.5-seeed-iot-armhf-2016-06-19-4gb.img.xz

This, finally, appeared to provide an image which, once flashed to the board, allowed me to successfully set up the board on our WiFi access point, and to successfully (and reliably) connect to the board using the IP address assigned to the board.