ESP32 Cam - working!

Hi there - have you solved it?
Failed to call service camera/play_stream. camera.front_door_camera does not support play stream service

I have the same issue.

No not yet. My router broke down so I have not hade time to get it running but my first test did not work…

Hi,

I am struggling with the installation of a ESP32CAM AI Thinker in HA.
Here is my config:
- HA image installed on Rasp 3B+
- System HassOS 3.13
- MotionEye: 0.8.0

I would like to be able
- to monitor the camera from outside (SSL)
- set up motion detection, preferaly through Motion Eye

Others on the forum seem to have succeed.
I am sorry to bother you with something so stupid, but I am a total newbee, spent days searching the web and I simply cannot manage to setting both!

I have integrated the cam with ESPHome: remote viewing works perfectly.
I finaly managed to spot the stream url (https://xxxxxxx.duckdns.org/api/camera_proxy_stream/camera.cameranew?token=c7ca642xxx).
The url works ok in VLC.
Pb: when I plug the URL as IP camera in Motioneye, it identifies the type of camera, creates it, but does not receive the pics
(cf Motioneye logs: ERROR: mjpg client timed out receiving data for camera 1 on port 8081
[22/Apr/2020:21:26:14 +0200] 200 192.168.0.8, 172.30.32.1(172.30.32.2) GET /picture/1/current/?_=1587583568642&_username=admin&signature=09f7e4fab639ada1c2f8412dacbe5fe6832d2541 HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36)
[22/Apr/2020:21:26:20 +0200] 200 192.168.0.8, 172.30.32.1(172.30.32.2) GET /picture/1/current/?
=1587583574121&_username=admin&_signature=07b67c9adb47cc8707b8a2c7a65dd408e9ed09a9 HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36)
ERROR: mjpg client timed out receiving data for camera 1 on port 8081)
On the top of that, if I understood well what I red on the forums, the ESPHome token changes all the time and when I try to put a permanent token from profile, MotionEye won’t even create the cam…

I tryed the other way, by flashing the cam via Arduino, following various tutos, including this one (https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/)
I easily got the stream (https://192.168.0.4:81/stream) and picture urls, as well as the settings’ webpage.
The cam is well integrated into MotionEye, motion detections, notifications work perfectly,…BUT…:
Streaming the cam on lovelace works poorly.
Whether I use the identity from the generic camera integration or the streaming URL of Motion Eye in lovelace picture card,…it doesn’t work…
It lags a lot, preload stream never ends,…
I have tried to change the 8081 port, nothing seems to work.

I have tryed to do without MotionEye, with scripts, but I only managed to take pictures. I get error message saying the cam does not accept recording, nor motion detection…far from expected result.
I would really like to use MotionEye, the app is great, 100% what I need.

I do not know, where I f… up : motioneye settings, parameters in Arduino flashing, tokens,…
Too many tracks to follow for my newbee’s knowledge!

Can somebody help me solve this nightmare puzzle or at least tell me where I should start looking?!

Thanks a lot

I finaly managed to spot the stream url (https://xxxxxxx.duckdns.org/api/camera_proxy_stream/camera.cameranew?token=c7ca642xxx).
The url works ok in VLC.

didn’t you forgot the port in this url??
port 8123

Thanks for helping me.
The URL is ok, because I copy it directly from the Lovelace picture card streaming.
I checked it with VLC, another browser, Lovelace and my mobile 4G, it works fine.
When I plug it in MotionEye as a network cam, it seems to recognize it directly as a Mpeg cam, it registers it, …but grey screen.
I have tried to change resolution, no impact…
I wonder if there is a conflict: you cannot use the same URL with MotionEye and Lovelace?
Strange…

But I do not know if I am on the right track, because the token seems to change very often.
I guess I will have to use a permanent profile one…

Long live Token!

1 Like

Did you solve this? How did you get the URL to use it on VLC?

Is it possible to do an integration of the Esp32 Cam using EspHome and Alexa?

so that you can say: “Alexa, show the front door camera.”

Thanks for coming back to me.
The issue for was more to access the cam stream from outside and inside my network.
I found a solution using motioneye link “embedded”. Not 100% perfect (have to be logged as motion eye admin and cannot create a simple user account otherwise it keeps asking for login/password each time you enter lovelace view) and even with this setting, I still have to enter motioneye add on section to “launch” the video streaming.
The simple “streaming” link will not work outside…
I have the feeling it is a matter of permanent token. I have created one and tried to plug the token in the link adress, but without sucess. I am 100% newbie and did not find a tuto to set the token correctly…
If you have ideas on the topic, I am interested.

Anyone managed to have a working camera.snapshot service working with an ESP32cam w/esphome fw ? When I call the service nothing is saved whatever the file location (/config/www/test.jpg for example)

Hi, can you share more details on Motioneye config?

Thi work for me:

  1. script.notify_motion
notify_motion:
  sequence:
  - service: camera.snapshot
    entity_id: camera.esp32cam
    data_template:
      filename: /config/www/xxxxx/cam1_{{ datetime }}.jpg
  1. automation that recall script.notify_motion and pass variable datetime
  action:
  - data: {}
    data_template:
      datetime: '{{ now().strftime(''%Y%m%d%H%M%S'') }}_{{ as_timestamp(states.automation.alarmrelays.attributes.last_triggered)|int
        }}'
    service: script.notify_motion

Thanks …

I solved my problem by adding

whitelist_external_dirs:
- /share
- /config

in the homeassistant :

1 Like

Sure, thsi is mandatory!

Does anyone know if ESPHome supports the TTGO T-camera Mini?

It looks interesting as it comes with a case.

Have any of you guy experimented with this ESP32cam firmware ?

The reason I ask is that I have a bit recently (after using ESPhome ESP32cam component) , and found it can be used in HA as a generic camera platform, with SD card snapshot and video recording.
Seems to me that might mean there is enough CPU horsepower in the ESP32cam to run the ESPhome API and still have SD card recording too…

There is no real reason why not. Same camera module.

I’m going crazy. I hope somebody can help me with ESP32 Cam.
I’ve installed EspHome and as long as I don’t tweak much with the config, it seems to work great with home assistant. The quality is better, than I have expected.
Now I’m trying to get the motioneye addon working, and I’m completely stuck now. I’ve read everything I could find on google and have not found a working solution yet.
Since I can’t insert the stream from the esphome api directly into motioneye, I’m trying to get the proxy camera to function, but with no luck. I get a link with a short time token and it doesn’t even work, if I insert it into the motioneye.
How do I get the stream from esphome / home assistant into the motioneye, there must be a way?! Thanks for the ideas

As far as I know, you cannot. You can use the RTSP firmware on the ESP32 cam, and use motion eye to connect to the stream. I was previously using the RTSP firmware connected with zoneminder, although I have taken my cameras offline recently until I get a chance to play with other NVRs.