While the Mosquitto bridge works fine there is one feature supported by Mosquitto but missing from LUCI/UCI. Topic mapping.
It is only possible to configure:
- Topic
- Direction
- QoS level
Which is fine if you don't intend to prefix topics from this proxy. But there are many situations where you do want add a prefix. Situations where "dumb" devices behind the proxy needs a UUID prefix as a way to separate them from other devices behind another proxy.
Two input fields, one for "local-prefix" and one for "remote-prefix" would be enough (for each topic).
My current solution is to manualy edit and abuse the qos field in /etc/config/mosquitto by adding "" my-remote-prefix/ which doesn't work with the LUCI interface.
Example:
config topic
option qos '1 "" rut-modbus/523851a8-9f95-4d01-9e9c-80da338bef0b/'
option topic '#'
option direction 'both'
Prefered solution:
config topic
option topic '#'
option direction 'both'
option qos '1'
option local '""'
option remote 'rut-modbus/523851a8-9f95-4d01-9e9c-80da338bef0b/'