Collection of firmwares and API servers for xwot devices.
This repository hosts the following resources for the xWoT devices of the Software Engineering Research Group:
Overview of the implemented RESTful API servers:
- basic devices:
- composite devices:
All APIs support the following content types:
- application/ld+json
- application/json
- application/xml
- text/html (TODO)
- text/plain (TODO)
The firmware for the xwot devices / arduino microcontrollers are available in the directory firmware.
The schematic files can be found in the directory schematic-files.
sudo apt-get install python-pip python-dev build-essential libffi-dev
sudo pip install twisted klein treq
git clone https://github.com/lexruee/yadp
sudo python setup.py install
git clone https://github.com/lexruee/xwot.py
sudo python setup.py install
Some useful resources about the I2C bus:
- Wikipedia I2C
- Linux kernel smbus-protocol
- I2C python documentation
- Using the I2C Interface
- Connecting an Arduino to a Raspberry Pi using I2C
Install i2c-tools, libi2c-dev and python-smbus via:
sudo apt-get install python-smbus i2c-tools libi2c-dev
To use i2c without root right please add the corresponding user to the group i2c.
Example: add user pi to i2c group
sudo usermod -a -G i2c pi
Reboot:
sudo reboot
See the adafruit i2c config guide.
Edit:
sudo nano /etc/modules
and these two lines:
i2c-bcm2708
i2c-dev
Edit:
/boot/config.txt
and add these two lines:
dtparam=i2c1=on
dtparam=i2c_arm=on
git clone https://github.com/lexruee/xwot-devices
cd xwot-devices/{xwot-device}/app
Before running runserver.py
please install all necessary dependencies:
sudo pip install -r requirements.txt
Finally, run it via:
python runserver.py
Running the server as daemon:
twistd -y runserver.tac
Stopping the server:
sudo kill `cat twistd.pid`
Because the xwot applications are RESTful they are browsable through so called REST clients:
xwot-devices - Collection of firmwares and API servers for xwot devices
Copyright (C) 2015 Alexander Rüedlinger
xwot-devices is licensed under the GPL 3.0.