Open TheCodeSummoner opened 4 years ago
MQTT I think MQTT can be a good application layer to build messaging around. Payloads of bytes are sent on topics via TCP. Topics are expected to be used periodically with a single connection to the broker remaining open.
In our case topics can be used to organize messaging to various consumers and processors of information. We may update power measurements periodically or only use some sensors briefly.
Coordination is handled by a broker server forwarding topic publications to subscribers, in this case probably the surface server is also the broker.
The power system for example has measurements of voltage, power and temperature we may want to monitor. For each of these we can organize them in a topic:
'monitor/bus-12v/
A use case to log all publications: Subscribe too '#' and write too a log file.
Schemas and Payloads The actual payload to send on a topic can be json or apache thrift. The schema should be channel/topic appropriate:
Using MQTT here can help you organize schemas for various groups of sub topics.
/alarm/...
sub topics may have be a user facing warning with an appropriate fields in JSON
/monitor/...
may be for raw sensor data again with appropriate fields.
I don't have much to say about logging from software but I can see this being useful for some hardware sensor logging.
Hmmm, do you think we could use software logging for the program to access offline (because we will have access to the computer onboard and I don't want to use the bandwidth), and possibly use the MQTT stack for hardware debugging "offline" too? But then surely we can use the system logs (?)
It would make sense to use the hardware debug over serial when debugging actually.
Hmmm, do you think we could use software logging for the program to access offline (because we will have access to the computer onboard and I don't want to use the bandwidth), and possibly use the MQTT stack for hardware debugging "offline" too? But then surely we can use the system logs (?)
All MQTT traffic goes through the broker, so with a broker on the ROV it will not send anything to the surface, except to any subscribers which can be restricted to low bandwidth topics. A permanent storage subscriber on the ROV itself ought to be fine, the broker may have options for logging traffic+payloads itself.
It would make sense to use the hardware debug over serial when debugging actually.
MQTT should be ok for Arduino with Ethernet shield, but serial is an option we have used ok in the past, the Pi can forward serial messages onto MQTT if needed.
@antoinepetty would you mind having a look at it? It might be a bit of an overkill I think. It is described as a great tool for IoT which I believe makes sense, but we don't have an excessive amount of communication. I do believe however that it would be good to build our messaging/logging upon an existing protocol.
I have just had a brief look but it seems like a viable option. We could use it for the normal data transfer we had last year, but also for logging which could easily be switched on from the surface (but only using bandwidth when required). I think it's worth trying to implement MQTT, can always switch to a custom protocol if it ends up not fitting our needs. (+good experience for members going on to IoT)
So I spoke with some IBMers and they generally say it's a viable option for logging because of its pub/sub schema. However, it would make no sense for us to use it as a standard communication protocol.
So if I understood:
@antoinepetty @TheCodeSummoner
@thisiswhereitype Exactly that. We don't want to use it as a way to transfer data normally, just the logging bits.
Moving to "High priority" to pick up later when low-level logging comes into place and we've tried out MQTT.
Moving to blocked because this issue waited too long to be marked as 'high priority'
The proposed logging format is as follows:
Additionally, for more verbose logging:
@thisiswhereitype suggested Mqtt and asked to share further thoughts. This is where you type.