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). Next:

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 neccessary GPIO libraries, but does require one to be updated. Yocto's package manager (equivalent of apt-get) is opkg, and work's in pretty much the same way.

opkg update
opkg install libmraa0

To test GPIO works:

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

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 'GPIO44', 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.

Clone this wiki locally