Skip to content

Adding LEDs to Edison to report on battery and server status

Robin Edwards edited this page Nov 5, 2015 · 22 revisions

First we need to deactivate the Buendia Server to connect to LAN internet. This is covered in more detail here. To do this connect to the Edison using screen, as documented in setup. You'll find yourself in Yocto (NB. not the jailed Debian OS that Buendia runs on and is accessible via e.g. chroot /home/root/debian/ /bin/bash or directly via ssh; screen is recommended here as ssh will be disrupted). Run the next 4 lines together:

echo "NETWORKING_AP=0
NETWORKING_DHCP_DNS_SERVER=0
NETWORKING_SSID=your_network_id
NETWORKING_PASSWORD=your_network_pwd" > /home/root/debian/usr/share/buendia/site/99-local

reboot

When you're back up, test the internet with

curl icanhazip.com

GPIO Setup

GPIO appears to only work from Yocto. Yocto comes pre-installed with the necessary GPIO libraries, but does require an update. Yocto's package manager (equivalent of apt-get) is opkg, and work's in pretty much the same way.

opkg update
opkg install libmraa0

Test the GPIO

mkdir /home/root/gpio
cd /home/root/gpio

Run the following 13 lines together:

echo "import mraa
import time

# Setup
x = mraa.Gpio(32)
x.dir(mraa.DIR_OUT)

# Loop
while True:
    x.write(1)
    time.sleep(0.5)
    x.write(0)
    time.sleep(0.5)" > blink.py

Connect an LED to your Edison's GPIO Block - high to the 'GPIO44' pin, low to 'GND' Make sure you add a resistor (e.g. 1k) in series to protect the LED.

python blink.py

You should now be blinking.

Buendia server status LED

Clone this wiki locally