Hello
Trying to make a control for a project:
https://www.elektroda.pl/rtvforum/topic3613898.html
In general, yes:
I have an ESP32 which is the main unit
There is an Arduino mega which sends data every 2ms via Serial2
There is also a PC Application which communicates with the ESP32 via Serial
The problem is that when I press a button on the application, the application sends a command via serial to the ESP32, but sometimes the reading is not correct
When I didn't use Serial2, everything was ok. When I use Serial2, I find that sometimes the information from the application is cut off. I thought, that there is some independent queuing and storing information from each serial, but here it turns out, that when information from Serial and Serial1 comes simultaneously, the one which comes first is read correctly, and the second one is not.
How can this problem be solved?
I am uploading the ESP32 code below, if that would help
Added after 4 [minutes]:
I thought about using a second processor, but it doesn't work
Trying to make a control for a project:
https://www.elektroda.pl/rtvforum/topic3613898.html
In general, yes:
I have an ESP32 which is the main unit
There is an Arduino mega which sends data every 2ms via Serial2
There is also a PC Application which communicates with the ESP32 via Serial
The problem is that when I press a button on the application, the application sends a command via serial to the ESP32, but sometimes the reading is not correct
When I didn't use Serial2, everything was ok. When I use Serial2, I find that sometimes the information from the application is cut off. I thought, that there is some independent queuing and storing information from each serial, but here it turns out, that when information from Serial and Serial1 comes simultaneously, the one which comes first is read correctly, and the second one is not.
How can this problem be solved?
I am uploading the ESP32 code below, if that would help
Code: C / C++
Added after 4 [minutes]:
I thought about using a second processor, but it doesn't work