sipeed / Maixduino

Arduino port on Maix board ( k210 )
https://maixduino.sipeed.com
Other
216 stars 95 forks source link

cannot declare variable 'camera' to be of abstract type 'Sipeed_OV2640' #59

Closed sabas1080 closed 5 years ago

sabas1080 commented 5 years ago

Hi

I have the next error cannot declare variable 'camera' to be of abstract type 'Sipeed_OV2640'

Arduino IDE version 1.8.9 with example mobilenet and selfie

Thanks

tjmc commented 5 years ago

setRotation is misspelled. If you change setRotaion to setRotation it'll work.

https://github.com/sipeed/Maixduino/blob/85c0d7d24e652004c3a7ef8bec3ca719129db1b3/libraries/Sipeed_OV2640/src/Sipeed_OV2640.cpp#L724

https://github.com/sipeed/Maixduino/blob/85c0d7d24e652004c3a7ef8bec3ca719129db1b3/libraries/Sipeed_OV2640/src/Sipeed_OV2640.h#L57

sabas1080 commented 5 years ago

Thanks!

garyinbg commented 4 years ago

I see this is closed however it is very much open for me :) I have exactly the same error popping up and have obviously chacked the above, downloaded the most recent versions in which the typo was corrected and tried to compile ony be be met with the same error... Is there something else available to get me past this please before I start the line by line operations πŸ—‘ Many thanks in anticipation Sabas, did you get this running ?

pernicious-flier commented 4 years ago

same for me as garyinbg

pernicious-flier commented 4 years ago

garyinbg , i had to fix those two errors in C:\Users\xxxxx\AppData\Local\Arduino15\packages\Maixduino\hardware\k210\0.3.11\libraries\Sipeed_OV2640\src directory and now works..

technoblogy commented 4 years ago

This should not be closed until the two typos have been fixed in the library. They are still there as of March 2020 (version 0.3.11).

skyvoyage commented 4 years ago

thanks!!

nitz08 commented 4 years ago

I fixed those errors but i am getting snap fail on the serial monitor and black screen on LCD. was anyone successful to implement that example code?

technoblogy commented 4 years ago

Yes, the example program:

Examples->Sipeed_OV2640->selfie

worked for me once I made the fixes.

bandekarsm commented 4 years ago

worked for me too.

paipeng commented 4 years ago

after fixing the misspelling, I can't open the camera (begin() returns false). any suggestions?

pepperm2 commented 4 years ago

I have the same failure with the "selfie.ino" example. I have 0.3.11 on Arduino 1.8.12 and just get "snap fail" in the serial window and a red display screen.

Has anyone got any more ideas as I have just started experimenting with this board in lieu of the article series starting to appear in Elektor magazine.

paipeng commented 4 years ago

Hello @pepperm2 ,

I have heard from developer that the new board shipping with another camera module, not OV2640. You need to attach a OV2640 camera module on the board and the code works now. I have just tested it.

Regards,

Pai

pepperm2 commented 4 years ago

I’ve cracked it...I think, for me anyway...

Apart from the spelling mistakes mentioned previously in the code, the camera will plug into the connector two ways around. When you put it in the wrong way around the camera is destroyed (because of the inevitable reverse polarity supply I guess) and won’t then work when put in the correct way around. The cable is marked 01 to 24 and the connector marked β€œ1” on the PCB. In hind sight, the β€œ01” and β€œ1” should be aligned :-) I purchased a new OV2640 for about Β£5 on eBay, fitted it the correct way around, and now everything works camera wise on my MaixDuino.

I wonder if other people have had this problem?

copleston commented 4 years ago

Alrighty, I had many troubles in trying to get the mobilenet_v1 example to work and ended up here. I'm sure other people will see this when trying to get the Maixduino working so here we go...

  1. If you're using anaconda you need to set the path for your python installation at /Users/<user>/Library/Arduino15/packages/Maixduino/hardware/k210/0.3.11/platform.txt to /usr/local/anaconda3/bin/python3 (just CTRL-F "python" in that file and you'll see what i mean)
  2. Change setRotaion to setRotation in both the .cpp and .h file in /Users/<user>/Library/Arduino15/packages/Maixduino/hardware/k210/0.3.11/libraries/Sipeed_OV2640/src (come on guys.... fix this - this is definitely not a closed issue!)
  3. The camera that ships with the Maixduino doesn't seem to be an OV2640 πŸ€¦πŸ»β€β™‚οΈ. Fortunately, I had another laying around and it worked when I swapped it in. Pins should be facing UPWARDS when inserted.
  4. You will be very disappointed by the results of all these efforts once it starts working - the mobilenet_v1 example is just terrible.

If anybody managed to get Maixduino working in PlatformIO then please let me know!

user-emx commented 4 years ago

I have MaixDuino (2626), and examples in python language work, especially the camera works. However, this is not the case with the arduino-ide example in cpp: selfie.ino. Procedure int Sipeed_OV2640::sensor_snapshot( ){ g_dvp_finish_flag = 0; uint32_t start = millis(); while (g_dvp_finish_flag == 0) { usleep(50); if(millis() - start > 300) return -1; } return reverse_u32pixel((uint32_t)_dataBuffer, _width_height/2); } returns minus one, which is why image pointer *img of selfie.ino is NULL. As the internet shows, i am not the only one with this problem.

user-emx commented 4 years ago

My Sipeed Maixduino (2626) kit is with a GC0328-camera. The flexible flat ribbon cable of 2cm has the inscribtion: zv-t01-ga4.4. The solution of my problem was very close to me in the form of an ESP32 kit with a OV2640-camera. Now selfie.ino (with PlatformIO selfie.cpp) works as expected. Sipeed_OV2640.cpp scans for the GC0328-camera, but it doesn't work that way of code.

dimitre commented 4 years ago

Actually having issues with camera too. this should not be closed.

AndroGiorgi commented 3 years ago

My camera work with MaixPy, but i view blank red screen on the display with Arduino and "snap fail" message in serial monitor.

ITstreet1 commented 1 year ago

Just to confirm, it is the end of 2023, and those files are still without a fix. You still have to change Rotaion to Rotation. There are problems with adafruit gfx lib, as it must be modified meanwhile

canDry commented 11 months ago

Just to confirm, it is the end of 2023, and those files are still without a fix. You still have to change Rotaion to Rotation. There are problems with adafruit gfx lib, as it must be modified meanwhile

Yah. Sipeed has abandoned this product ages ago - like many Chinese boards they release them, then they're immediately obsolete. No reason to ever buy sipeed products!