[SERIAL] Add the capability send info to Serial instead of/added MQTT (#2030)

* [SERIAL] Add the capability send info to Serial instead of/added MQTT

Add the capability to send json data to Serial as a communication layer, added/instead of MQTT

* Use delay rather than vTaskDelay

---------

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
FlorianandFlorian authored and GitHub committed 2024-08-27 13:23:42 -05:00
1 parent 3d6d9baeaf
commit 5492e334dc
7 files changed
+143 -89

No files matched your search

+22 -1
View File
@@ -273,13 +273,34 @@ The `server_cert` parameter is optional. If the update server has changed or cer
The pre-built binaries for **rfbridge** and **avatto-bakeey-ir** have the above WiFi and MQTT broker credentials and the Firmware update via MQTT options disabled. This is due to the restricted available flash, so as to still be able to use OTA firmware updates for these boards.
:::
# Communication layers
## MQTT
OpenMQTTGateway uses per default MQTT on top of Ethernet or WiFi for communicating (default: true).
The MQTT communication can be deactivated with the following command:
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m '{"mqtt":false}'`
Once activated the MQTT API is no longer accessible
## Serial
Added to MQTT, OpenMQTTGateway cans use Serial to transmit or receive json data (default: false):
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m '{"serial":true}'`
The build need to have the following macro:
```
'-DZgatewaySERIAL="SERIAL"'
```
An example scenario is a slave offline ESP32 dedicated to RF decoding connected to another online ESP32 through Serial.
# Indicators
## Change the LED indicator brightness
Minimum: 0, Maximum: 255, Default defined by DEFAULT_ADJ_BRIGHTNESS
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m '{"brightness":200}'`
# State LED usage
## State LED usage
The gateway can support up to 3 LED to display its operating state:
* LED_INFO
+1 -1
View File
@@ -6,7 +6,7 @@ The SERIAL gateway can be used to send and receive data from the serial connecti
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/MQTTtoSERIAL -m '{"value": "!"}'`
`mosquitto_pub -t home/OpenMQTTGateway/commands/XtoSERIAL -m '{"value": "!"}'`
It will automatically add the prefix and postfix you set in [config_SERIAL.h](https://github.com/1technophile/OpenMQTTGateway/blob/master/main/config_SERIAL.h).