core icon indicating copy to clipboard operation
core copied to clipboard

VCGENCMD error

Open cjmjmartens opened this issue 1 year ago • 3 comments

The problem

I use the following command to display the current version of the Raspberry firmware (RPI4). Since the upgrade to HA 2024.2.0, I receive the following error:

Command failed (with return code 1): sh -c 'ts=$(/usr/bin/vcgencmd bootloader_version | sed -E -n -e "s/timestamp (.*)/\1/p") && date -u -d @$ts -I'

What version of Home Assistant Core has the issue?

2024.2.0

What was the last working version of Home Assistant Core?

2023.1.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

In June '23 I reported the same error. Stefan Agners replied:

"Note that when you use a command sensor, this command is executed in the context of Home Assistant Core, which is not the same Home Assistant OS. So this is not a OS related issue. That said, it seems that vcgencmd moved from /opt/vc/bin/vcgencmd to /usr/bin/vcgencmd, presumably because Alpine Linux package raspberrypi-userland changed the path of that program between v3.17 and v3.18. So you'll have to adjust the path of your command."

cjmjmartens avatar Feb 07 '24 21:02 cjmjmartens

where or how do you use this command?

mib1185 avatar Feb 07 '24 22:02 mib1185

I have added this command to configuration.yaml:

- sensor:
    name: RPi Firmware
    command: |
      sh -c 'ts=$(/usr/bin/vcgencmd bootloader_version | sed -E -n -e "s/timestamp (.*)/\1/p") && date -u -d @$ts -I'

cjmjmartens avatar Feb 08 '24 07:02 cjmjmartens

is this the full configuration for this sensor? i still can not recognize the integration of this sensor?

mib1185 avatar Feb 08 '24 19:02 mib1185

Yes, this is it. Before the upgrade to 2024.2.0, this sensor reported "2023-05-11" on the dashboard. BTW: it looks like the vcgencmd command does not exist anymore in the /usr/bin folder. Maybe this command has been moved to another folder, but I am not able to find it.

cjmjmartens avatar Feb 09 '24 10:02 cjmjmartens

Hi, I've encountered a similar problem with the sensor since I upgraded to version 2024.2.0. my sensor: for GPU temperature:

  • sensor: name: GPU Temperature command: "/usr/bin/vcgencmd measure_temp" unit_of_measurement: "°C" value_template: '{{ value | replace("temp=", "") | replace("''C", "") }}'

stopped working In HA Core log i have error messages like this: [homeassistant.components.command_line.utils] Command failed (with return code 127): /usr/bin/vcgencmd measure_temp /bin/sh: /usr/bin/vcgencmd: not found

from SSH shell i run this command without any problems

rusandko avatar Feb 09 '24 14:02 rusandko

Hey there @gjohansson-st, mind taking a look at this issue as it has been labeled with an integration (command_line) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of command_line can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign command_line Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


command_line documentation command_line source (message by IssueLinks)

home-assistant[bot] avatar Feb 09 '24 14:02 home-assistant[bot]

HA OS does not include vcgencmd (or at least not on my own) so it's not an issue with command_line really. You would have to make an issue on HAOS repository as the issue is really not here. Thanks for understanding 👍

gjohansson-ST avatar Feb 11 '24 14:02 gjohansson-ST

@gjohansson-ST, thanks for your reaction.

@rusandko, I have created a new bug report in the HA OS section: https://github.com/home-assistant/operating-system/issues/3172

cjmjmartens avatar Feb 12 '24 21:02 cjmjmartens

HA OS does not include vcgencmd (or at least not on my own) so it's not an issue with command_line really. You would have to make an issue on HAOS repository as the issue is really not here.

The command_line integration runs commands inside the Home Assistant Core container, even on OS. So this utility is missing in the container. The board/machine specific utilities are installed as part of the machine specific Dockerfile in machine/ in this repository. So I've reopened the issue here.

But indeed this is not really an integration issue, so I've adjusted the label accordingly.

It seems that this is caused by the Alpine 3.19 upgrade. The package raspberrypi-userland in 3.18 contains vcgencmd, whereas raspberrypi-userland in 3.19 doesn't contain it anymore. It seems the package raspberrypi-utils-vcgencmd needs to be installed instead.

This effectively is a fallout of #107175. I create a PR to fix this.

agners avatar Feb 13 '24 10:02 agners