Serial reception missing data

NicoLuos
Posts: 2
Joined: Fri Feb 22, 2019 10:26 am

Serial reception missing data

Postby NicoLuos » Fri Feb 22, 2019 1:32 pm

Hi everyone,
I'm working on a project with ESP32 on Arduino to create something like a bidirectional pipe between Serial2@1000000baud and WebSocket or BluetoothSPP. The code also manage connection stuff (WebServer, captive portal, mdns,...) to allow users to easily configure a wifi connection and name its ESP.
You can find my source code on this github : https://github.com/Luos-Robotics/ESP_Luos_pipe

Everything is kind of working, but I have a lot of trouble and strange crash with this code.
One of them is data loss on reception on Serial2.
In my setup I have a host controler sending Json using serial and the ESP should get those data and send them using Wifi or Bluetooth (or drop it if nobody is connected)
Just to be sure I use a logic analyser to check messages from host integrity, I check 5000 messages and there are all OK.
Here is some normal messages :

Code: Select all

{"modules":' '{"gate":' '{},' '"dxl_6":' '{"temperature":' '26.00}}}
{"modules":' '{"gate":' '{},' '"dxl_6":' '{"rot_position":' '45.31,' '"temperature":' '26.00}}}
{"modules":' '{"gate":' '{},' '"dxl_6":' '{}}}
If I print messages received from esp I have some of them wrong for example :

Code: Select all

{"modules": {"gate": {}, "dxl_6": {"rot{"modules": {"gate": {}, "dxl_6": {"rot{"modules": {"gate": {}, "dxl_6": {}}}
modules": {"gate": {}, "dxl_6": {}}}
{"modules": {"gate": {}, "dxl{"modules": {"gate": {}, "dxl_6": {"rot_position": 45.31}}}
This is like sometime the serial reception is disabled or preempted by something else.

Do you already have experienced something similar with ESP?
Do you have any solution to get all those data?

Who is online

Users browsing this forum: Google [Bot] and 63 guests