Open TU-KL-Crazyflie opened 8 years ago
@TU-KL-Crazyfile, from your error message it seems that the I2C is not connected correctly or the camera is dead. Please make sure if the OV5642 is identified before next step. Or else, it will cause the WDT reset due to the blocking code when accessing the OV5642.
Well interestingly after commenting out or deleting the line // myCAM.wrSensorReg16_8(0xff, 0x01); in the Setupprocedure, the OV5642_CHIPID_HIGH/LOW registers are successfully read, and I was able to capture the attached snapshots with 640x480 resolution.
Could you maybe explain, what this line of code is supposed to do?
And do you have any suggestions on how to fix the tearing problem? Setting the buffer to 2048 did not improve anything.
So I took my setup to work to see if I had any luck there. Unfortunately I'm having more trouble than I was at home.
I'm now having the same issue you were having with getting back 0xEF & 0xFE when reading OV5642_CHIPID_HIGH & OV5642_CHIPID_LOW. I am not using the OV5642_CAM_BIT_ROTATION_FIXED define, because if I do then the initial test fails and I get SPI1 Interface Error messages.
Using the same exact code I was using at home results in "Can't find OV5642 module!". The only differences I can think of between my two setups are possibly the Arduino verion or ESP8266 library version. Commenting out the lines entirely like you did were not helpful in my case.
Very confusing. I think I will try testing out the ArduCam with a SparkFun Thing board. I've also ordered a ESP8266 Arduino board from ArduCam, along with a 2MP version of the ArduCam. Going to see if I have any better luck with those.
UPDATE: Switching to Arduino 1.6.5 and the ESP8266 2.0.0 library has resolved my issues with the ArduCam not being detected on my work PC using only the OV5642_CAM define in memorysaver.h
I was originally using Arduino 1.6.7 and ESP8266 2.3.0 and that was giving me the wrong values back (EF/FE instead of 56/42)
I'm still getting tearing on the image like @TU-KL-Crazyflie but I think when I scrap the example and write my own test code I will hopefully find a solution.
UPDATE 2: I've written and rewritten my code multiple times but I still can't seem to get a full, valid image from the device. I've tested my ESP->PC communications thoroughly and everything seems in order there, which leads me to believe the ESP is having trouble grabbing all of the data from the device itself. Even with yield() statements in the loop. Unfortunately I don't have any SD writers to use as a test to see if it works that way.
For example: I am getting 6144 bytes from the cam.transferBytes call. I send all 6144 bytes to my desktop machine via TCP, which receives every byte. But about half of that 6144 bytes is invalid (0x00) and results in a corrupted image.
Here is a raw hex dump of the buffer data from the ESP8266 itself, immediately after calling transferBytes. Each section is one 2048 chunk. The data is invalid shortly after starting the second chunk. http://pastebin.com/raw/U6JjhEkp
So I received my Arducam ESP8266 Uno board w/ 2MP Mini OV2640 camera, but I'm still getting strange image tearing/corruption with the default examples provided. The only time I can get a valid image is when capturing at 160x240. Anything bigger results in image corruption.
Image @ 160x240: http://i.imgur.com/7qXFfbN.jpg Image @ 640x480: http://i.imgur.com/1Dabj1V.jpg
UPDATE: Setting buffer size to 2048 in camCapture in the example code seems to have solved the problem, though I could have sworn I'd tried that already. In any case, the Arducam Uno board is working now, so its back to figuring out what's wrong with the Adafruit Huzzah Feather board. Even when using the same code that worked on the Uno board, I still get image corruption on the Huzzah. I at least know the camera module works now though.
@MH6, it is the now issue. The default ESP8266 library didn't allocate enough memory for the image buffer. You need to use our modified ESP8266 library for higher resolution. https://github.com/ArduCAM/ArduCAM_ESP8266_UNO http://www.arducam.com/arducam-esp8266-uno-board-arduino-camera/
Hi, I'm I using the Adafruit Feather HUZZAH ESP8266 together with the ArduCam OV5642 Module, just like in this post #60
Following the latest instructions from ArduCam
and setting the #define OV5642_CAM_BIT_ROTATION_FIXED parameter in the memorysaver.h, I still have trouble getting the ArduCAM_ESP8266_OV5642_Capture example to work at all.
Without the bitrotation fix, I get the inevitable SPI Interface Error. Since instead of 0x55 the ESP reads back 0xAA from the camera.
However if I'm using the newest library with bitrotation, checking if the camera module type is OV5642 fails with the message "Can't find OV5642 module!" Instead of vid = 0x56 and pid = 0x42, the ESP reads back vid = 0xEF and pid = 0xFE. Strangely this register is read correctly, if I disable the bitrotation.
Using the bitrotation fix and manually setting the if statement to: if((vid != 0xEF) || (pid != 0xFE)) helps getting the ESP to the point, where it connects successfully to my wifi network. Unfortunately a soft WDT Reset occurs if I the try to take a snapshot.
I would really appreciate it if someone with an Adafruit Feather HUZZAH ESP8266 and the ArduCam OV5642 Module could post his working code.
Thx a lot! Any help is hugely appreciated.