Hi,
I need a code to send a photo from a Xiao ESP32S3 (it work like normal ESP32 but withe camera and SD card) that has been taken by camera and send it to a python code on my laptop via bluetooth. I don't know how to write this and I looked all over the Internet, but I didn't find anything. If anyone can write this for me or someone has already done something similar, please send me the code.
Best regards and have a nice day ![]()
Is this for school?
Here is a starting point. https://forum.arduino.cc/t/arduino-camera-photo-storage-and-transfer-with-bluetooth/265563
No just I need it for my hoby but I don't know how to program
but it send image via serial port not bluethoof
There are tons of question that come to mind....
Do you want to use Bluetooth Classic (SPP) or Bluetooth Low Energy (BLE) for data transmission?
What is the typical size and format of the photo taken by the camera?
Are there specific pairing or security requirements for the Bluetooth connection?
Should the image be sent in one go or in smaller chunks?
What Python environment are you using on your laptop, and do you have any libraries or frameworks in mind?
How do you want to handle transmission errors or interruptions, and is there a need for a retransmission mechanism?
Would you like to save the image to the SD card first and then send it, or send it directly from the camera module's buffer?
What is the expected range of the Bluetooth connection, and what is the environment like where it will be used?
Are you comfortable using the Arduino IDE or ESP-IDF for programming the Xiao ESP32S3, or do you prefer another environment (python?)?
The microcontroller have BLE , so BLE.
The photo size is approximately 2 KB and is in JPG format.
No.
which is easier?
Asyncio for Python and for Arduino <BLEDevice.h> <BLEServer.h> <BLEUtils.h> <BLE2902.h>, but I can use other libraries. I already have code that sends "Hello world" from ESP32 to Python via Bluothoof, but I don't know how to send using its image. And I don't know if this is a good idea for my project because I care about the time it takes to send the photo.
I don't know yet.
I prefer to do this directly from the camera module.
1-25 m
All the code was written by GPT chat or I can find it on the internet, so no.
BLE is really meant for short messages (like ~250 bytes max). You will need to use chunking (break the image data into smaller chunks and send them sequentially. You will also need to implement a mechanism to reassemble the chunks on the Python script side)
Bluetooth classic would probably be better and if you have SPP support, then t's really like a Serial dump
ChatGPT can't code anything that complex, I tested it a while ago.
Changing Serial to BlueToothSerial is trivial.