sim_tcr
Posts: 326
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
Contact: Website

"vcgencmd measure_temp" command failing

Sun Feb 17, 2013 2:37 pm

I have performed a sudo apt-get update and sudo apt-get upgrade today. After that "vcgencmd measure_temp" is failing.

Code: Select all

[email protected] ~ $ vcgencmd measure_temp
vchiq_lib: Incompatible VCHIQ library - driver version 2 (min 2), library version 6 (min 3)
VCHI initialization failed
Also tried, /opt/vc/bin/vcgencmd measure_temp same error.
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Raspberry Pi 2 x 2, Transcend 32GB Class 10, Transcend 16GB Class 10, Transcend 8GB Class 4, Custom 12V 1.5A (stepped down to 5.5V)

Yoda007
Posts: 44
Joined: Mon Jan 23, 2012 6:05 pm

Re: "vcgencmd measure_temp" command failing

Sun Feb 17, 2013 2:46 pm

This happened to me too, I rebooted the pi and now it works - i think the updates had something to do with it.


Offtopic:
How do I make the temperature command work for me in php script using exec() ? I always get VCHI initialization failed error. When i run the script in terminal it works: http://yoda007.dyndns.org

sim_tcr
Posts: 326
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
Contact: Website

Re: "vcgencmd measure_temp" command failing

Sun Feb 17, 2013 2:59 pm

Yoda007 wrote:This happened to me too, I rebooted the pi and now it works - i think the updates had something to do with it.
Is there any way to fix this without rebooting? Will any service restart will fix it?
Yoda007 wrote: Offtopic:
How do I make the temperature command work for me in php script using exec() ? I always get VCHI initialization failed error. When i run the script in terminal it works: http://yoda007.dyndns.org
I had this same issue when I initially set up my web page. It got resolved after I did a firmware upgrade.
http://raspisimon.no-ip.org/firmware.php
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Raspberry Pi 2 x 2, Transcend 32GB Class 10, Transcend 16GB Class 10, Transcend 8GB Class 4, Custom 12V 1.5A (stepped down to 5.5V)

User avatar
jojopi
Posts: 3079
Joined: Tue Oct 11, 2011 8:38 pm

Re: "vcgencmd measure_temp" command failing

Sun Feb 17, 2013 7:24 pm

sim_tcr wrote:Is there any way to fix this without rebooting? Will any service restart will fix it?
It is caused by the running firmware not matching the vcgencmd binary or libraries. You cannot run the new firmware without rebooting. You could possibly downgrade the libraspberrypi-bin and libraspberrypi0 packages, to get the old matching vcgencmd back.

Have you tried using "cat /sys/class/thermal/thermal_zone0/temp" instead?

k6rtm
Posts: 16
Joined: Thu Sep 27, 2012 8:50 pm

Re: "vcgencmd measure_temp" command failing

Sun Mar 03, 2013 1:10 am

I wish it was that simple --

for me, it works on one account (pi), but not on another (one I created).

from the pi account,

/opt/vc/bin/vcgencmd measure_temp

gives me the cpu temperature, but from the other account, it gives me

VCHI initialization failed

sounds like a priv issue, which I'll dig into later

User avatar
jojopi
Posts: 3079
Joined: Tue Oct 11, 2011 8:38 pm

Re: "vcgencmd measure_temp" command failing

Sun Mar 03, 2013 1:16 am

You need to be in group "video" so that vcgencmd can access /dev/vchiq. But "cat /sys/class/thermal/thermal_zone0/temp" requires no privileges.

k6rtm
Posts: 16
Joined: Thu Sep 27, 2012 8:50 pm

Re: "vcgencmd measure_temp" command failing

Sun Mar 03, 2013 7:16 am

yup, doing id -a showed the differences, and sure enough, there are other posts indicating you need to be in video for vcgencmd to work.

all is now well (until the next surprise comes along).

sim_tcr
Posts: 326
Joined: Tue Nov 06, 2012 1:01 pm
Location: Bangalore
Contact: Website

Re: "vcgencmd measure_temp" command failing

Mon Mar 11, 2013 6:04 am

For those who face this issue, Correct way to fix "VCHI Initialization failed" error is add user www-data to video group. Below is the command,

Code: Select all

sudo usermod -G video www-data
And then restart web server. (if you are trying to display this error on a php based webpage.
http://raspisimon.no-ip.org
Raspberry Pi Model B x 2, Raspberry Pi 2 x 2, Transcend 32GB Class 10, Transcend 16GB Class 10, Transcend 8GB Class 4, Custom 12V 1.5A (stepped down to 5.5V)

moisesrobles
Posts: 1
Joined: Tue Nov 05, 2013 10:04 pm

Re: "vcgencmd measure_temp" command failing

Tue Nov 05, 2013 10:06 pm

jojopi wrote:You need to be in group "video" so that vcgencmd can access /dev/vchiq. But "cat /sys/class/thermal/thermal_zone0/temp" requires no privileges.
This is perfect to me, i'm using zabbix to monitore my RPI and i need to add zabbix user to video group.

linxi
Posts: 1
Joined: Sat Sep 24, 2016 2:58 pm

Re: "vcgencmd measure_temp" command failing

Sat Sep 24, 2016 3:43 pm

sim_tcr wrote:For those who face this issue, Correct way to fix "VCHI Initialization failed" error is add user www-data to video group. Below is the command,

Code: Select all

sudo usermod -G video www-data
And then restart web server. (if you are trying to display this error on a php based webpage.
Thanks. It works now.

cfranz1598
Posts: 2
Joined: Thu Oct 27, 2016 2:29 am

Re: "vcgencmd measure_temp" command failing

Sun May 21, 2017 9:19 pm

Did youall try "sudo /opt/vc/bin/vcgencmd measure_temp"

Worked fine for me.

Return to “General discussion”