Hi all,
I am new to esp32 world and I usually use arduino for my projects. With multiple arduino boards projects I usually use I2C for interconnection with one board in the master mode as an orchestrator and and other in slave mode. But I learnt that esp32 doesn't yet implemented I2C slave mode. If I'm right, what is the most appropriate interface for a wired connection for a couple or more esp32 boards?
how to connect two esp32 boards
Re: how to connect two esp32 boards
https://esp-idf.readthedocs.io/en/v2.1/ ... ight=slave
The SPI drivers allow slave functionality. Maybe it'd be possible to achieve the same with this? I'm not quite sure.
I'm just thinking aloud, but maybe it'd be possible to use the UARTs to achieve the same?
The SPI drivers allow slave functionality. Maybe it'd be possible to achieve the same with this? I'm not quite sure.
I'm just thinking aloud, but maybe it'd be possible to use the UARTs to achieve the same?
Re: how to connect two esp32 boards
Why not use WiFi or Bluetooth? No wires needed.
Re: how to connect two esp32 boards
Just the other day I had a user ask about Bluetooth (BLE) communication between two ESP32s and we tested it out and it seemed to work just great.
Just a data point to also give a thumbs up for BLE and some evidence that others are also using BLE for ESP32 to ESP32 communications.
Just a data point to also give a thumbs up for BLE and some evidence that others are also using BLE for ESP32 to ESP32 communications.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: how to connect two esp32 boards
I just arrived here while looking for the same, but in my case BLE or wifi is not an option, because as I'm not able to use BLE and Wifi at the same time in my ESP32, I will have to use two boards, one with wifi and the other one with BLE, then comunicate both via some cabled protocol.
I was thinking USART, SPI or I2C as some of you mentioned above.
BR, Robert.
Update: 22/04/18
Actually after tweaking the config file and taking care of using just small buffers got it working. Mostly it was a case of RAM memory.
I'm now considering using the WROVER board that has more RAM.
I was thinking USART, SPI or I2C as some of you mentioned above.
BR, Robert.
Update: 22/04/18
Actually after tweaking the config file and taking care of using just small buffers got it working. Mostly it was a case of RAM memory.
I'm now considering using the WROVER board that has more RAM.
Last edited by robpelu on Sun Apr 22, 2018 11:31 pm, edited 1 time in total.
Re: how to connect two esp32 boards
Is there a discussion on that or a description you can give me for that?kolban wrote:Just the other day I had a user ask about Bluetooth (BLE) communication between two ESP32s and we tested it out and it seemed to work just great.
Just a data point to also give a thumbs up for BLE and some evidence that others are also using BLE for ESP32 to ESP32 communications.
Thank you very much.
Re: how to connect two esp32 boards
Howdy @DowJohn,
BLE is a bluetooth protocol used to transmit relatively short packets of information. An ESP32 can be either a BLE client, a BLE server or both. If you have two ESP32s, one can be a BLE Server, one a Client and they can exchange data between each other.
BLE is a bluetooth protocol used to transmit relatively short packets of information. An ESP32 can be either a BLE client, a BLE server or both. If you have two ESP32s, one can be a BLE Server, one a Client and they can exchange data between each other.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
-
- Posts: 2
- Joined: Sun Oct 28, 2018 3:48 pm
Re: how to connect two esp32 boards
Hi,
even if the discussion is older it is still an everyday problem to solve.
We use multiple ESP32s with arduino and need lots of communication.
So here is my approach:
We want to use eight ESP32s that are build into two robots.
The two robots have to talk via bluetooth, as only peertopeer is allowed so wifi by definition is no option.
On each robot there is one "master" esp32 and three slaves and we played around with I2c, SPI and Serial quite a
lot and none of them worked sufficiently in millisecond time.
Then we discovered the CAN Bus and this was the best option for us.
As CAN is a multimaster bus there is no need to have a "slave" - program on the "slave" circuit boards.
We use the Sandeepmistry library
https://github.com/sandeepmistry/arduino-CAN
even if there still is an unresolved freeze issue when the can cable is removed completely.
Thanks to the filter option of the can bus library we easily managed to build our own master-slave protocol here.
This works fine and if you use the second esp32 core just for canbus, the whole communication between the four boards
(master request 1 - slave 1 answered , master request 2 - slave 2 answered, ...) works within one millisecond, even if we reduce the CAN speed to 500KHz to have some extra security when not using twisted pair on the cables.
We use an SN65HVD233SOIC8HD as our CANBUS driver which is a standard below 1$ device.
So we consider the cable communication between multiple ESP32s as SOLVED.
The other story is the Bluetooth communication.
Here we need something like with the simple HC-05 devices:
once paired (you do this before and it is stored on the device) you switch them on, they pair automagicly and then you simply use serial.Write() and serial.Read().
Is there a ready made library to use BLE in this manner?
Pair at the beginning (without the knowledge of servieUUIDS and charUUIDs) and then simply something like
BLE.Write(byte) and BLE.Read(byte)
If you have something like this, please tell me and Kolban can get his "Thump up"...
I hope this helps for all cable bound problems and gives us some hints for an easy Bluetooth.
Greetings and merry Christmas
Roland
even if the discussion is older it is still an everyday problem to solve.
We use multiple ESP32s with arduino and need lots of communication.
So here is my approach:
We want to use eight ESP32s that are build into two robots.
The two robots have to talk via bluetooth, as only peertopeer is allowed so wifi by definition is no option.
On each robot there is one "master" esp32 and three slaves and we played around with I2c, SPI and Serial quite a
lot and none of them worked sufficiently in millisecond time.
Then we discovered the CAN Bus and this was the best option for us.
As CAN is a multimaster bus there is no need to have a "slave" - program on the "slave" circuit boards.
We use the Sandeepmistry library
https://github.com/sandeepmistry/arduino-CAN
even if there still is an unresolved freeze issue when the can cable is removed completely.
Thanks to the filter option of the can bus library we easily managed to build our own master-slave protocol here.
This works fine and if you use the second esp32 core just for canbus, the whole communication between the four boards
(master request 1 - slave 1 answered , master request 2 - slave 2 answered, ...) works within one millisecond, even if we reduce the CAN speed to 500KHz to have some extra security when not using twisted pair on the cables.
We use an SN65HVD233SOIC8HD as our CANBUS driver which is a standard below 1$ device.
So we consider the cable communication between multiple ESP32s as SOLVED.
The other story is the Bluetooth communication.
Here we need something like with the simple HC-05 devices:
once paired (you do this before and it is stored on the device) you switch them on, they pair automagicly and then you simply use serial.Write() and serial.Read().
Is there a ready made library to use BLE in this manner?
Pair at the beginning (without the knowledge of servieUUIDS and charUUIDs) and then simply something like
BLE.Write(byte) and BLE.Read(byte)
If you have something like this, please tell me and Kolban can get his "Thump up"...
I hope this helps for all cable bound problems and gives us some hints for an easy Bluetooth.
Greetings and merry Christmas
Roland
Who is online
Users browsing this forum: No registered users and 174 guests