- tmux
- emqtt with emq_sn enabled
- python >= 3.6
- pip3
To install 2rsystem requirements, execute:
pip3 install -r requirements.txt
- Download and install http://emqtt.io/
- Run emqtt.
emqttd console
- Edit emq_sn with custom configurations:
# emq_sn.conf
mqtt.sn.port = 1885
mqtt.sn.advertise_duration = 900
mqtt.sn.gateway_id = 1
mqtt.sn.enable_stats = off
mqtt.sn.enable_qos3 = off
mqtt.sn.predefined.topic.0 = reserved
- Enable emq_sn plugin
./emqttd_ctl plugins load emq_sn
- Reload emqttd if necessary.
To run 2rsystem, execute:
./run.sh
It will open a splitted tmux with all 2RSystem nodes. Make sure MQTT server is running before.
Also, you can run without tmux.
inv run -l info
-l
option indicates the loglevel, warning
(default), info
and debug
.
You can run a single node of the system, execute:
inv run -i kernel -l info
# or
inv run -i controller -l info
# or
inv run -i transmitter -l info
# or
inv run -i processor -l info
# or
inv run -i kernelcontrol -l info
If you try to execute 2RSystem out of a Raspberry, it'll crash. You can simulate the Raspberry behavior with the rpi-mock
flag.
./run.sh --rpi-mock --log debug
Also, you can execute inv run
with the same flag.
inv run -i kernel -l info --rpi-mock
You can test manually using:
inv run --log debug
inv faker --mqttsn --timer 0.1 # if you are using MQTT-SN in kernel
inv faker --mqtt --timer 0.1 # if you are using MQTT in kernel
To run 2rsystem tests, execute:
pytest
It is necessary to start MQTT server to execute pytest.