ESP32 CAM error message in Habpanel

  • Platform information:
    • Hardware: Raspi4
    • OS: RaspberryOS
    • OpenHAB on docker
    • openHAB version: 2.5.9
  • Issue of the topic:
    Just bought an ESP32 cam module and installed the latest CAM image (Arduino IDE)
    Everything is working fine but now I want to get the stream in my Habpanel, inserting a frame with an URL: http://192.168.1.1/stream
    This is working within a browser window (Chrome, Edge) but doesn’t work on my mobile in OpenHab (latest version)
    error shown:

header fields are too long for server to interpret

  • If logs where generated please post these here using code fences: no log

Any ideas?

Use the ipcamera binding and use the example in the full example of the official docs. The issue is the camera can only serve one stream and any further ones will fail. The ipcamera binding will copy and serve the stream out and fix the issue. I have served the esp32 cam out to six devices at the same time doing this.

1 Like

@matt1: thx for pointing me in the right direction.
For all who came across this thread, my solution (at least for me not that simple ;-))
I’m using an ESP32 board with the default Arduino webcam example, the board is then reachable via http://192.168.1.1 and the stream via http://192.168.1.1:81/stream.
It seems that it is not possible to integrate the stream URL in the habpanel, so I installed the IPCamera binding. As the ESP32 board doesn’t support a H.264 stream you have to install ffmpeg:

docker exec openhab apt update && apt install -y ffmpeg

I configured the binding via Paper UI:
IP Address: 192.168.1.1
Port for HTTP: 80
Snapshot URL: http://192.168.1.1/capture
MJPEG URL: http://192.168.1.1:81/stream
Server Port: 10123 (using docker in host mode, have to use port above 1024)
FFmpeg Input: http://192.168.1.1:81/stream
FFmpeg Output Folder: /dev/shm/ (had to change this according to binding description to use tmpfs)

now camera feed is available via http://192.168.10.1:10123/ipcamera.mjpeg (docker host ip) and can be used in habpanel…

Make sure you set this

ffmpegInputOptions="-f mjpeg"

You have to click show more? To see the advanced fields in the UI to set this one.
After adding this you can use the motion detection and some of the other features but as mentioned the camera only supports one open stream.

So if you use the motion detection that takes the stream away so you would need to use snapshots.mjpeg to watch the camera with.

If you don’t setup motion detection you can then watch the ipcamera.mjpeg on multiple tablets and apps around your house.

It may be possible to feed the ipcamera.mjpeg url back into the bindings alarm URL to gain both at the same time but I have never tried that. It probably will work.

1 Like