WirelessPrinting icon indicating copy to clipboard operation
WirelessPrinting copied to clipboard

Add camera support

Open probonopd opened this issue 5 years ago • 36 comments

There are now ESP32-CAM modules with camera and SD card. Can be had for around USD 10 from China. Ideal for our purpose.

@me-no-dev has added Arduino support for it : https://github.com/espressif/esp32-camera/issues/7#issuecomment-447675343

It seems to be working well:

Thank you so much, worked out of the box here as well. I tried it on an ESP32-CAM with a wide angle lense I got from a TTGO T-Journal order.

probonopd avatar Mar 02 '19 23:03 probonopd

Wow, buying it !

chepo92 avatar Mar 03 '19 13:03 chepo92

Internal pin connections:

Source: https://github.com/SeeedDocument/Outsourcing/raw/master/113990580%20ESP32-CAM/113990580%20ESP32-CAM%20Product%20Specification.pdf

probonopd avatar Mar 11 '19 18:03 probonopd

We need to find a way to not get the ESP32 boot messages onto the serial line since they will make it impossible to boot the printer firmware (I have tested it!).

We may not have free pins to use Serial1 on this board? GPIO16 seems to be the only pin that is on the board and not connected to cam or SD.

Pulling down GPIO15 to ground during boot should also silence the ESP32 boot messages. But GPIO15 is also attached to CMD of the SD card.

Reference: https://github.com/espressif/arduino-esp32/issues/642

probonopd avatar Mar 11 '19 18:03 probonopd

We need to find a way to not get the ESP32 boot messages onto the serial line since they will make it impossible to boot the printer firmware (I have tested it!).

I'll test it too

We may not have free pins to use Serial1 on this board? GPIO16 seems to be the only pin that is on the board and not connected to cam or SD.

I haven't tested but I think Uarts can be mapped to any pin: https://quadmeup.com/arduino-esp32-and-3-hardware-serial-ports/

chepo92 avatar Mar 11 '19 18:03 chepo92

Yes, but you need free pins that are not connected to the camera nor the SD card. And it looks like we are short of those...

probonopd avatar Mar 11 '19 18:03 probonopd

In addition to making a video stream of the printer, and taking timelapse images, we might do QR code recognition to e.g., recognize settings for different filaments based on QR codes (also see the Uniform Filament Identification system, UFID).

https://github.com/donny681/ESP32_CAMERA_QR/

probonopd avatar Mar 11 '19 18:03 probonopd

I read somewhere that boot log messages may be disabled on esp32 and not on esp8266, but I forget where I read it

GMagician avatar Mar 11 '19 22:03 GMagician

buy one, will test it out ...

fred2088 avatar Mar 23 '19 05:03 fred2088

Yes, but you need free pins that are not connected to the camera nor the SD card. And it looks like we are short of those...

Maybe you can use the LED PIN (GPIO33) and with SoftSerial (RX, TX | GPIO16, GPIO33). At the LED PIN you can solder a wire to the + side for the TX. The user (v12345vtm : https://github.com/v12345vtm/timelapse-ESP32-CAM ) has developed a timelapse feature. If you could put the project and his together, it would be ideal.

muenan avatar Mar 27 '19 09:03 muenan

Let's try it out. Unfortunately I don't have this hardware.

probonopd avatar Mar 27 '19 17:03 probonopd

we bought it and would like to try it out ...

fred2088 avatar May 17 '19 18:05 fred2088

Looking forward to hearing from you how it goes @fred2088

probonopd avatar May 17 '19 18:05 probonopd

Have you made any progress @fred2088?

probonopd avatar Jul 06 '19 10:07 probonopd

thinking to merge two project https://github.com/v12345vtm/timelapse-ESP32-CAM

fred2088 avatar Jul 06 '19 11:07 fred2088

So we continue here... Can't help coding :-( My skills is not there yet... But have you looked at this project? Mabye it can help? https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/

BTW, do you have some screenshots of your GUI?

ETE-Design avatar Sep 21 '19 14:09 ETE-Design

The pins is here? https://github.com/RuiSantosdotme/ESP32-CAM-Arduino-IDE/blob/master/ESP32-CAM-Video-Streaming/ESP32-CAM-Video-Streaming.ino

Was just asking for screenshots in general, just so more people than me can see what this is and compare to ESP3D without the need og flashing...

ETE-Design avatar Sep 21 '19 14:09 ETE-Design

The pins is here?

Yes, maybe. Just try it out until you have it working.

Was just asking for screenshots in general, just so more people than me can see what this is and compare to ESP3D without the need og flashing...

Check this video:

https://www.youtube.com/watch?v=4YOg0ReJtec

probonopd avatar Sep 21 '19 14:09 probonopd

So no Web GUI only direct integrated to Cura? Was hoping to have something like ESP 3D, not only direct control from Cura...

ETE-Design avatar Sep 21 '19 15:09 ETE-Design

There is also a Web interface to upload and print Gcode.

probonopd avatar Sep 21 '19 15:09 probonopd

We need to find a way to not get the ESP32 boot messages onto the serial line since they will make it impossible to boot the printer firmware (I have tested it!).

Actually, this is easy. Tested with ESP32-CAM firmware.

  • Connect pin UOR to PL2303HX green = TX
  • Connect pin UOT to PL2303HX white = RX
  • Connect pin 5V to PL2303HX red = 5V
  • Connect pin GND to PL2303HX black = GND
  • Connect pin IO15 to GND. Boot messages gone

So it should be doable using this hardware.

probonopd avatar Oct 04 '19 13:10 probonopd

Well done, keep comming closer to get Cam Support :-) Still waiting for my ESP32-Cam to start testing...

