ESP32 - Reusing example source - Esp32-Camera

For general Flowcode discussion that does not belong in the other sections.
BenR
Matrix Staff
Posts: 1744
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 444 times
Been thanked: 604 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by BenR »

Think the £0.73 is just for the programming interface, the complete thing is £4.40 but still a good price.

At least we know that what works for you should also work for me.

I got an IDF web cam project working with the camera which was pretty decent quality, I then maybe spent an hour trying to shoehorn that into Flowcode and then likely got distracted with something else.

mnfisher
Valued Contributor
Posts: 970
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 515 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by mnfisher »

Thanks - that means I don't feel so bad - I think I paid £6 including the programming extension board.

I'll post the code this evening...

Martin

mnfisher
Valued Contributor
Posts: 970
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 515 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by mnfisher »

I think this should do the trick...

So all the steps from the first post - except creating the fc file - use examples.fcfx from below and changes to files examples/main (these are included in the zip file..)

Extract the zip file to examples/main

Do the idf.py fullclean etc from the subsequent message.

Compile and (hopefully) should download and run (make sure there is an sd card in place!) - saving a photo every few seconds....
examples.fcfx
(15.06 KiB) Downloaded 43 times
take_picture.zip
(6.65 KiB) Downloaded 43 times
I've left file names as per espressif (sd_card_example_main.c for example) - but I have modified them (app_main has gone etc) - the names are a good reminder of their origin?

There is very little feedback/error checking - as mentioned I couldn't get the UART to work (and the pins A0, A3 aren't an option when using the esp32 camera board target ?)

For 'timelapse' photography - it would be good to either check if files exist or save a 'count' in eeprom, so it doesn't overwrite on power down / restart. My intention is to use deepsleep and wake every 'interval' seconds, take a snap and then sleep again.

It might be good to pull in the time/date from the web to timestamp the photos..
It should be 'fairly easy' to add a web server and transmit the image over wifi?
Can use led=0/1 to toggle the flash

Martin

mnfisher
Valued Contributor
Posts: 970
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 515 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by mnfisher »

Anyone (Iain/Ben?) manage to get this to compile?

I did a slightly more 'advanced' version - here it attempts to set the RTC from NTP on first run (files have timestamp) and takes a photo every 5s (change 'interval' if needed) - it uses deep sleep to try and minimise battery consumption.

You'll need to set password and ssid (in SetRTC) to connect to wifi...

Note - here I turn the flash on to take the photo - it also shows 'life'. Also that if the SD card isn't inserted it will crash and restart - flash rate is increased..
examples.fcfx
(23.37 KiB) Downloaded 52 times
Martin

chipfryer27
Valued Contributor
Posts: 1161
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 415 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by chipfryer27 »

Hi

Working away at present with no access to hardware. Will try once I get back.

Regards

mnfisher
Valued Contributor
Posts: 970
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 515 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by mnfisher »

Thanks - will be interesting to hear how you get on....

MJU20
Posts: 246
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by MJU20 »

Thanks guys, I wish everybody would share their projects like this one!

mnfisher
Valued Contributor
Posts: 970
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 515 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by mnfisher »

Just set this up with a 5M pixel camera. Powered by 4 x AA onto the 5V/Gnd pins and seems to work well. Takes a photo every 10s - using a class 10 micro SD card and saving as JPG (~450KB)

Have had a pair of owls in the garden and I'm hopeful :-) Have turned the 'flash' off - to avoid alarming them, in the (very) unlikely event I get a photo..


Martin

mnfisher
Valued Contributor
Posts: 970
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 515 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by mnfisher »

Owl.JPG
Owl.JPG (99.02 KiB) Viewed 1123 times
Not with the esp32!

medelec35
Matrix Staff
Posts: 1457
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 513 times
Been thanked: 473 times

Re: ESP32 - Reusing example source - Esp32-Camera

Post by medelec35 »

That is still a great picture!
Martin

Post Reply