Axis camera component

I do get the following error with the Axis P-1224-E camera running firmware 5.51.7 on a HA 115.3

Log Details (ERROR)

Logger: libav.tcp
Source: components/stream/worker.py:49
First occurred: 12:20:30 PM (2 occurrences)
Last logged: 12:20:30 PM

Connection to tcp://2467:554?timeout=5000000 failed: Invalid argument

The Axis camera integration has been done using the Integration Panel. As soon as I delete the integration, the error is gone.

Any assistance how to solve this error.

Looks like the ip adress is at fault. Does the other parts of the integration work?

I have used both local IP and domain name. In both cases I do get a camera picture but the error persists. Home Assistant comes up with a discovered AXIS integration. Selecting CONFIGURE comes along with an already filled in host IP address and port which are correct. I only have to supplement it with username and password. In doing so, it comes back with Success!, Created configuration etc. indicating that the P1224-E 0 was found. Clicking finish results in one Axis device being created with 3 entities. These are camera and two Input binary_sensors. Despite this successful configuration, I get the error message every second.

Ok. I saw someone mentioning issues with the stream platform, can’t find where it was right now though. Im working on some other things ATM so this is nothing I will look into right now, though I don’t think its due to the Axis integration itself.

Configuring the following Axis camera’s 215PTZ, M5525-E, P1224 and P5512PTZ using the Axis component from the integration panel results in all instances with the following error message:

Logger: libav.tcp
Source: components/stream/worker.py:65
First occurred: 2:27:58 PM (5 occurrences)
Last logged: 2:28:56 PM
Connection to tcp://2467:554?timeout=5000000 failed: Invalid argument

Though I do get a picture, clicking on the picture to get a live stream fails, i.e. continues spinning.

In some instances, though not all camera models, I seem to be able to get a picture and livestream using platform: camera http://host:8082/axis-cgi/mjpg/video.cgi

I’m puzzled by the fact that with this integration being around for so long, I can’t locate similar concerns which could help me out remedying this issue.
Any help would be appreciated.

Well there is alot of information you’re not sharing.

One thing is that the 215PTZ is not supported by the integration

My intention is to get this issue solved. For that reason, pls let me know my shortcomings in “not sharing a lot of information”. I’m just following the integration instructions which result in this error.

What installation method has been used for Home Assistant, what version of Home Assistant are you running, what firmware versions are the devices running, has it ever worked, have you tried disabling the stream component?

“tcp://2467:554?timeout=5000000 failed: Invalid argument” 2467 is not a real address.

“I’m puzzled by the fact that with this integration being around for so long” the stream component is a lot newer than the Axis integration

In answer to your questions, the following is advised:

  1. Installation following procedure outlined in https://www.home-assistant.io/getting-started/ using a Pi 3 Model B 4GB-32bit
  2. Operating system HassOS 4.15 Home Assistant Core 0.166.4 and 0.117.4. Experience is identical across both systems.
  3. Prior to CONFIGURATION, check Configuration-LOG which indicates, there are no new issues, i.e. NIL error message.
  4. Camera Installation; Notifications-New devices discovered-Check it out. Select discovered AXIS-CONFIGURE. ‘Set up Axis device’ comes with pre-filled in HOST and Port which match network data. Afetr having filled in Username and Password, SUBMIT which results in: We found the following devices etc. FINISH. P1224-E, 1 device and 2 entities configured. Select OPTIONS and make sure Axis device video stream options shows No stream profile is selected, SUBMIT
  5. In Picture Glance Card Configuration, pull down Camera Entity and select camera.p1224_e_0, Tap Action & Hold Action both No Action.“Save”. Camera visible.
  6. Check Configuration-Logs, no errors identified.
  7. Select OPTIONS and make sure Axis device video stream options shows “Quality”, SUBMIT
  8. Select Tap Action - Toggle in Picture Glance Card Configuration.
  9. Click on image, new window opens but keeps spinning with no stream shown.
  10. LOG shows:

Logger: libav.tcp
Source: components/stream/worker.py:65
First occurred: 7:39:03 PM (9 occurrences)
Last logged: 7:45:05 PM
Connection to tcp://2467:554?timeout=5000000 failed: Invalid argument

  1. Stream profile settings in Axis camera for QUALITY uses MJPEG video encoding and Preview under Axis setup shows live stream picture

  2. The above experience is identical across all compatible Axis cams quoted above.

  3. Hope this explains what I’m doing and hopefully you can point me into the right direction to resolve this.

Can you create an issue on home assistant github? It’s hard to keep track and remember issues when reported in the forums

Hey all.
I have issues with the Axis component. I have a very old HA installation inside Docker (which I update regularly) which has my cameras added correctly with all cameras and their sensors.
Now if I spin up a brand new home assistant with docker without any configuration and add a camera, it only has the camera itself and no motion detection or other sensors. Interestingly, I also tried with an old HA like 0.117.1 and there I still have just the camera. What could be the cause of this?

You’re running 2021.1? Did your docker configuration change? Anything else that changed in the system; firewalls etc.

I tried different version, current also the latest one: 2021.1.5
No. I just setup a new docker with this compose file:

version: '2'
services:
  homeassistant:
    container_name: ha2
    image: homeassistant/home-assistant:2021.1.5
    volumes:
      - /mnt/docker/ha2:/config
    environment:
      - TZ=Europe/Zurich
    restart: unless-stopped
    ports:
      - 18123:8123

create an admin user and then add the axis camera. The camera is then added with only one entity (camera itself) but no other sensors.

With home assistant its recommended to run in host mode, I think.

Yup: https://www.home-assistant.io/docs/installation/docker/

I also have another instance which directly runs with python started with hass and there I have exactly the same.

Ok, do you get any errors or warnings in the log during startup of hass? Since its been verified to work the issue lies with something in your environment that differs from your previous setup

Nope, no logs and no warnings. I am btw in discord for a discussion, and we could post the result here to keep this thread shorter.

To follow up here, indeed it was an environment issue related to not using “network_mode: host”

When reinstalling a system make sure to follow best practices in the guidelines https://www.home-assistant.io/docs/installation/docker/

And also due to the component needing additional ports (beside the http port), so be carefull with firewalls.

I’d appreciate if one or two could try out the new hass 2021.02 beta to verify that everything works as expected with the Axis integration. Most of the library has been refactored for quality purposes and a lot of extra tests have been added. But extra verification is always nice