ETE-Design avatar Oct 04 '19 13:10 ETE-Design

Someone just needs to do it.

probonopd avatar Oct 04 '19 13:10 probonopd

Hi, there's a project interfacing esp32-cam to 3d printer which appears relevant here :

https://github.com/eben80/ESP32-CAM-Print-Monitor

Colin66 avatar Oct 21 '19 11:10 Colin66

Hi @Colin66 very good, so it looks like @eben80 has figured out how to access the camera while also talking to the printer via the serial line. Hence it should be a breeze to combine it with WirelessPrinting. @Colin66 @eben80 would you be interested to give it a try?

probonopd avatar Oct 22 '19 19:10 probonopd

Hi @probonopd I'm interested in the output but unfortunately I don't have the coding skills.

Colin66 avatar Oct 22 '19 20:10 Colin66

Hi @Colin66 very good, so it looks like @eben80 has figured out how to access the camera while also talking to the printer via the serial line. Hence it should be a breeze to combine it with WirelessPrinting. @Colin66 @eben80 would you be interested to give it a try?

Hi guys, I'm also working with very limited skills. My solution for communicating with the Serial port is extremely inefficient, probably the right way to do it would be what @luc-github uses in ESP3D. My solution I currently have so it just about functions... my standards are very low :D

Some pointers: I'm using SoftwareSerial for coms with the printer, the rxbuffer needs to be increased for lengthy responses like file listings.... on the hardware side I'm using voltage limiting zener diodes and a common ground connection to do the level shifting on both RX and TX.

eben80 avatar Oct 23 '19 11:10 eben80

Hi @eben80, may I be curious why you are using SoftwareSerial?

probonopd avatar Oct 23 '19 16:10 probonopd

Hi @eben80, may I be curious why you are using SoftwareSerial?

@luc-github just asked me the same thing today :D In my mind, I needed it because I wanted to keep UART0 for serial debugging... I just realized that pin14 & 15 that I am using is connected to the SD Card. Since I haven't been using the SD Card, I haven't had any issues.

eben80 avatar Oct 23 '19 19:10 eben80

Well, in this project we need the SD card of course. But I think hardware serial is fine too, as I have tested here: https://github.com/probonopd/WirelessPrinting/issues/94#issuecomment-538400339

probonopd avatar Oct 23 '19 20:10 probonopd

I run yesterday, but I had to solder wire for uart to 16 and 17 gpio directly to esp32. And strange things, I have two esp32-cam, on one which branded AI Thinker after uploading sketch I get infinite bootloop, on other no name module worked fine. And I also got worked sd card slot only after that modification "hasSD = SD.begin(13, SPI, fastSD ? 50000000 : 4000000);" I'm not sure correctly this or not. And one more thing, if I reset 3d printer by button, serial gone to forever "#TIMEOUT#"

romandoss avatar Apr 12 '20 10:04 romandoss