esp32cam to obs

Ideas, technical topics, help and discussion for ATV enthusiasts
Forum rules
This forum is run by the BATC (British Amateur Television Club), it is service made freely available to all interested parties, please do not abuse this privilege.

Thank you
m1cdq
Posts: 113
Joined: Thu Feb 28, 2019 4:28 pm

esp32cam to obs

Post by m1cdq » Fri Dec 20, 2019 5:05 pm

ive played around with these a now and then.
ESP32-CAM-getting-started-1024x576.jpg
ESP32-CAM-getting-started-1024x576.jpg (57.2 KiB) Viewed 7998 times
you can get these on ebay for around £8.00
just decided if i can connect it to OBS

1st i followed this site to program the module
https://randomnerdtutorials.com/esp32-c ... duino-ide/

while you are adding your wifi ssid and pass.
scroll down and look for

Code: Select all

 //drop down frame size for higher initial frame rate
  s->set_framesize(s, FRAMESIZE_QVGA);
change to

Code: Select all

 //drop down frame size for higher initial frame rate
  s->set_framesize(s, FRAMESIZE_SVGA);
this just sets the default frame size
choices are
160x120 (QQVGA)
128x160 (QQVGA2)
176x144 (QCIF)
240x176 (HQVGA)
320x240 (QVGA)
400x296 (CIF)
640x480 (VGA, default)
800x600 (SVGA)
1024x768 (XGA)
1280x1024 (SXGA)
1600x1200 (UXGA)



one you have programmed the device and have its IP address you can use your browser to go to the server
ESP32-CAM-video-streaming-example.jpg
ESP32-CAM-video-streaming-example.jpg (58.07 KiB) Viewed 7998 times
the stream address is http://YOUR_DEVICE_IP:81/stream

in OBS add a scene and in that scene add source and select browser in the URL input http://YOUR_DEVICE_IP:81/stream
you can play around wiht the frame size to suit

what my obs look like the esp32cam on the left
demo.jpg
demo.jpg (251.58 KiB) Viewed 7998 times
this is not a step by step guide. but it may help members who like to play
Attachments
CameraWebServerbatc.rar
(21.13 KiB) Downloaded 345 times

m1cdq
Posts: 113
Joined: Thu Feb 28, 2019 4:28 pm

Re: esp32cam to obs

Post by m1cdq » Fri Dec 20, 2019 5:45 pm

for the more tech minded I believe it can also be set up to do a RTSP video server
https://github.com/geeksville/Micro-RTSP

radiogareth
Posts: 1234
Joined: Wed Jan 06, 2016 9:46 am

Re: esp32cam to obs

Post by radiogareth » Fri Dec 20, 2019 8:51 pm

Lovely, another source to play with (well, 2 actually if China eBay delivers).
SHould work nicely with my old TalkTalk ADSL box, when I'm out portable :-)
Gareth

radiogareth
Posts: 1234
Joined: Wed Jan 06, 2016 9:46 am

Re: esp32cam to obs

Post by radiogareth » Wed Jan 29, 2020 7:52 pm

The two cameras have arrived, along with a handy USB programming board I spotted on https://bitluni.net/camProg. Saves a lot of messing, work in progress now.....
Gareth

radiogareth
Posts: 1234
Joined: Wed Jan 06, 2016 9:46 am

Re: esp32cam to obs

Post by radiogareth » Sat Jun 06, 2020 1:47 pm

OK, trying to progress this as a handy little camera solution.
I've followed the tutorial to install the many 'ESP' libraries and have successfully downloaded a wifiscan program that returned all my local wifi sources, so I (a) know my bitluni cam-prog is working and that its talking to the chip that runs the wifi component.
Using 'get board info' comes back with BN:Unknown (bootleg Chineses copy??) VID 1A86 and PID 7523. Desptie having uploaded a sketch it still says upload any sketch to obtain SN. Last probably not of consequence.
When I try and compile/upload either the example listed above or the example in the ESP library (Camerawebserver) I get error messages at the end saying...
Global variables use 53488 bytes (16%) of dynamic memory, leaving 274192 bytes for local variables. Maximum is 327680 bytes.
Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
Problem may be I can't find an 'exact match' for the ESP board I have (pictures attached). As its probably a clone board I'm working my way through the options listed hoping to find one that 'looks' like mine.....so far they compile process (which seems to take ages?? compared to 'most sketches') keeps fialing with Sketch too big....
Unless someone can shed light.....
TIA
Gareth G4XAT
2020-06-06 14.20.15.jpg
2020-06-06 14.20.15.jpg (126.12 KiB) Viewed 6677 times
2020-06-06 14.19.40.jpg
2020-06-06 14.19.40.jpg (113.86 KiB) Viewed 6677 times

aerostar
Posts: 30
Joined: Tue Jul 26, 2016 7:40 pm

Re: esp32cam to obs

Post by aerostar » Sun Jun 07, 2020 10:04 am

I have a clone board - when compiling I use

