ESP32-CAM Image sending via WI-FI Mesh

Hello, how are you guys doing?
I'm new here, just joined the forum.

Recently I started a postgraduate program and as a project, I have the idea of creating a remote image transfer using ESP8266 and an ESP32 CAM. Due to the distance, I need to use LoRa or WiFi mesh. I've searched a lot and haven't found anything that works so far.
I've successfully created a WiFi mesh network and exchanged messages between nodes, but I haven't been successful in sending images, even after converting the image to hexadecimal and attempting fragmented transmission.

Can you help me?

Thank you.

Can you provide more details, such as distances, the environment, the location and what exactly the project is ?

The project is the monitoring of a plantation.

Where an esp32 cam captures an image of a certain part of the crop and directs this image to the nearby nodes (esp8266) until it reaches the microcontroller that has access with the web and uploads these images to the cloud.

Distance between the esp32 to the microcontroller that makes web access is approximately 4km, but there are several nodes with other interconnected sensors, making the communication.

Hi @jhonatan_ufcat ,

Welcome to the forum..

Maybe take a look here..
splits each jpeg into chunks..
chunk size is a #define..
haven't played with Lora yet, think it does smaller packets, might take a bit to send an image..

good luck.. ~q

1 Like

I moved your topic to a more appropriate forum category @jhonatan_ufcat .

The Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

1 Like

Hello, it's good to be here.

I'll look at the content, thank you.

1 Like

It is pretty straightforward to implement a LoRa mesh network using Adafruit Feather LoRa modules, but packet size is limited to about 240 bytes, and the data rate to about 21 kB/s for a direct connection, using the default radio configuration.

4 km line of sight (or if not LOS, with intermediate nodes) is no problem. However, if intermediate nodes are required, that would reduce the data rate substantially. For photos of inanimate objects, that may not matter.

I confess that I've been trying a lot.

But without success..

The packets received on the receiver are not consistent with those sent.

Something is wrong with your code. For help with that, please read and follow the instructions in the "How to get the best out of this forum" post, linked at the head of every forum category.

For reliable data transmission, send packets with a CRC checksum, which the receiver must verify before accepting a packet as valid. That process is automatic with the RadioHead packet library.

1 Like

Well an ESP32CAM takes images of a type where you need to receive the entire image, no missing bits, in order to view the received image file, a single bit error can cause problems.

If you have to split the original image up into a series of blocks or packets to send, then you need to be really sure you receive them all. But packet errors are to be expected, so a send and acknowledge system is needed for each packet.

As an alternative it is possible to split an image up into a series of much smaller images such that each sent packet is a seperate image in itself, so if a packet is lost in transit then you still have a sort of image to view at the receiver.

If a direct LoRa link will work over that distance then there is already a fully working implementation of sending images taken by an ESP32CAM via LoRa. Its a full send and acknowledge system with extensive error checking and there are several articles on using the ESP32CAM with LoRa here;

https://stuartsprojects.github.io/

And the working code will be found here;

https://github.com/StuartsProjects/SX12XX-LoRa

Works with 2.4Ghz LoRa too, so increased transfer speed and no duty cycle issues.

I should mention that connecting and using a LoRa device to an ESP32CAM is not that straightforward when the SD card is also in use.

1 Like

Hello everyone, as I mentioned, I am new here on the Forum, and I even have difficulties writing in your language since I am Brazilian. Haha.

I am very happy and grateful for all the responses; it's the first time I bring a question to an online forum, and I am pleased to see that many take the time to respond and share their knowledge. After all, the best way to learn is by teaching.

But back to the subject:

I will try to explain my expectation better.

I am in a postgraduate program, here we call it a Master's degree; I don't know how it is known in your country.

My project is to create image monitoring for either a plantation or even a herd.
I would have some ESP32Cams taking pictures and sending them to ESP8266 devices (due to the lower cost).
Between the ESP32s and the ESP8266s, as they are close to each other, I will use WIFI MESH for the connection because it has a higher transfer bandwidth, and the modules already have integrated WiFi, so I don't need to spend on LoRa modules.
The captured images will be transmitted between the ESPs until they reach the node configured as the Transmitter, which will then transmit these images to a slightly more distant server with an internet connection. This communication between the Transmitter and the Server will be done through a LoRa mesh, due to the greater distance between the points.
Aware of the low transfer rate provided by the LoRa network, I will send at most one or two images per day.
My current difficulty is in sending these images over the WIFI MESH network and then redistributing them over the LoRa mesh to the server. I have conducted several tests, and the images do not arrive correctly; I believe I am losing packets along the way.

Thank you, everyone.

The best option is to include packet numbers in the data, and use a send and acknowledge protocol to verify at the transmitter end that every single packet is correctly received.

If not, retransmit packets that were lost.

In the back of my mind, I recall mesh type networks did not guarantee the received packets would be received in the same order as they were sent. Is this still true?

Out of order packet receipt is certainly possible with RadioHead, as it does not offer end-to-end acknowledged receipt, only hop-to-hop.

I would assume that if you use mesh, then its more or less inevitable that segments of the image will arrive out out order, especially with all the acks flying about, there could be quite a few packet collisions.

That said the use of mesh implies that the final receiver has to deal with stitching the out of sequence segments back together into a complete image which could be held in PSRAM on a ESP32.

Has anyone implemented using LoRa mesh to transfer large files\images ?

Loosing packets is inevitable, collisions etc, you need to plan the system assuming there will be lost packets.

When the OP considers the management level software needed to handle sending large files this way, he will soon decide other methods will work. Just like the early LANs went away for the same reason.