This Intelligent Transportation Systems (ITS) MQTT client based on the JSon ETSI specification transcription provides a ready to connect project for the mobility (connected and autonomous vehicles, road side units, vulnerable road users,...). Let's connect your device or application to our Intelligent Transport Systems (ITS) platform!
Note the installation path (e.g. /home/login/.local/bin).
Create a configuration for 3 IQM:
We will use three IQMs, iqm-1, iqm-2, and iqm-3, where iqm-1 and iqm-2 are neighbours, and _iqm2 and iqm-3 are neighbours, i.e. iqm-1 <-> iqm-2 <-> iqm-3:
Change the list of neighbours (renaming is enough to trigger a reload):
$ sed -r -i -e 's/iqm-/IQM-/' neighbours-*.cfg
Expected results:
its-iqm has been installed.
The configuration files are ready and available in the current directory
The three IQMs are running
The three mosquitto brokers are running; each IQM notices its broker is available and connects to it on the corresponding port, e.g. for iqm-1:
2023-03-31 13:22:18,064 main: loading config file iqm-1.cfg...
2023-03-31 13:22:18,065 main: create IQM...
2023-03-31 13:22:18,065 iqm: create
2023-03-31 13:22:18,065 iqm: create local qm
2023-03-31 13:22:18,065 mqtt_client: [local]: create to 127.0.0.1:11881
2023-03-31 13:22:18,065 main: run IQM...
2023-03-31 13:22:18,065 mqtt_client: [local]: starting for 127.0.0.1:11881
2023-03-31 13:22:18,066 file: starting central file client to neighbours-1.cfg@5
2023-03-31 13:22:18,066 file: loading neighbours
2023-03-31 13:22:18,066 iqm: stopping old neighbours (if any)...
2023-03-31 13:22:18,066 iqm: starting new neighbours (if any)...
[...]
2023-03-31 13:22:49,075 mqtt_client: [local]: connected to 127.0.0.1:11881
The IQM connects to the MQTT broker without delay:
2023-03-31 14:08:31,570 main: loading config file iqm-1.cfg...
2023-03-31 14:08:31,571 main: create IQM...
2023-03-31 14:08:31,571 iqm: create
2023-03-31 14:08:31,571 iqm: create local qm
2023-03-31 14:08:31,571 mqtt_client: [local]: create to 127.0.0.1:11881
2023-03-31 14:08:31,571 main: run IQM...
2023-03-31 14:08:31,571 mqtt_client: [local]: starting for 127.0.0.1:11881
2023-03-31 14:08:31,572 file: starting central file client to neighbours-1.cfg@5
2023-03-31 14:08:31,572 file: loading neighbours
2023-03-31 14:08:31,573 mqtt_client: [local]: connected to 127.0.0.1:11881
2023-03-31 14:08:31,573 iqm: stopping old neighbours (if any)...
2023-03-31 14:08:31,573 iqm: starting new neighbours (if any)...
[...]
The three _mosquittosub are running in the background
Each broker reports messages on its inQueue and the messages are also duplicated to the outQueue and interQueue on the same broker (empty lines added for readability):
How to test:
Note the installation path (e.g.
/home/login/.local/bin
).iqm-1.cfg
:iqm-2.cfg
:iqm-3.cfg
.tmp
extension):neighbours-1.cfg.tmp
:neighbours-2.cfg.tmp
:neighbours-3.cfg.tmp
:mosquitto -c /dev/null -p 11881 >/dev/null 2>&1 &
mosquitto -c /dev/null -p 11882 >/dev/null 2>&1 &
mosquitto -c /dev/null -p 11883 >/dev/null 2>&1 &
Ctrl-C
in the terminal running the IQM to stopExpected results:
Each broker reports messages on its inQueue and the messages are also duplicated to the outQueue and interQueue on the same broker (empty lines added for readability):