Raspberry 4 has it own EEPROM with firmware impacting among other features, booting RPi from SSD connected to USB. There were attempts to automatically update EEPROM in OS version 5.6 - 5.8 (I believe) and as of 5.9 this has been removed.
In order to see which version of EEPROM is installed it would be very useful to have this information in HA (either in Supervisor/System or in Configuration/Info) - otherwise one has to connect monitor and see it during boot or start other system on RPi board.
Very useful enhancement
Maybe it’s possible to get that information using a command_line sensor too?
This would be easiest. My knowledge is limited enough that searching Internet I could not find easy answer if such command exists. I hope someone more skilled can confirm/deny.
The relevant command is vcgencmd bootloader_version
, but that’s failing for me when I try it in a sensor. Probably because the docker configuration is insulating from the actual command?
I think so. Plus I think, that OS for HA might not have all commands available in Raspberry Pi OS. Or hopefully I am wrong…
I used from SSH on port 2222
ha > login
# /opt/vc/bin/vcgencmd bootloader_version
/bin/ash: /opt/vc/bin/vcgencmd: not found
I see your prompt shows bash-5.0#. Mine has just #
I got it.
docker container exec homeassistant /opt/vc/bin/vcgencmd bootloader_version
When using Terminal & SSH Add-on it does not work
@bschatzow - also "docker… " does not work:
Maybe because it is add-on not a “SSH on port 2222” ?
Needs to be run on the host itself. I did by using Portainer -> Container -> homeassistant -> >_Console.
Works fine
bash-5.0# /opt/vc/bin/vcgencmd bootloader_version
Mar 19 2020 14:27:25
version 940f978d13e45be9baef77f3f4a13b76a832f7b4 (release)
timestamp 1584628045
bash-5.0#
Same (pretty sure, did not test it) with host SSH access via port 2222.
I am not sure if I have Portainer (my installation is simple RPi4 flashed image of HA OS - nothing more).
Can port 2222 with SSH access be used on Terminal & SSH Add-on ?
Anybody can suggest how to run this command on that type of installation (quite common I believe) ?
No experience with that way, but here’s the official documentation (aiming at developers, so take care): https://developers.home-assistant.io/docs/operating-system/debugging/#ssh-access-to-the-host
OK. I will not dare to go there - I am not developer…
Also I can see that even if I read the data it does not look “easy to understand”:
version 940f978d13e45be9baef77f3f4a13b76a832f7b4
So, hopefully not big development from HA team could make it available in HA front end as well as “decode” the version long character data into version date and number and availability of new one. Like the result of $ sudo rpi-eeprom-update
command:
Hi,
if you want to display the current firmware version on HASS Operating System, try this command line sensor:
- platform: command_line
name: Raspberry PI Firmware
command: |
sh -c 'ts=$(/opt/vc/bin/vcgencmd bootloader_version | sed -E -n -e "s/timestamp (.*)/\1/p") && date -u -d @$ts -Iminutes'
If you prefer to see only the date, remove minutes
from -I
:
- platform: command_line
name: Raspberry PI Firmware
command: |
sh -c 'ts=$(/opt/vc/bin/vcgencmd bootloader_version | sed -E -n -e "s/timestamp (.*)/\1/p") && date -u -d @$ts -I'
BTW, I also have the CPU temperature and PMIC temperature, in case you are interested:
sensor:
- platform: command_line
name: Raspberry PI CPU Temp
command: "cat /sys/class/thermal/thermal_zone0/temp"
unit_of_measurement: "°C"
value_template: "{{ value | multiply(0.001) | round(2) }}"
- platform: command_line
name: Raspberry PI PMIC Temp
command: |
sh -c "/opt/vc/bin/vcgencmd measure_temp pmic | sed -E -e 's/^temp=(.*).C/\1/g'"
unit_of_measurement: "°C"
- platform: command_line
name: Raspberry PI Firmware
command: |
sh -c 'ts=$(/opt/vc/bin/vcgencmd bootloader_version | sed -E -n -e "s/timestamp (.*)/\1/p") && date -u -d @$ts -Iminutes'
Hi,
I am using the following command to retrieve the firmware version of my RPi4. This is working great. However I would like to display the date as day-month-year instead of year-month-day. Is this possible? Thanks in advance for your reaction.
- platform: command_line
name: Raspberry PI Firmware
command: |
sh -c 'ts=$(/opt/vc/bin/vcgencmd bootloader_version | sed -E -n -e "s/timestamp (.*)/\1/p") && date -u -d @$ts -Iminutes'
When I try to get the firmware version using this, I simply get the following in the logs:
Command failed (with return code 1)
Running in the terminal gives:
sh: /opt/vc/bin/vcgencmd: not found
I am running HA OS 10.3 on my Pi 4.
Edit:
I was able to get the version by running the following command on the host (SSH using port 22222):
docker container exec homeassistant vcgencmd bootloader_version
It seems that the older recommendations to run the following are no longer valid:
docker container exec homeassistant /opt/vc/bin/vcgencmd bootloader_version
because vcgencmd
now resides at /usr/bin/vcgencmd
Nope. Running latest HA OS an a Pi 4 only this is working:
docker container exec homeassistant /opt/vc/bin/vcgencmd bootloader_version
Summary: “your mileage may vary”, just try few combinations and see what works.
I agree that YMMV is valid here, but moving forward with new versions of the OS, I think that what I said stands:
What happened with vcgencmd? Since the last upgrade of Home Assistant (2024.2.0) I receive the following error message in the logbook:
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’
Has the location of vcgencmd changed again?
For me, the only command that works on a current HAOS on Pi4 is the following (on the port 22222 SSH):
docker container exec homeassistant /usr/bin/vcgencmd bootloader_version