#define CAMERA_MODEL_AI_THINKER and it works fine.

Also your pinouts are the same as my board. The DM may indicate DiyMore as the maker.

My Board ID gives same as you quote

I Use a USB to serial adapter set to 3volts for programming

File used esp32-cam-webserver-1.0
No changes to it other than the wifi ID entry

Assume using Arduino compiler - remember to select the correct board "AI Thinker ESP-32-CAM"
(under Tools Board)
---------------------------------------------------------------
Here is output from my compile

Sketch uses 2154394 bytes (68%) of program storage space. Maximum is 3145728 bytes.
Global variables use 53624 bytes (16%) of dynamic memory, leaving 274056 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port COM3
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None


Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 3855.0 kbit/s)...
Hash of data verified.
Compressed 17392 bytes to 11186...

Writing at 0x00001000... (100 %)
Wrote 17392 bytes (11186 compressed) at 0x00001000 in 0.3 seconds (effective 451.7 kbit/s)...
Hash of data verified.
Compressed 2154512 bytes to 1659717...

Writing at 0x00010000... (0 %)
Writing at 0x00014000... (1 %)
Writing at 0x00018000... (2 %)
Writing at 0x0001c000... (3 %)
Writing at 0x00020000... (4 %)
Writing at 0x00024000... (5 %)

VVVVVVVVVV skipped all intermediary

Writing at 0x001a4000... (100 %)
Wrote 2154512 bytes (1659717 compressed) at 0x00010000 in 40.6 seconds (effective 424.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 119...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (119 compressed) at 0x00008000 in 0.0 seconds (effective 664.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
---------------------------------------------------------------------------

For OBS add source Browser Type in name - click OK - next enter url
put in http://192.168.0.244:81/stream your cam IP ADD obviously
then width and height click OK

Remember it only supports one stream.
Controls - use a browser - no port required as it defaults to 80
view just the stream in a browser - use same ip with :81/stream on end.


Bob

radiogareth
Posts: 1234
Joined: Wed Jan 06, 2016 9:46 am

Re: esp32cam to obs

Post by radiogareth » Sun Jun 07, 2020 1:03 pm

Thanks Bob, that might well progress things :-)
EDIT.....as indeed it did, still a slow compile, but it (a) fits and (b) uploaded without any problems :-)
Now to find it on my network once powered seperately from the cam-prog.
Gareth
EDIT AGAIN.....Spectacularly good for something that was less than a £5! Now to design a nice little case for it :-)

radiogareth
Posts: 1234
Joined: Wed Jan 06, 2016 9:46 am

Re: esp32cam to obs

Post by radiogareth » Sun Jun 07, 2020 4:51 pm

Spoke a bit too soon I fear.....first device popped up directly on my router, second one programms fine (with the same code) but steadfastly refuses to connect to either my main unit or my portable unit (which the earlier one does with a repsogramming fo ID & PW).
Still, one works so for £10 its not a deal breaker....
QC perhaps....
But since I had salvaged the 2.4GHz PCB antenna from a dead Virgin Router and since the plugs matched, its now got a much stornger link to the router. which helps with the refresh rate.....

Gareth

aerostar
Posts: 30
Joined: Tue Jul 26, 2016 7:40 pm

Re: esp32cam to obs

Post by aerostar » Sun Jun 07, 2020 9:44 pm

Use the serial monitor on the Arduino IDE to watch the start up when programmed.

So have board connected to IDE - select serial monitor - make sure com port and speed selected then press the reset button on the ESP board, make sure you have not got the ground link to IO0, and on the serial monitor display you will see diags and may tell you what is wrong.

Did you change the surface mount link next to the aerial plug ?, as it comes its normal position connects the onboard PCB aerial, in other position it connects to plug for external aerial.

Bob

radiogareth
Posts: 1234
Joined: Wed Jan 06, 2016 9:46 am

Re: esp32cam to obs

Post by radiogareth » Mon Jun 08, 2020 7:24 am

Thanks Bob, Looks like there is a problem with the camera.
I get this message on reset:
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

[E][sccb.c:154] SCCB_Write(): SCCB_Write Failed addr:0x30, reg:0x57, data:0x00, ret:-1
[E][camera.c:1215] camera_init(): Failed to set frame size
[E][camera.c:1270] esp_camera_init(): Camera init failed with error 0x20002

But with the 'working' unit I get this:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

........
WiFi connected
Starting web server on port: '80'
Starting stream server on port: '81'
Camera Ready! Use 'http://192.168.1.2' to connect

And no, I did not spot the jumper link for the external antenna - thanks. I've done a little researching on how to use the on-board LED (for e.g. lighting the subject at night) but not really found a simple solution to controlling it. Hack the PCB track to the control transistor, use bluetooth to control it and a couple of other options like motion triggered flash for wildlife camera etc. Surprised there isn't something light level controlled, from camera sensing perhaps or just an LDR.Its a powerful little board!
Gareth

Post Reply

Return to “General ATV Discussion”