Skip to main content

Python CLI to report back the sensor data from our arduino(s). See (https://pypi.org/project/ardu-report-lib/ / https://github.com/inofix/ardu-report-lib) for the main library.

Dependencies, Requirements

  • Unix/Linux

  • Python 2/3

  • tested against: 2.7 and 3.5 (main lib has unittests and Travis-CI)

  • this is just a frontend for ‘ardu-report-lib’ (main dependency)

  • see requrements.txt for further dependencies

Basic Idea

For now we have one arduino reporting sensor values back over the serial line. On the other end there is a raspberry pi collecting the data. The data is then processed and either just printed to the console or a file, or sent over mobile or wired/wireless network to, e.g., a webserver..

If more than one arduino are connected. For each one of them the data processing can be configured individually.

Use it for Your Project?

I am rewriting the input parser to accept any JSON schema following the meta schema to control the object index names. As it really only needs some sort of identifier and a value, there should not be too many obstacles to use it for your project too.

See the ‘schema’ folder for details on the implementation.

The ‘example’ folder contains JSON file that validates against the schema and the tests/test_json.py has a test run for both the input.json against the schema and the schema against the meta-schema.. Furthermore there is an extended-input.json that validates against an example customized schema (extended-input-schema.json), with itself still validates against the meta-schema.json.

Example Data for Python Processing

INPUT: JSON from the arduino over the serial line

There are two examples under the ‘examples’ folder.

The simple ‘input.json’ shows two example measurements. The “id” and “value” entries in the object are mandatory. The “unit” and “threshold” are interpreted for the stdout log. Any other entry will just be passed on to the output (except for the sdtout log case).

Note that no timestamp joins the data. Most of the time there is no clock source available to the dump sensor controller. The timestamp is added in the output below though. If a timestamp is available in the input, it can still be passed on of course.

See the ‘extended-input.json’ for an example with more enries and custom naming.

OUTPUT: Target JSON from the raspberry pi for the use in e.g. a web app

Based on the URL specified, the data is appended to a file (”file://”) as a continuing list of JSON objects containing sensor value entries or sent as a complete JSON array to a web server (”http://” / “https://”) as a POST request. If the URL string is empty, the data is just printed in text form to stdout.

Example JSON output can be found under the examples folder:

  • output.json - default

  • custom-output.json - if an output JSON scheme is defined, the entries can be translated. The output JSON must validate against the meta schema..

Release files for ardu-report 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ardu-report 1.0.0
File Size Uploaded
ardu-report-1.0.0.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ardu-report 1.0.0
File Interpreter ABI Platform
ardu_report-1.0.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 14.0 kB

Release files / ardu-report-1.0.0.tar.gz

Download URL ardu-report-1.0.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ba60f240a0a9f941488ca6b4d286fbfd8234f97528983808eba7fd71e0810246
BLAKE2b-256 checksum
How to use checksums
7bd3d2cfcde5c713ed7cc281a288ee8656df515513be3d33ecd84b5125403687
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ardu_report-1.0.0-py2.py3-none-any.whl

Download URL ardu_report-1.0.0-py2.py3-none-any.whl
Size 8.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3d15422e24802d9bd563fd3b591e1d52384132a4faf9ef822552d48b82ead6a7
BLAKE2b-256 checksum
How to use checksums
67d1ddceeb02d61f5a97b182c282dd1fa3e6097f17a7e1cf2fedff745873b6a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page