ESP32-CAM as doorbell with camera Topic is solved

Moderator: leecollings

snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by snellejellep »

gielie wrote: Saturday 23 May 2020 20:57
You have to install the esp32 Addons via tools -> board-> boards manager and search for esp32 and install

Try again.
Well great, i did not get it at first but fixed that using this tutorial:
https://randomnerdtutorials.com/install ... tructions/

i installed the pubsubclient using this tutorial:
https://www.baldengineer.com/installing ... ithub.html
and this is the github:
https://github.com/Imroy/pubsubclient

but now i get this...

Code: Select all

Arduino: 1.8.12 (Windows 10), Board: "AI Thinker ESP32-CAM"

C:\Users\Jelle\sketchbook\sketch_may23a\sketch_may23a.ino: In function 'void reconnect()':

sketch_may23a:618:64: error: no matching function for call to 'PubSubClient::connect(const char*, const char [1], const char [1])'

     if (client.connect(clientId.c_str(),MQTT_USER,MQTT_PASSWORD)) {

                                                                ^

In file included from C:\Users\Jelle\sketchbook\sketch_may23a\sketch_may23a.ino:10:0:

C:\Users\Jelle\sketchbook\libraries\pubsubclient-master\src/PubSubClient.h:119:9: note: candidate: bool PubSubClient::connect(String)

    bool connect(String id);

         ^

C:\Users\Jelle\sketchbook\libraries\pubsubclient-master\src/PubSubClient.h:119:9: note:   candidate expects 1 argument, 3 provided

C:\Users\Jelle\sketchbook\libraries\pubsubclient-master\src/PubSubClient.h:131:9: note: candidate: bool PubSubClient::connect(String, String, uint8_t, bool, String)

    bool connect(String id, String willTopic, uint8_t willQos, bool willRetain, String willMessage);

         ^

C:\Users\Jelle\sketchbook\libraries\pubsubclient-master\src/PubSubClient.h:131:9: note:   candidate expects 5 arguments, 3 provided

C:\Users\Jelle\sketchbook\libraries\pubsubclient-master\src/PubSubClient.h:193:9: note: candidate: bool PubSubClient::connect(MQTT::Connect&)

    bool connect(MQTT::Connect &conn);

         ^

C:\Users\Jelle\sketchbook\libraries\pubsubclient-master\src/PubSubClient.h:193:9: note:   candidate expects 1 argument, 3 provided

sketch_may23a:629:27: error: 'class PubSubClient' has no member named 'state'

       Serial.print(client.state());

                           ^

Multiple libraries were found for "WiFi.h"
 Used: C:\Users\Jelle\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi
 Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
no matching function for call to 'PubSubClient::connect(const char*, const char [1], const char [1])'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

I think your PubSubClient is to old.
The github you posted is 4 years old.

Had the same issue with an old version

When i Google on PubSubClient. Then the first hit is also a github, but that one is 4 days old. Tomorow i will have a look which one i use.
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

Looked over in my arduino.
I first tried the same you had, but that is the version 1.9
I download a different PubSubClient-Master, which has version 2.7

I downloaded from here
https://github.com/knolleary/pubsubclient
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

A 30 degree wedge is made.
10 and 20 degree are next, but not finished yet.

Image

The main-housing parts (front, main, back)
Image
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by snellejellep »

hoeby wrote: Sunday 24 May 2020 15:16 Looked over in my arduino.
I first tried the same you had, but that is the version 1.9
I download a different PubSubClient-Master, which has version 2.7

I downloaded from here
https://github.com/knolleary/pubsubclient
that solved my issue! thanks!

short summary for what to do if someone else encounters this problem:
uninstall arduino ide and remove all of its folders in appdata > local > arduino15
install arduino ide again
install the esp boards using this tutorial: https://randomnerdtutorials.com/install ... tructions/
install the pubsubclient using this tutorial: https://www.baldengineer.com/installing ... ithub.html
and use the github library hoeby mentioned: https://github.com/knolleary/pubsubclient

hoeby, thank you for this awesome project!

i still have one thing though, i uploaded the sketch to the esp32camera, aithinker model. and it connected to wifi but i noticed two things:
1. it does not do a live feed using the ip in the browser, am i missing something?
2. the snapshot is rotated 90 degrees so i would have to mount my doorbell sideways to not have rotated pictures

i hope you can help me with this.
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: ESP32-CAM as doorbell with camera

Post by gielie »

@hoeby are you planning to include face recognition? That would be awesome to know if there known people at your door.
Anyway I increased the resolution and have no problem this far with stability.
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

Last weekend i looked over to get the housing cnc machined. Which could be offered to everybody who would like to build the project.
The drawing is ready for this. It is different from the 3D printed housing. All 90 degree internal corners are removed, to keep cost of maching down. But haven't find a company who could make an affordable housing. I know it takes time to machine it and do all the work before you can start machining. But 95euro excl. taxes is to expensive.

snellejellep wrote: Monday 25 May 2020 12:07 1. it does not do a live feed using the ip in the browser, am i missing something?
This is correct. Reserved the index html for the V2 project.
For displaying the camera stream: http://ip/stream
For displaying captured image: http://ip/capture
For turning off standby led: http://ip/off
For turning on standby led: http://ip/on
snellejellep wrote: Monday 25 May 2020 12:07 2. the snapshot is rotated 90 degrees so i would have to mount my doorbell sideways to not have rotated pictures
This depend of the camera module you are using.
I have modules where the image is rotated 90 degrees, and where it is normal.
Will have a look if something is possible to change in the code, that you can modify it and use both
gielie wrote: Monday 25 May 2020 15:36 Are you planning to include face recognition? That would be awesome to know if there known people at your door.
For this version not. But it could be added on the wish list.
Could you explain how you thoughed, what it needs to do, when a face is recognized?
gielie wrote: Monday 25 May 2020 15:36 Anyway I increased the resolution and have no problem this far with stability.
I had problems with bigger resolutions. But great that yours works without issues.
Don't know if this depends on the camera module that is used.
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

hoeby wrote: Monday 25 May 2020 16:05
snellejellep wrote: Monday 25 May 2020 12:07 2. the snapshot is rotated 90 degrees so i would have to mount my doorbell sideways to not have rotated pictures
This depend of the camera module you are using.
I have modules where the image is rotated 90 degrees, and where it is normal.
Will have a look if something is possible to change in the code, that you can modify it and use both
I googled for this option. Flip 180 degree is possible, but 90 degree not. There is a script that rotates the image in the browser. But that is a captured image and not the live stream.
The camera module needs to support the correct view.

This is what i found online

Code: Select all

Unfortunately this is not possible. 
You can flip the signal on both axes for a 180 degree rotation, 
but you cant rotate the image by 90 degrees, 
it is a hardware limitation, 
And here is nothing that can be done about it I'm afraid. 
You can mount the module upside-down, but not on it's side.

See this too.

At a technical level, 
the camera module produces the video images directly
 (as a jpeg stream) and the esp32 module simply passes this 
 already-encoded stream to the client. 
 Any attempt to rotate the image would need to be done in software, 
 and the esp32 lacks both the cpu speed, 
 and memory, to do this in real time.
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
zandoorr
Posts: 2
Joined: Tuesday 26 May 2020 8:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ESP32-CAM as doorbell with camera

Post by zandoorr »

What a great project! I will get one myself.
However, when ordering the button I don't know which one to choose.

Button black version:
https://www.aliexpress.com/item/3268561 ... 4c4dTfkQ0i

41 or 42 RGB?
What voltage?
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by azonneveld »

zandoorr wrote: Tuesday 26 May 2020 8:52 Button black version:
https://www.aliexpress.com/item/3268561 ... 4c4dTfkQ0i

41 or 42 RGB?
What voltage?
Your link is not working.
I would advice 5V since the ESP32 also needs a 5V powersupply.
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

zandoorr wrote: Tuesday 26 May 2020 8:52 41 or 42 RGB?
What voltage?
I use the 41 rgb cathode button.
For voltage i choose the 6vdc version. 5vdc is not available.

If you wish the 5vdc. Then order it without resistors. Then you need to solder your own resistors to make it work on 5vdc.
Do not take the one without resistor and connect it without resistors to the esp. Then take the 6vdc version
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: ESP32-CAM as doorbell with camera

Post by gielie »

@hoeby can you share your V2 code (happy to test is), V1 runs smoothly even with the higher resolution. I also use the camera as a security cam in my dashticz setup.


Btw this the wide angle camera I use
https://a.aliexpress.com/_dW1wkIr
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

gielie wrote: Tuesday 26 May 2020 12:04 @hoeby can you share your V2 code (happy to test is)
V2 is not ready to use.
I am looking for a different way to use the webserver function on the esp, which also could stream the camera.
The idea with V2 is to upload the code in the esp. And after that the esp is an AP. Search with your phone/pc for that ap and connect. Than give your wifi credentials and reboot.
After it connectors to your network, all other settings need to go with the webbrowser
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: ESP32-CAM as doorbell with camera

Post by gielie »

hoeby wrote: Tuesday 26 May 2020 12:36
gielie wrote: Tuesday 26 May 2020 12:04 @hoeby can you share your V2 code (happy to test is)
V2 is not ready to use.
I am looking for a different way to use the webserver function on the esp, which also could stream the camera.
The idea with V2 is to upload the code in the esp. And after that the esp is an AP. Search with your phone/pc for that ap and connect. Than give your wifi credentials and reboot.
After it connectors to your network, all other settings need to go with the webbrowser
I'll try to be patience ;)
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

gielie wrote: Tuesday 26 May 2020 14:38 I'll try to be patience ;)
Maybe you could help to accelerate the project :?: .

The V1 version works with:

Code: Select all

 httpd_config_t config = HTTPD_DEFAULT_CONFIG();
  config.server_port = 80;
The V2 version needs to work with, this makes life easier for making the rest of the code.

Code: Select all

WiFiServer server(80);
For a image capture this is not the issue.
But for a image stream, this is another story. Having some idea's or tips?
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: ESP32-CAM as doorbell with camera

Post by gielie »

hoeby wrote: Tuesday 26 May 2020 17:12
gielie wrote: Tuesday 26 May 2020 14:38 I'll try to be patience ;)
Maybe you could help to accelerate the project :?: .
I wish I could, im but a simple code copier, I lack the knowledge to create codes like that.
I can help test the code but that's about it.
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

@gielie, No problem. Love it to see that people like the project.

Version V2 is not priority number 1 at the moment.
For this project the housing is number 1 for me. The 3d printed housing works, but want to bring that to the next level. And have a cnc machined housing. Work for this is in progress and it looks like it is coming together.

Also need to share the time. Working on shelly 2.5 as shutter controller. I thoughed there was enough info on the www to get this done with tasmota. I think i don't search well, because i can't find specific information about the shelly 2.5 --> tasmota --> domoticz. This takes more time than i thoughed.
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
zandoorr
Posts: 2
Joined: Tuesday 26 May 2020 8:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ESP32-CAM as doorbell with camera

Post by zandoorr »

I received the espcam from aliexpres, so i can finally start.
How is the progression on the project Hoeby?
Do you advise me to print the earlier version of the housing or to wait for your newer version?
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

I am not working on the V2 version, yet.
Last time i needed to update my domoticz to 2020.2. That has taken most of the time, because i wanted a fresh install on the PI OS.

The new housing is not finished.
Don't know when it will be finished. I have no roadmap for the doorbell. It is also to nice wetter to do some programming or working on the doorbell
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
hoeby
Posts: 530
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: ESP32-CAM as doorbell with camera

Post by hoeby »

I send a message to multi companies with the question to make the housing.
The cheapest i could find was 95 euro. Sorry to say, but that is to much for a DIY project.

I have a friend wo has a small cnc machine.
I asked him to make a few housings, but he is not interested. To much work he said.
He is making one prototype to see if the drawing is correct. If so, i will post the drawing for CNC machining online. Maybe there are people on this forum, wo can make the housing if they have the drawline. If so please step in.

My friend machined the inside last weekend. Maybe next weekend he will do the outside.
It is not his work, there he takes his time.

Image
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest