Page 1 of 1
ESPEasy parse serial data rule
Posted: 25 Apr 2021, 23:05
by xzsdre
Hello!
Please help to suggest.
Is it possible to do the following in EspEasy using a rule (or in another way)?:
The serial receives cyclic data in the form:
А_365.68
B_356: 54
C_964.32
А_336.63
B_956: 54
C_132.62
and so on, the interval between lines is about 1 second.
I need to parse this data into 3 different variables (for example, A, B, C) and send it to the server (domoticz) using an nttp request or mqtt...
Thanks.
Re: ESPEasy parse serial data rule
Posted: 26 Apr 2021, 00:12
by TD-er
You could try the "serial proxy" plugin.
Not sure if it will be usable in rules acting on the event of the task to access the fetched data as %eventvalue1%, but you can at least try it.
If you can log the fetched data in a simple rule and use it to send it to the log, then I guess you can use the relatively new substring commands to process the string and form it into a message to publish to MQTT.
See:
https://espeasy.readthedocs.io/en/lates ... #substring
Re: ESPEasy parse serial data rule
Posted: 26 Apr 2021, 16:02
by xzsdre
Thanks!
I solved my question in half without resorting to parsing. I immediately send the SendToHTTP command to the serial port. Everything works from the web interface, but for some reason the serial port does not want to receive any commands. In the settings, the serial port is active. Perhaps there are some other problems related to the serial port?
Build:⋄ 20112 - Mega
System Libraries:⋄ ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄
Plugin Count:⋄ 47 [Normal]
Build Origin: Travis
Build Time:⋄ Feb 23 2021 12:29:15
Binary Filename:⋄ ESP_Easy_mega_20210223_normal_ESP8266_4M1M
Build Platform:⋄ Linux-5.4.0-54-generic-x86_64-with-glibc2.29
Git HEAD:⋄ mega-20210223_9054eb3
Re: ESPEasy parse serial data rule
Posted: 26 Apr 2021, 18:10
by xzsdre
I managed to figure out what was the matter. The reason is in the Espeas firmware. I flashed the version from ESP_Easy_mega_20201016_normal_ESP8266_4M1M and the serial port worked as needed, commands are received correctly!
Build:⋄ 20111 - Mega
System Libraries:⋄ ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄
Plugin Count:⋄ 46 [Normal]
Build Origin: Travis
Build Time:⋄ Oct 16 2020 23:40:01
Binary Filename:⋄ ESP_Easy_mega_20201016_normal_ESP8266_4M1M
Build Platform:⋄ Linux-4.19.104-microsoft-standard-x86_64-with-glibc2.29
Git HEAD:⋄ mega-20201016_1a7f662
At the moment I have no more questions, thank you all for the tips!
Re: ESPEasy parse serial data rule
Posted: 26 Apr 2021, 19:52
by TD-er
What version was not working?
And what was happening when preparing the commands?
Re: ESPEasy parse serial data rule
Posted: 26 Apr 2021, 20:00
by xzsdre
Version, which not worked - ESP_Easy_mega_20210223_normal_ESP8266_4M1M.
Version, that worked - ESP_Easy_mega_20201016_normal_ESP8266_4M1M.
The only difference was that the 20201016 version responded normally to commands on the serial port, and version 20210223 did not react in any way to the input to the serial.
When loading 20210223 version, only information about the assembly, the firmware version, and that there was a connection via wi-fi (standard output) is written to the uart. And nothing more. There is no reaction to the receiving commands... The same commands from the web interface (tool -> command) are processed correctly.
Re: ESPEasy parse serial data rule
Posted: 26 Apr 2021, 20:05
by TD-er
Do you have any plugin assigned to a task that may also need the serial port?
Re: ESPEasy parse serial data rule
Posted: 26 Apr 2021, 20:09
by xzsdre
No, I haven't activated any plugins. New firmware - and just trying to send commands to serial. Perhaps this is just my problem, but for everyone else on version 20210223, the serial input commands works correctly
![Rollende Ogen :roll:](./images/smilies/icon_rolleyes.gif)
Re: ESPEasy parse serial data rule
Posted: 27 Apr 2021, 00:36
by TD-er
OK, will have a look at it.