Communicationg TWO ESP32 Boards
-
- Posts: 3
- Joined: Fri Sep 04, 2020 3:59 pm
Communicationg TWO ESP32 Boards
Hello
Me and my colleagues have been trying to communicate two ESP32 Boards for a very long time (started using Serial Communication RS232/485 continued with TwoWire). We have invested huge amount of time in the development process. There have been lots of BUGs, we have tried to overcome with software and hardware solutions (even altering libraries etc), at some point we have advanced but now we are finally stuck and there is no explanation to what happens to the board/libraries and why are we getting data sometimes and why are we not.
So the General question is what is most relible method to communicate two or more boards for a commercial application?
Any assistance and suggestions are appreciated.
Me and my colleagues have been trying to communicate two ESP32 Boards for a very long time (started using Serial Communication RS232/485 continued with TwoWire). We have invested huge amount of time in the development process. There have been lots of BUGs, we have tried to overcome with software and hardware solutions (even altering libraries etc), at some point we have advanced but now we are finally stuck and there is no explanation to what happens to the board/libraries and why are we getting data sometimes and why are we not.
So the General question is what is most relible method to communicate two or more boards for a commercial application?
Any assistance and suggestions are appreciated.
Re: Communicationg TWO ESP32 Boards
WiFi and bluetooth are normaly used to communicate between boards
If you need a wired connection, then it will depend on your requirement, speed, data size ect. ?
I have testede serial between two esp32 and it works fine.
What issue/problems do you have using serial ?
And what have you tryed to overcome it ?
If you need a wired connection, then it will depend on your requirement, speed, data size ect. ?
I have testede serial between two esp32 and it works fine.
What issue/problems do you have using serial ?
And what have you tryed to overcome it ?
-
- Posts: 3
- Joined: Fri Sep 04, 2020 3:59 pm
Re: Communicationg TWO ESP32 Boards
I need wired connection. Serial/TwoWire usually loses data/reads with 0s or other charrecters.Agree007 wrote: WiFi and bluetooth are normaly used to communicate between boards
If you need a wired connection, then it will depend on your requirement, speed, data size ect. ?
I have testede serial between two esp32 and it works fine.
What issue/problems do you have using serial ?
And what have you tryed to overcome it ?
I don know whats your application, I usually use interrupt timers and haw "Reach Slave Device" code to ready changes in a loop.
Tested many things and does not always work (usually 85% of packets arrive in case of serial and lass in case of TwoWire).
Re: Communicationg TWO ESP32 Boards
Hmm it works for me using task to read incomming data.
What speed are you using ?
Do you have the same problem with lower speed ?
What about the physical wire, is that on a PCB or long/short jumper wired ?
What speed are you using ?
Do you have the same problem with lower speed ?
What about the physical wire, is that on a PCB or long/short jumper wired ?
-
- Posts: 3
- Joined: Fri Sep 04, 2020 3:59 pm
Re: Communicationg TWO ESP32 Boards
Here is sample code, I reach slave device every 100 ms (function is called 2 slaves at different Wire objects).Hmm it works for me using task to read incomming data.
What speed are you using ?
Do you have the same problem with lower speed ?
What about the physical wire, is that on a PCB or long/short jumper wired ?
Wire is at declared at 100000 rate.
Code: Select all
bool Periphery_Manager::Reach_Periphery_Devices(TwoWire * wire, uint8_t * buffer)
{
static uint32_t reach_st = 0;
if (millis() < (reach_st + 100))
return false;
reach_st = millis();
if (Read_New_ID(wire, buffer))
return true;
return false;
}
Re: Communicationg TWO ESP32 Boards
Have you try with lower speed and only one (1) slave ?
Do you then have errors ?
How have you made your physical connections ?
If your speed is 100.000 bps and you read every 100ms how is your timing then ?
Suggest you try with one connection, use task to poll incomming data and.make that work 100 % befor you try with two slaves.
Just my 2 cent.
Do you then have errors ?
How have you made your physical connections ?
If your speed is 100.000 bps and you read every 100ms how is your timing then ?
Suggest you try with one connection, use task to poll incomming data and.make that work 100 % befor you try with two slaves.
Just my 2 cent.
Re: Communicationg TWO ESP32 Boards
I'm not familiar with TwoWire but have you checked to see if your cables are too long?
-
- Posts: 22
- Joined: Mon Feb 12, 2018 6:50 pm
Re: Communicationg TWO ESP32 Boards
If you are using interrupts, did you use the IRAM_ATTR attribute for the interrupt function and any called function?shota@gymstinct.com wrote: ↑Mon Sep 07, 2020 1:57 pm...
I need wired connection. Serial/TwoWire usually loses data/reads with 0s or other charrecters.
I don know whats your application, I usually use interrupt timers and haw "Reach Slave Device" code to ready changes in a loop.
Tested many things and does not always work (usually 85% of packets arrive in case of serial and lass in case of TwoWire).
See this for how to do this correctly:
https://techtutorialsx.com/2017/10/07/e ... nterrupts/
Bad things happens when you break rules
Personally, I prefer to just pass structures from one Arduino to another.
See: https://github.com/LowPowerLab/RFM69/tr ... r/Examples
Examples: Struct_send & Struct_receive
Re: Communicationg TWO ESP32 Boards
Hi, I need a communication means that has low memory usage.
I want to free up memory by removing WIFI and MQTT code to have more space for the core of the project. I could add a second board that has a wired connection with the first board and does the wireless communication with the network.
Can I save memory space on the first board in this way? Or is the code for wired communication comparable in size with WIFI / MQTT.
My gut feeling says that this would be a good way to free up space at the cost of an additional board for the wireless part of the communication.
Any comments ???
I want to free up memory by removing WIFI and MQTT code to have more space for the core of the project. I could add a second board that has a wired connection with the first board and does the wireless communication with the network.
Can I save memory space on the first board in this way? Or is the code for wired communication comparable in size with WIFI / MQTT.
My gut feeling says that this would be a good way to free up space at the cost of an additional board for the wireless part of the communication.
Any comments ???
Who is online
Users browsing this forum: Baidu [Spider], jgustavoam and 39 guests