The nRF24L01+ PA + LNA communicates over a 4-pin SPI (Serial Peripheral Interface) with a maximum data rate of 10Mbps.
Isn't that enough?
also wouldn't every frame be less than 1.5 Mbps? It will have a lot of time to transmit it because 1 frame per second is enough.
also, I don't care about the fps a lot. I just want it to transmit the video like 1 image per second would be more than enough.
The data rate of the Arduino talking to the NRF24 is not the point. The NRF24 has a max air rate of 2Mbs only.
Circa 1 image per second is possible with LoRa modules thats about the limit.
LoRa modules have an FLRC mode which runs at about the same air rate as an NRF24 and an 800 x 600 image can be transfered with that in just under 1 second.
Not sure a NRF24 would be capable of the same rate, the max packet size it can use is 32 bytes, whilst the LoRa device can use 127 byte packets in FLRC mode and 255 bytes in LoRa mode. The larger packets do reduce the overhead of the required send and acknowledge system quite a bit.
Maybe you missunderstand the complexity of the issue.
To send an image you have to break the memory buffer, that is the image, lets say its 64Kbyte, into a series of 2,000+ individual packets.
Then send each packet in turn, check the data received is correct and in the right sequence, and then reassemble all the received packets into an image.
how am I gonna do it, also update, i am gonna use esp8266 to transmit the video.
could this work:
const int MAX_PACKET_SIZE = 32;
void sendViaNRF24L01(uint8_t *data, size_t size) {
// Calculate the number of packets needed
int numPackets = (size + MAX_PACKET_SIZE - 1) / MAX_PACKET_SIZE;
// Send each packet
for (int i = 0; i < numPackets; i++) {
// Calculate the start and end indices for the current packet
int startIdx = i * MAX_PACKET_SIZE;
int endIdx = min((i + 1) * MAX_PACKET_SIZE, size);
// Calculate the size of the current packet
int packetSize = endIdx - startIdx;
// Send the current packet
radio.write(&data[startIdx], packetSize);
// Add a delay if needed to avoid overwhelming the receiver
delay(1);
}
}
// Function to receive a complete image
void receiveImage() {
// Assuming you have a function to receive NRF24L01+ packets
// and store them in a buffer (e.g., receivedData)
// Create a buffer to store the complete image
uint8_t *completeImage = new uint8_t[IMAGE_SIZE];
// Loop to receive packets and reassemble the image
for (int i = 0; i < numPackets; i++) {
// Receive the current packet
// Assuming you have a receive function, modify accordingly
radio.read(&receivedData[i * MAX_PACKET_SIZE], MAX_PACKET_SIZE);
// Add a delay if needed to avoid overwhelming the sender
delay(1);
}
// Now you have the complete image in the completeImage buffer
}
Spend a year or two learning how to code in Arduino.
Find an example of the complete code you want for NRF24.
Pop across to the paid consultancy forum and ask in there.
Use the LoRa code, that works.
Incidently the ESP32CAM is a far from ideal choice for projects of this type, the ESP32 is fairly short of spare IO pins.
The ESP32S3 is better choice in my view, I have connected an OV2640 camera to one of those and transferred images via a connected LoRa device. Code is simpler than for an ESP32CAM itself.
Or there is the SEEED XIAO ESP32S3 sense board, had image transfers working on that too.
what do you mean by "Problem is that you want code that works in the real world"
I am trying my best, i just asked chat GPT to do this because i had no idea what to do bruv.
I can't find an example of the complete code you want for NRF24.
Could you send me a link to the "paid consultancy forum"?
Just tell me if the code is good, I want to then start working on the receiver, nrf24l01 + pa + lna will work with me because I want like 1 fps.
The 2.4Ghz LoRa modules are only about £5 each and provide a working solution. You can also use the UHF LoRa modules if you want range into the kms and transfer speed is not such an issue.
Paying someone to write equivalent code for the NR24 (even if its possible) will cost vastly more than the purchase price of a couple of LoRa modules or other ready made solutions........