ESPEasy parse serial data rule

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
xzsdre
New user
Posts: 8
Joined: 25 Apr 2021, 22:56

ESPEasy parse serial data rule

#1 Post by xzsdre » 25 Apr 2021, 23:05

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.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEasy parse serial data rule

#2 Post by TD-er » 26 Apr 2021, 00:12

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

xzsdre
New user
Posts: 8
Joined: 25 Apr 2021, 22:56

Re: ESPEasy parse serial data rule

#3 Post by xzsdre » 26 Apr 2021, 16:02

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

xzsdre
New user
Posts: 8
Joined: 25 Apr 2021, 22:56

Re: ESPEasy parse serial data rule

#4 Post by xzsdre » 26 Apr 2021, 18:10

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!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEasy parse serial data rule

#5 Post by TD-er » 26 Apr 2021, 19:52

What version was not working?
And what was happening when preparing the commands?

xzsdre
New user
Posts: 8
Joined: 25 Apr 2021, 22:56

Re: ESPEasy parse serial data rule

#6 Post by xzsdre » 26 Apr 2021, 20:00

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.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEasy parse serial data rule

#7 Post by TD-er » 26 Apr 2021, 20:05

Do you have any plugin assigned to a task that may also need the serial port?

xzsdre
New user
Posts: 8
Joined: 25 Apr 2021, 22:56

Re: ESPEasy parse serial data rule

#8 Post by xzsdre » 26 Apr 2021, 20:09

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 :roll:

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEasy parse serial data rule

#9 Post by TD-er » 27 Apr 2021, 00:36

OK, will have a look at it.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 30 guests