IoTPy

Internet of Things with Python

Setup Edison

Install Pip, Python Package Index to install and manage software packages written in Python

  1. root@edison:~# opkg install python-pip
  2. root@edison:~# pip install psutil paho-mqtt twython
  3. root@edison:~# pip install --allow-all-external pywapi --allow-unverified pywapi
  4. root@edison:~# pip install --allow-all-external plotly --allow-unverified plotly
  5. root@edison:~# opkg install python-numpy opencv python-opencv nano alsa-utils mpg123

Setup Galileo

Install Pip, Python Package Index to install and manage software packages written in Python

  1. root@galileo:~# curl -O https://bootstrap.pypa.io/get-pip.py
  2. root@galileo:~# python get-pip.py
  3. root@galileo:~# curl https://bootstrap.pypa.io/ez_setup.py -o - | python
  4. root@galileo:~# pip install psutil paho-mqtt twython
  5. root@galileo:~# pip install --allow-all-external pywapi --allow-unverified pywapi
  6. root@galileo:~# pip install --allow-all-external plotly --allow-unverified plotly
  7. root@galileo:~# opkg install python-numpy opencv python-opencv nano alsa-utils
  8. root@galileo:~# cd
  9. root@galileo:~# wget http://downloads.sourceforge.net/project/mpg123/mpg123/1.22.4/mpg123-1.22.4.tar.bz2
  10. root@galileo:~# tar xvf mpg123-1.22.4.tar.bz2
  11. root@galileo:~# cd mpg123-1.22.4/
  12. root@galileo:~# ./configure
  13. root@galileo:~# make
  14. root@galileo:~# make install

Not Working!

  1. opkg update python-pygame

IoTPy Framework

Clone the IoTPy Workshop Git Repository

  1. root@platform:~# git clone https://github.com/TheIoTLearningInitiative/InternetOfThings101.git

Enable IoTPy Workshop credentials

  1. root@platform:~# cd InternetOfThings101/iotpy
  2. root@platform:~/InternetOfThings101/iotpy# mkdir configuration
  3. root@platform:~/InternetOfThings101/iotpy# nano configuration/credentials
  4. # IoTPy File Configuration
  5. [plotly]
  6. username =
  7. apikey =
  8. streamtoken =
  9. streamtokentx =
  10. streamtokenrx =
  11. [twitter]
  12. consumer_key =
  13. consumer_secret =
  14. access_token =
  15. access_token_secret =
  16. [voicerss]
  17. mashapekey =
  18. apikey =
  19. # End of File
  20. root@platform:~/InternetOfThings101/iotpy# echo <voicerss mashapekey> > configuration/voicerss.ak
  21. root@platform:~/InternetOfThings101/iotpy# echo <voicerss apikey> > configuration/voicerss.mk

Run IoTPy Modules

  1. root@platform:~/InternetOfThings101/iotpy# python main.py -m aio
  2. root@platform:~/InternetOfThings101/iotpy# python main.py -m bpta
  3. root@platform:~/InternetOfThings101/iotpy# python main.py -m gpio
  4. root@platform:~/InternetOfThings101/iotpy# python main.py -m mqttpub # IoTPy/Temperature
  5. root@platform:~/InternetOfThings101/iotpy# python main.py -m mqttsub
  6. root@platform:~/InternetOfThings101/iotpy# python main.py -m mraa
  7. root@platform:~/InternetOfThings101/iotpy# time python main.py -m opencv

Run IoTPy Projects

  1. root@platform:~/InternetOfThings101/iotpy# python main.py -p alive # Audio, Twitter
  2. root@platform:~/InternetOfThings101/iotpy# python main.py -p climate # BMP180, PlotLy, https://plot.ly/~TheIoTLearningInitiative
  3. root@platform:~/InternetOfThings101/iotpy# python main.py -p selfie # Camera, Twitter
  4. root@platform:~/InternetOfThings101/iotpy# python main.py -p system # Network, Plotly, https://plot.ly/~TheIoTLearningInitiative
  5. root@platform:~/InternetOfThings101/iotpy# python main.py -p weather # Audio, Pywapi