No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2020-01-09 10:57:42 +01:00
media Add files via upload 2017-06-30 00:10:49 +02:00
.gitignore First commit. 2016-10-24 09:35:27 +00:00
__init__.py better to explicitly require parts than to load them all 2017-10-09 19:22:10 +02:00
LICENSE Create LICENSE 2016-10-24 11:36:21 +02:00
measurement.py First commit. 2016-10-24 09:35:27 +00:00
README.md adjust readme 2020-01-09 10:57:42 +01:00
serial.py First commit. 2016-10-24 09:35:27 +00:00
sios.conf.sample First commit. 2016-10-24 09:35:27 +00:00
sios.py First commit. 2016-10-24 09:35:27 +00:00
watcher.py has to send values all the time 2017-06-24 23:54:30 +02:00

Simplistic I/O Services

The goal is to make it easier to write Python scripts to read, process and act on sensor data.

Requirements

  • Linux environment (like a RaspBerry Pi)
  • Python3

Installation

Just clone or download the files and put them in a sios folder inside your script folder.

Examples

Read and persist sensor data from Arduino

import sios

arduino = sios.Serial('/dev/ttyACM0', 9600)
temperature = sios.Measurement()
r = sios.redis_server()

while True:
    response = arduino.send('get')

    if not response:
        continue

    gas.add(response)   # add recevied sensor value to measurement
    print(gas.get(3))   # print mean for last three points
    print(gas.mean)     # print mean for all points (300 by default)
    print(gas.stdev)    # print standard deviation for all points
    print(gas.length)   # print the number of points
    if gas.rising:      # if current measurement is outside the normal distribution (3 sigma)
        print('Rising!!')
        
    r.set('temperature', gas.get(1))  # Persist the last measurement point in Redis

    time.sleep(1)

Author

Thomas Jensen