First test is successful by adding following packages to buildroot.
- python-pycparser
- python-cffi (need to update the existing package)
- python-smbus-cffi
- python-rpi-gpio
Note: tested with Pi -1
Now I can use RPi.GPIO 0.6.1 library to control Raspberry Pi GPIO channels.
https://pypi.python.org/pypi/RPi.GPIO
1 Like
Test 2: Display Signal Lock status:
Tested with ORxPi 2.6 /Pi2
#!/usr/bin/python
from Adafruit_CharLCD import Adafruit_CharLCD
from subprocess import *
from time import sleep, strftime
from datetime import datetime
lcd = Adafruit_CharLCD()
cmd = "echo -ne '<get uri=\"/status\"/>\\0' | nc local:/var/run/ondd.ctrl | grep -o '<lock>.*</lock>'"
lcd.begin(16, 1)
def run_cmd(cmd):
p = Popen(cmd, shell=True, stdout=PIPE)
output = p.communicate()[0]
return output
while 1:
lcd.clear()
ipaddr = run_cmd(cmd)
lcd.message('%s' % (ipaddr))
sleep(2)
sudo ./lock.py
LOCK - YES
LOCK - NO
Sorry for the image quality. The back-light of the LCD is not working (defective).
1 Like