The goal of this little project is to demonstrate how easy it is to add hardware to PocketBeagle® and get it working. We do this by creating a simple 8-Ball toy by adding the MPU 9DOF click and OLED C click to PocketBeagle®
Also, it can make all your executive decisions for you, so you don't have to! We used ours to help predict FIFA WorldCup team success!
Read more about the motivation behind the project on our blog and in this fun video:
The following figure shows the pin-out of the 2 headers of PocketBeagle®.
BeagleBoard.org® PocketBeagle® pin-out
The default function of each pin is highlighted in dashed line. Click boards™ have a standardized MikroBUS™ pin-out (shown below).
Click board interface
BeagleBoard.org® PocketBeagle® (pictured below) headers conform to the MikroBUS™ standard and allow for two click boards™ to be interfaced with PocketBeagle® at a time (shown in the following figure). Although no guarantees are made with respect to compatibility, most click boards™ work with PocketBeagle® with a little bit of effort.
BeagleBoard.org® PocketBeagle® header pins with click board positions
Click boards™ plugged into BeagleBoard.org® PocketBeagle®
Follow the below steps to display a picture on the OLED C click. This procedure assumes that an SD card with a Linux image from Beagleboard.org: https://beagleboard.org/latest-images is installed on PocketBeagle®. Please see the PocketBeagle System Reference Manual for additional information on bringing up and connecting PocketBeagle®.
Install the 2 click boards into the 2 available positions on the PocketBeagle. The positions are important as we need to select the device tree overlays according to them. For this project, install the OLED C click board in position 1 and MPU 9DOF click on position 2. By installing the click boards this way, we select the interface with which the click boards interact with the PocketBeagle. The OLED C click uses the SPI0 interface and MPU 9DOF click uses the I2C2 interface. The 2 click boards installed on the PocektBeagle are shown below:
<<need new photo>>
Use a Micro-USB to USB cable to connect PocketBeagle® to a computer/laptop. You should be able to bring up the Cloud9 IDE by entering the URL: http://192.168.7.2:3000/ide.html into the web browser. (use http://192.168.6.2:3000/ide.html for MAC o/s) Make sure you are using Chrome or Firefox. The IDE should look like the following figure:
Check whether the Beagle Linux image you are using to see if the device tree overlay files you need are present in the file system.
If you don't see the following files in the directory, you will need to download both of them from the attachments.
Next copy this same device tree overlay binary files (.dtbo) into /lib/firmware directory
sudo cp PB-SPI0-OLEDC-CLICK.dtbo /lib/firmware/ sudo
Don't forget to enter the password for debian (temppwd) when you execute a command as root
Edit /boot/uEnv.txt to invoke overlay on boot with this command
sudo nano /boot/uEnv.txt
Enter the names of overlay binary files(with total path) into uEnv.txt and un-comment the uboot_overlay_addr# variables that the overlay binary was assigned to
###Additional custom capes uboot_overlay_addr4=/lib/firmware/PB-SPI0-OLEDC-CLICK.dtbo uboot_overlay_addr5=/lib/firmware/PB-I2C2-MPU-9DOF-CLICK.dtbo #uboot_overlay_addr6=/lib/firmware/<file6>.dtbo #uboot_overlay_addr7=/lib/firmware/<file7>.dtbo
Save /boot/uEnv.txt (use ctrl+o) ENTER then exit (use ctrl+x) and then reboot
- After boot up, you should see some text displayed on screen
- Download the 8-Ball.zip file(Attached to this hackster) to your PC and unzip the contents. Upload the unzipped folder to PocketBeagle® by dropping it into Cloud9 IDE.
- Make sure the screen does not time out (approx 3 mins). You should still see the letters on the screen. If the screen is blank, the screen has timed out. If this occurs, reboot.
- make sure you have fbi (Linux Frame Buffer Image-viewer) installed in the PocketBeagle to display image on screen. (You may have to install this program by connecting PocketBeagle® to the internet.(https://github.com/beagleboard/pocketbeagle/wiki/FAQ#How_do_I_get_connected_to_the_Internet)
- Change current directory to 8_ball. If you followed step 5, you should see the directory in cloud9. Use cd to go into the directory.
- Change permission of display.sh file in this folder so it can be executed as part of the code
chmod +x display.sh
- Execute 8_ball.py
sudo python3 8_ball.py
Now is the time to ask the PocketBeagle® Magic 8-Ball some questions. Go ahead and give it a shake!