Server Receive and Send from 100 ESP32 Device

Mahmoud Ahmed
Posts: 2
Joined: Sat May 22, 2021 9:21 am

Server Receive and Send from 100 ESP32 Device

Postby Mahmoud Ahmed » Sat May 22, 2021 1:06 pm

Hello everyone.

I'm new here and need help to start a big project.
I have built a web server on the ESP32 sensor and need to upgrade it .

My Question :?:
What is the best way to connect 100 Device ( esp32 or esp8266 ) to the server , the Server and 100 ESP32 device connected to the wifi network with a router
The server will be installed on raspberry pi or windows 10 pc and store incoming data on SQLite database .
The server can send and receive from all ESP device on the network .
each ESP Device will send data to server every 1 Sec and it is not possible to exceed this period .
how can the server receving all data from each device without lose any thing .
i need only the guide step for search .
Thanks

lbernstone
Posts: 831
Joined: Mon Jul 22, 2019 3:20 pm

Re: Server Receive and Send from 100 ESP32 Device

Postby lbernstone » Sat May 22, 2021 2:41 pm

https://mqtt.org/
https://iotbytes.wordpress.com/store-mq ... -database/
Use a usb hard disk. This level of activity will wear out an sdcard quickly.

Mahmoud Ahmed
Posts: 2
Joined: Sat May 22, 2021 9:21 am

Re: Server Receive and Send from 100 ESP32 Device

Postby Mahmoud Ahmed » Sun May 23, 2021 7:44 am

Thanks, lbernstone
I am planning to use this MQTT protocol but my question is can MQTT protocol handle over than 100 of ESP32 to communicate with one server and each of this send every 1 sec ? ?
Use a USB hard disk. This level of activity will wear out an SD card quickly.
Yes, this is the best solution

mrburnette
Posts: 22
Joined: Mon Feb 12, 2018 6:50 pm

Re: Server Receive and Send from 100 ESP32 Device

Postby mrburnette » Tue May 25, 2021 4:48 pm

Mahmoud Ahmed wrote:
Sun May 23, 2021 7:44 am
...
I am planning to use this MQTT protocol but my question is can MQTT protocol handle over than 100 of ESP32 to communicate with one server and each of this send every 1 sec ? ?
...
The server will be installed on raspberry pi or windows 10 pc and store incoming data on SQLite database .

It would be 'best' to ask over at the MQTT site:
https://groups.google.com/g/mqtt

as your desired answer is a "server-side" concern involving the Raspberry Pi host and the server. The client side has its own concerns regarding retransmission of TCP packets under the higher-level MQTT messaging format; that is, random transmission of 100 clients every second may be an issue depending on multiple client-side concerns around re-transmit (especially if on same WiFi LAN.)

As a "few" test clients will not scale linearly, I would approach this project with some suspicions on a clean and successful implementation.

lbernstone
Posts: 831
Joined: Mon Jul 22, 2019 3:20 pm

Re: Server Receive and Send from 100 ESP32 Device

Postby lbernstone » Tue May 25, 2021 4:55 pm

Short answer, yes, a pi3 or better can handle 100 entries per second.
Long answer, there are many ways to increase capacity of a service like mqtt. haproxy can easily be configured to distribute the load between a couple of mqtt servers, with the added benefit of high availability in case one device fails. Google knows lots about load balancing and high availability.

Who is online

Users browsing this forum: ESP_Sprite and 39 guests