Run the NodeNs gateway
Project description
The purpose of this program - NodeNs Gateway - is to operate an MQTT gateway for connection to NodeNs sensors. The gateway will detect NodeNs sensors connected to the MQTT host, process their data, and optionally publish to a Cloud service and/or save to local storage.
Installation
NodeNs Gateway can be installed using pip:
pip install nodens.gateway
Troubleshooting
Installing PyYaml. Pip sometimes has trouble installing the PyYaml package. If you experience this, it may be easier to install it manually:
pip install pyyaml
Operation
NodeNs Gateway can be executed directly from the command line as follows:
python -m nodens.gateway
It can also be imported as a library into your own scripts:
import nodens.gateway
On execution, as a first step it will search for the configuration file config-gateway.yaml
to define the MQTT broker and other basic settings. The program will first search for the config file in the User's (your) default config folder, and then in the folder you've executed the program from. If the config file is not found, it will create one based on a default configuration. Click here for details of the Configuration.
If a Cloud service operation has been specified, the script will also search for relevant access tokens or certificates.
Configuration
Location of configuration file
The program will search for the configuration file config-gateway.yaml
in the following order:
- In the user config folder, e.g.
- Windows: /Users/<user>/AppData/Local/NodeNs/Gateway/
- Unix: ~/.config/Gateway/
- In the current working folder.
- In /NodeNs/
- In /
- Otherwise, a default config file will be created in the user folder, and the program will print its location. Feel free to edit it as necessary!
Description of settings
Program
WRITE_FLAG : Set to 1 if you require sensor data to be saved to disk. Data will be saved in csv form to: <current folder>/Saved/ CLOUD_WRITE_TIME : How often data is saved to a Cloud service (if activated)
Sensor
Sensor_IP : IP address of the MQTT broker. Default: 10.3.141.1.
Thingsboard setup
Thingsboard provisioning: https://thingsboard.io/docs/paas/getting-started-guides/helloworld/#step-1-provision-device
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nodens_gateway-24.5.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e450af8e5873323d96b67e0b844b3a745d392c2bc3a80c4136da535202cdd0d |
|
MD5 | d9b1e054c220d4815751827c220be24f |
|
BLAKE2b-256 | 68253d871df2a150854114bf7ae70977872f6988d5cd6b1fa5308b8ca78d96a9 |