Basic RS232 Communication (#780)

* Added ZGateway RS232
This commit is contained in:
DieKatzchen authored and GitHub committed 2020-10-19 13:48:58 -05:00
1 parent 546b27773f
commit 3df16d2d52
11 files changed
+242

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
# RS232 gateway
## Sending an RS232 message
Simply publish the message you wish to transmit, minus the prefix and postfix. For example, to send the "Turn On" signal for a Mitsubishi XD221U projector, the code is simply '!' so you would use the command
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoRS232 -m '{"value": "!"}'`
It will automatically add the prefix and postfix you set in [config_RS232.h](https://github.com/1technophile/OpenMQTTGateway/blob/master/main/config_RS232.h).
## Receiving an RS232 message
To receive a message, subscribe to all with `mosquitto_sub -t +/# -v`
and perform an action that should get a response from the device. For example, If I were to send the "Turn On" signal from earlier, I would receive back
```json
home/OpenMQTTGateway/RS232toMQTT {"value":"1"}
```
Because this projector echoes back a received command to acknowledge. Some devices will send a NACK, or Negative Acknowledge, to confirm that they received your message but could not comply. That would look like
```json
home/OpenMQTTGateway/RStoMQTT {"value":"!:N"}
```