luc-github / ESP3D

FW for ESP8266/ESP8285/ESP32 used with 3D printer
GNU General Public License v3.0
1.73k stars 465 forks source link

Add camera support (embedded or external) #82

Closed luc-github closed 7 years ago

luc-github commented 8 years ago

several projects / cameras already exist: http://www.roboremo.com/jpeg-camera--esp8266.html http://www.arducam.com/arducam-supports-esp8266-arduino-board-wifi-websocket-camera-demo/ http://www.ladyada.net/wiki/tutorials/products/camera/index.html http://hackaday.com/2016/01/24/truly-versatile-esp8266-wifi-webcam-platform/

luc-github commented 8 years ago

Arducam seems the cheapest camera ( around 28US$) versus others (around 54US$)

luc-github commented 8 years ago

ordered this one : http://www.ebay.fr/itm/Arducam-Mini-module-Camera-Shield-w-2-MP-OV2640-for-Arduino-UNO-Mega2560-board-/281639729684?hash=item4193093a14:g:Ru0AAOSwrklVEhhz now need to wait :mailbox:

geoanimator commented 8 years ago

Great idea. Are you thinking of keeping it on a separate / dedicated ESP?

luc-github commented 8 years ago

I need to do test but my first idea is no dedicated ESP, it will depend of MCU load actually, if can handle monitoring and streaming in same time or not

luc-github commented 8 years ago

ok camera received and working with demo sketch - can capture images :smile: image

Next step is to do live streaming :thought_balloon:

luc-github commented 8 years ago

hmm not sure it worth the time to develop something actually can have complete wifi cam for little cheaper : http://www.ebay.com/itm/1x-Mini-HD-Wifi-Wireless-IP-Camera-Security-Network-IR-Night-Vision-Webcam-EU-TR-/152012558200?hash=item2364a78f78:g:3lcAAOSwwpdW4541

geoanimator commented 8 years ago

Nice find. I think you might be right. Other than the challenge of getting it to work it might not be practical. I do remember having problems with timecapture on my Rasp B with internal camera in combination with octoprint. I found it did affect the gcode streaming after a few hours the PI's response would be sluggish and I would miss steps. So I have since kept the two functions separate. I am sure if I research the issue upgrade etc. I might have found a way around it but didn't seem worth the complication. I just turn it off and on via octoprint menu as needed to view how a print is going. I don't use it for time capture at this moment.

luc-github commented 8 years ago

Yes looking a code sample I am afraid video streaming keep MCU too busy to do anything else so unless there is a cam that cam be used for ESP for less than 10$ I do not think it is necessary to work on it I close topic and reopen if find opportunity

luc-github commented 8 years ago

I have ordered this one to check http://www.ebay.fr/itm/Wireless-WIFI-P2P-Mini-Remote-Surveillance-Camera-Security-FOR-Android-IOS-PC-JK-/262238005881? if OK definitly the one to use in printer for 14,89 EUR

geoanimator commented 8 years ago

Yes that looks the way to go.

Hopefully you are able to use http and stream the video. ie so you can view from a browser plus capture video or stills for time lapse vids..

Not sure if the mobile phone versions use a dedicated protocol?

You might be able to capture the packets and see?

It will be interesting to see what you can get out of it.

great price.

luc-github commented 8 years ago

it says it support Android / IOS / PC so I guess it use H264 or mjpeg that can be streamed in web browser like common ip camera, will test and confirm when got it ^_^

luc-github commented 8 years ago

even it is nice and cheap - and have it's own battery - I did not find a way to use it easily and need specific application to display - developer did not answered to my emails so - it is not qualified for the purpose

luc-github commented 8 years ago

I ordered : http://www.aliexpress.com/snapshot/7769617635.html?orderId=75923081605482 video I saw on the net show the use of IE so I hope to be able to display in web page - TBC price is cheap - size / holder fit location in printer - will give feedback later

luc-github commented 8 years ago

leave open for better following

geoanimator commented 8 years ago

I think P2P camera's are going to give problems? Do you still have the link showing it used in IE? A lot of manufacturers are going down this path as it makes it easy to setup for use outside the local lan ie no DDNS required etc but not good for people who like to tinker. ie they don't have a web interface for a browser generally from what I have seen? ie can't configure network IP settings etc.

More info here http://www.hkvstar.com/technology-news/how-does-p2p-ip-camera-work.html P.S. read the user comments

