Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By davydnorris
#92642
sairfan06 wrote:What i really want to do is,

I have 12 ESP clients with ESP Now
I want to connect it to 12 ESP Now Listeners/Slaves

These ESP listeners are soldered on one PCB, at about 15mm distance from each others.
Problem 1: I came to know that multiple ESP listener modules can't be mounted on one PCB very close to each other,

All 12 clients can send data at same time to to their receiver end.
Problem 2: But receiver end can't receive data transmitted at same time from 12 devices because in that case transmission collusion will happen and non of receiver will be able to receive data.


Still not sure why you would want to do this.

Can you tell us:
- how much data are you sending
- how often are you sending it

Why do the clients have to send data to a unique receiver? Why can't you simply aggregate them together and have them all send data to one place? If you use the mesh network library I mentioned earlier, then the data will flow between them over the mesh protocol, and then one of them can send it on to a server via regular TCP/IP.

The other thing is that there will always be some latency between devices so you're not going to get the sort of clashes you're talking about. Even if you run with the out of the box TCP/IP Wifi networking configuration, you can have up to 5 clients on one ESP device
User avatar
By sairfan06
#92643 Sorry for my bad English, let me explain everything again.
Terms I use:
Client/Transmitter means a sensor node
Server/Receiver means Slave module in ESP Now

Why I need ESP NOW
Sensor nodes are battery operated and I want to obtain maximum battery life. My battery calculations says if total power ON time of client node stays about 100ms that's good.

how much data are you sending


about 10 to 15 bytes (if you want exact let say 10 bytes)

how often are you sending it

every 90 seconds

Why do the clients have to send data to a unique receiver? Why can't you simply aggregate them together and have them all send data to one place?

Built 1) i built client and server nodes with ESP NOW everything worked good, battery life was also good, it was one to one setup (or may be also called peer to peer)

Built 2) I updated code so that server can listen to many devices and can push data to MQTT server for that i also had to update client code to look for Channel just like below

Code: Select allint32_t getWiFiChannel(const char *ssid) {
  if (int32_t n = WiFi.scanNetworks()) {
    for (uint8_t i=0; i<n; i++) {
      if (!strcmp(ssid, WiFi.SSID(i).c_str())) {
        return WiFi.channel(i);
      }
    }
  }
  return 0;
}


Now I was able to push data to MQTT server, but because of adding function getWiFiChannel current consumption on client node increased a lot, that means i can't used this method anymore.

The solution I found was connect two ESP nodes just like the way i did in Built 1 because its good for battery life, so for 12 client/server I need 12 pairs one client other server. when server end receives data from client node it sends data via MSI/O port to an other ESP which is connected to internet and this ESP sends data to MQTT server. it all works good. because server/client are working in one to one mode battery life is also good.

Now if i design a PCB for this project i will have to put all those 12 ESP server/receiver on one PCB that's where problem lies. looks like i cant put 12 ESPs on one PCB at such short distance as 15mm and 12 ESP clients can't talk to its pair at same time.

If you think there is some other method that could be a better approach please let me know so that i can start learning in that direction.

If you use the mesh network library I mentioned earlier, then the data will flow between them over the mesh protocol, and then one of them can send it on to a server via regular TCP/IP.

I'm using battery operated sensor nodes I don't think mesh is an ideal approach in that case, because what i understand in mesh all those nodes will keep listening for data that means they should not be on battery
User avatar
By AcmeUK
#92651 You say
All 12 clients can send data at same time to to their receiver end.
Problem 2: But receiver end can't receive data transmitted at same time from 12 devices because in that case transmission collusion will happen and non of receiver will be able to receive data.

Why do they have to send at the same time? How do you synchronise all 12 nodes waking up at the same instant?

You seem to be determined to use ESP Now; are you sure that this is the most appropriate software platform for your needs?

If I was designing such a system I would get the ESP to wake up, send a MQTT message, wait for the acknowledgment, put the ESP back to sleep.
User avatar
By sairfan06
#92655
Why do they have to send at the same time? How do you synchronise all 12 nodes waking up at the same instant?


All devices will be turn ON at same time and will send data with 90 seconds delay, I assume they will send data at same time as a worst case scenario