Date post: | 05-Aug-2015 |
Category: |
Technology |
Upload: | sergei-silnov |
View: | 88 times |
Download: | 0 times |
Arduino 1.6.4
http://www.arduino.cc/en/Main/Software
Firmware Updatehttps://downloadcenter.intel.com/download/24748
I2C BMP 085 Pressure and T sensorhttps://github.com/adafruit/Adafruit-BMP085-Library
SD Card & Yocto Linuxhttps://software.intel.com/en-us/iot/hardware/galileo/downloadsdiskutil list
diskutil unmountDisk disk2
sudo dd bs=8m if=iotdk-galileo-image of=/dev/disk2
ctrl+t - show progress of dd
Setup SSH via Direct link LANssh [email protected]
date -s "2015-06-04 01:03:00"
opkg update
opkg upgrade
Linux GPIOecho "42" > /sys/class/gpio/export // Arduino io12
echo -n "strong" > /sys/class/gpio/gpio42/drive // (pullup|pulldown|strong|hiz)
echo "out" > /sys/class/gpio/gpio42/direction // (out|in)
echo "1" > /sys/class/gpio/gpio42/value
echo "0" > /sys/class/gpio/gpio42/value
echo "42" > /sys/class/gpio/unexport
Pin mapping:http://www.emutexlabs.com/project/203-getting-started-with-intel-galileo-gen-2
Pins/pythonimport sysimport time
def pins_export(): try: pin1export = open("/sys/class/gpio/export","w") pin1export.write("42") pin1export.close() except IOError: print "INFO: GPIO 3 already exists, skipping export" fp1 = open( "/sys/class/gpio/gpio42/direction", "w" ) fp1.write( "out" ) fp1.close()def write_led( value ): fp2 = open( "/sys/class/gpio/gpio42/value", "w" ) fp2.write( str( value ) ) fp2.close()
pins_export()while True: print "on" write_led( 1 ) time.sleep( 1 ) print "off" write_led( 0 ) time.sleep( 1 )
Web Servercurl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
pip install --upgrade setuptools
pip install virtualenv
mkdir ml && cd ml
virtualenv venv
source venv/bin/activate
pip install bottle
vi ws.py
python ws.py
…
deactivate
from bottle import route, run, templateimport sysimport os
@route('/')def index(): lines = [] with open('/sys/class/gpio/gpio42/value') as f: lines = f.readlines() return lines[0]
run(host='localhost', port=8080)