I must admit I am not a fan of them. Don't like the security risk. It will be interesting to see how it goes. ie after all it is just for capturing 3D prints.

luc-github commented 8 years ago

yes I do not like p2p neither but this one use browser and app, about IE support, I cannot find the video in my historique but you have everything in description:

check PC requirememt : IE / Safari / google Chrome, standard browsers..... so looks promising also have several screenshots

login use IE : http://g02.a.alicdn.com/kf/UT8ZH14XvlaXXagOFbXY.jpg image

IE need pluggin but not sure for chrome image

also seems there is a not P2P fonction like others IP cams I use at home : image

so will see ^_^

mkeyno commented 8 years ago

@luc-github do you thinks is it possible to install ESP-Arducam inside the PIR sensor so it send the image back to server as soon as it got motion

luc-github commented 8 years ago

@mkeyno if your PIR use ESP yes I do not see the problem - sensor trigger the command to take picture - but to be honest even cheap cam have this feature and no need IR sensor for that

luc-github commented 8 years ago

Ok got the cam - after a setup using a phone and audio configuration (yes audio ^_^ as no cable to connect on this cam) I make it work : image The cam is twice bigger as a logitech C170 so it is acceptable it works under chrome without addon I think as I did not add for it, and it need a plugin for IE. I support 2 resolutions, configuration interface is neat as others IP cam I use to have, and even better - there is some delay (2~3 seconds) due to buffering but for printer, it is fine.

The only confusing part is first setup - as wps was not working I did audio - here a video I found that helped me a lot to understand: https://www.youtube.com/watch?v=YlPtflbspG0 1 - wait 1 minute the cam start 2 - download the app on your phone 3 - connect your phone to local wifi 4 - setup the wifi / password in audio configuration page 5 - when blue led of cam is fixed - push configuration button with phone close to the face of cam, location need to be quiet as it will configure the cam using sound - It remember when radio was broadcasted game and we need to record on tape ^_^ 6 - when blue led is blinking scan the code on cam using the app to add the cam - type default password and if it works you cam is online :fireworks:

then you can use the browser to finish the configuration. for less than 22$ it is definitly good

luc-github commented 8 years ago

so it can be embedded in any html page of UI - just need to save the stream path with or without password

luc-github commented 8 years ago

I forget to add : I get only the video stream and not full UI on IE: http:///preview.html image

on chrome and firefox : http:///flashview.html image

on safari: sorry not tested

the request of login/password is done on the fly

geoanimator commented 8 years ago

Glad you got it working Luc. Still not a fan of the P2P webcams but it will suit this purpose and at a great price. Now you can play with timelapse :-) Is it able to do snapshots?

luc-github commented 8 years ago

well I do not use as p2p but direct access, the authentication is windows basic authentication, so actually you can hard code the login/ password in url and not use the p2p system you can disable the manufacturer ddns and change port so I guess this not a true p2p camera image

about snapshot it use flash on chrome (instead of usual MJPEG) and a plugin on IE and only this plugin allow to take snap but seems issue in path image

Yes next step will be to change the holder to fix cam and add in ESP3D page a window for cam

luc-github commented 7 years ago

I close this topic as no FW related

Zefram88 commented 5 years ago

Is it possible to implement RTSP protocol on camera view?

luc-github commented 5 years ago

From what I read here you need an external program https://stackoverflow.com/questions/2245040/how-can-i-display-an-rtsp-video-stream-in-a-web-page

luc-github commented 5 years ago

A plugin or a player installed

wilbur4321 commented 5 years ago

Have you considered support for running esp3d on an esp32-cam board and using it's camera?

luc-github commented 5 years ago

Yes a POC has been done using a limited UI by someone - but it use a custom webserver example code - so it will need some tuning to make both having a good cohabitation but not in same time - will need to switch between ESP3D/WEB UI or Camera UI

Zefram88 commented 5 years ago

There's a method to run code on 2nd core of the ESP32 through Arduino IDE, maybe it can be used exclusively to run camera code.

luc-github commented 5 years ago

Core 0 is for WiFi Core 1 is for application This allows to get smooth behavior, Stream camera video use a lot of both, here the work done by @eben80 https://github.com/eben80/ESP32-CAM-Print-Monitor

ETE-Design commented 4 years ago

Will you implement it to ESP3D?

luc-github commented 4 years ago

https://github.com/luc-github/ESP3D/issues/239#issuecomment-536529510

done already

ngoalongcang commented 4 years ago

how is esp 3.0

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.