Package: sensors_connectivity
Sensors Connectivity Module for Decentralized Sensors NetworkThe module for launching your own server instance for receiving data from sensors (like SDS011) and their further processing.Available GuidesWe have created a nice complete guide that reveals the idea of the Decentralized Sensors Network and the Sensors Connectivity module. The guide is available at Robonomics Academy:https://robonomics.academy/en/learn/sensors-connectivity-course/overview/Pre-requirementsIPFS daemon should be installed to build this package. Assuming you work on Linux:wget https://dist.ipfs.io/go-ipfs/v0.8.0/go-ipfs_v0.8.0_linux-amd64.tar.gz
tar -xzf go-ipfs_v0.8.0_linux-amd64.tar.gz
cd go-ipfs
sudo bash install.sh
ipfs initYou also need at leastPython3.10.0to run this project.Sensor PreparationTo prepare a sensor for the work with the package follow instructions onRobonomics Academy.Installation as PyPi packageRun the following commands:pip3 install py-sr25519-bindings
pip3 install sensors-connectivityConfigurationAt Robonomics Academy you can find an article to set a proper configuration for your instance:https://robonomics.academy/en/learn/sensors-connectivity-course/sensors-connectivity-config-options/LaunchFirst, launch IPFS daemon:ipfs daemon --enable-pubsub-experimentAfter configuration and log files are set, you can run the service in another terminal:sensors_connectivity "path/to/your/config/file"You will see logs in your terminal and in~/.logs.Build from SourceTo build a python package from sourcePoetryshould be also installed. Assuming you work on Linux:curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -Get a package and install dependencies:git clone https://github.com/airalab/sensors-connectivity
cd sensors-connectivity
poetry installConfigurationAt Robonomics Academy you can find an article to set a proper configuration for your instance:https://robonomics.academy/en/learn/sensors-connectivity-course/sensors-connectivity-config-options/Make a copy ofdefault.jsonand fill it using description from the article.You also can set a logging file. The default file for logs islogging.py, which usesconsoleandfilehandler by default. Pay attention to thefilehandler.The template is stored inconnectivity/config/logging_template.py. You can specify the path (filename), where your logs will be stored in (do not forget to create this directory if it doesn't exist). Default path for logs is~/.logs. You can find any other handlers in theLogging facility modulefor Python.LaunchFirst, launch IPFS daemon:ipfs daemon --enable-pubsub-experimentAfter configuration and log files are set, you can run the service in another terminal:poetry run sensors_connectivity "path/to/your/config/file"If your log file is set withconsolehandler, you will be able to see logs in your terminal.DevelopmentTo test the module with HTTP station use:poetry run test_mobile_lab
test_environmental_boxFor more information about development check/docsdirectory:https://github.com/airalab/sensors-connectivity/tree/master/docsTroubleshootingPython.h: No such file or directory::If during runningpoetry installcommand you get such error, you need to install the header files and static libraries forpython-dev. Use your package manager for installation. For example, foraptyou need to run:sudo apt install python3-devNote:python3-devdoes not cover all versions for Python 3. The service needs at least Python 3.10, for that you may need to specify the version:sudo apt install python3.10-dev.Hereyou can find examples for other package managers.Python versions mismatch:If during runningpoetry installcommand you getSolverProblemError, which saysThe current project's Python requirement (3.6.9) is not compatible with some of the required packages Python requirement:.., even though you have older version of Python (e.g. Python 3.10.9), you may need to specify the Python version for Poetry:poetry env use python3.10.9