Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
scripts
src
README.md
init.sh
run.py
run.sh
setup.py
setup.sh
ubuntu-logo.png
version.py

README.md

Server - SAKURA IoT Platform Alpha

sakura_iot_fab_sensor

Web app display sensor data in line chart
Receive data from Sakura IoT Platform.
Store data in MySQL database.
Read data from the database, and display in [Google Chart] (https://developers.google.com/chart/interactive/docs/gallery/linechart).

Arduino sketch in sensor side

Requirements

Install

$ cd ~
$ mkdir virtualenv
Copy directory sakura_iot_fab_sensor under directory /home/YOUR_USER/virtualenv

cd ~/virtualenv
$ virtualenv venv
( You do not need to excute this command more than once, if you excuted this at once. )

$ source venv/bin/activate
(venv) $ cd sakura_iot_fab_sensor
(venv) $ python setup.py install
(venv) $ deactivate

you can use service daemon for Debian

$ sudo sh init.sh
edit script file
$ vi /etc/default/sakura-iot-fab-sensor

run at once
pip install --upgrade MySQL-python $ pip install --upgrade flask $ cd ~/virtualenv/sakura_iot_fab_sensor
$ run python run.py

edit setting file
$ cd ~/.sakura_iot_fab_sensor/conf
$ vi user.conf

run service daemon

$ sudo /etc/init.d/sakura-iot-fab-sensor start

quite service daemon

$ sudo insserv -r sakura-iot-fab-sensor

Usage

Access using web browser.
http://YOUR_SERVER_URL:5050/

  • route none
    display sensor data in graph
  • route api
    return one day sensor data
  • route post
    store sensor data to database
  • route status
    return unixtime when server status is green

Blog (Japanese)

http://android.ohwada.jp/archives/7077