ArduCAM / Arduino

This is ArduCAM library for Arduino boards
MIT License
472 stars 348 forks source link

ArduCAM ov2640 mini with Arduino Uno and bluetooth module HC-05 #59

Open anuragbansal4 opened 8 years ago

anuragbansal4 commented 8 years ago

Hi,

I am working on project where I want to integrate the ArduCAM 2640 mini camera with Arduino Mega R3 which is connected to a Bluetooth transceiver module HC-05. I want to capture images using arducam and then directly transfer them to pc using Bluetooth.

Thanks, Anurag

ArduCAM commented 8 years ago

@anuraqbansal4, You can follow the example https://github.com/ArduCAM/Arduino/tree/master/ArduCAM/examples/mini/ArduCAM_Mini_OV2640_Video_Streaming

  1. modify the example and setup another hardware UART port for HC-05 module.
  2. modify the image data sending part code to the UART which connected to HC-05
  3. using the host app on your PC to debug with your modified code https://github.com/ArduCAM/Arduino/blob/master/ArduCAM/examples/mini/ArduCAM_host_v1.0.exe
ArduCAM commented 8 years ago

@Anuragbansal4, we are so busy here. I will let my engineer here to modify an example to stream data via another software UART port on UNO. So please be patient.

anuragbansal4 commented 8 years ago

Thank you Lee, that would be of great help. Awaiting to hear from your engineer soon.

Thanks, Anurag

ArduCAM commented 8 years ago

@Anurag, Please check the modified example below, it uses software uart. You can connect these pins to your HC-05 module. const int RX_PIN = 2; //RXD const int TX_PIN = 3; //TXD www.arducam.com/downloads/sketch/SoftwareSerial_OV2640_Video_Streaming/SoftwareSerial_OV2640_Video_Streaming.ino

anuragbansal4 commented 7 years ago

Hello Lee,

I have tried uploading the code to UNO and connected the Arducam with the arduino as per the Hardware Application Note. The camera works well when connected with PC, using Arducam host app. But, when connected to another PC via bluetooth and using the Arducam host, an error pops up which is - ' System.TimeoutException: The write timed out. at System.IO.Ports.SerialStream.Write(Byte[ ] array, Int32 offset count, Int32 timeout) at ..........and so on'. Please let me know where I am making a mistake while using the same.

Regards, Anurag

ArduCAM commented 7 years ago

@anuragbansal4, it seems that there may be bugs in host application. The buletooth serial port maybe different from USB-serial port. So the behavior is also different. You may need to build your own host application for that.

anuragbansal4 commented 7 years ago

Hello Lee,

I am working on the host application, however I have few queries related to JPEG image transfer. I am successful in transferring the byte array, however I am facing problem while parsing the array. So while transferring the byte array, I have made a provision to display the data. The condition to detect the end of frame is FF D9, but the data does not contain FF D9 marker, (Data does contain D9 but FF's are missing) because of which I am unable to parse the array and detect frame ends. I would like to know how has this been implemented in the Arducam host application which works with PC?

Thanks, Anurag

ArduCAM commented 7 years ago

@Anuragbansal4, there must be FF D9 JPEG end marker in the data stream, or else you have to drop the bad frame and search for a new FF D8 JPEG start marker.

anuragbansal4 commented 7 years ago

Hello Lee,

I have been working on Arducam, and as directed by you am working on developing a app to decode the image via Bluetooth. However, I am facing a problem were I am trying to print the image data on serial monitor which I recognized is getting printed in ASCII format, but as I serially transmit that same data over bluetooth to my app on pc and display it as it is, it shows data in UTF8 format. I noticed that the arducam application that you shared earlier which works on pc also has option to show binary data and hex. It would be of great help if you can share the code of the arducam.exe application. And also, I have located the FF D8 and FF D9 markers, you were right it was due to bad frames but now that problem is resolved. Thank you for your guidance. Please share your inputs on above problem too.

Thanks, Anurag

MikaSilaen commented 7 years ago

Hello Lee,

I'm using a Arducam 0v2640 that have 18 pin. How I connect it with arducam shield so I can combine with Arduino ? Thanks for your help.