树莓派使用Ubuntu官方的Ubuntu server 18会导致vcgencmd command not found,按照下面的步骤走即可解决
首先用su命令进入root用户模式下,接着执行
cd /tmp
git clone https://github.com/raspberrypi/userland.git
cd userland
如果你使用的是32位OS,输入
./buildme
如果是64位OS,则输入
./buildme --aarch64
接着,在/opt/vc/bin目录下就有vcgencmd了。直接运行,可能导致报错:
./vcgencmd: error while loading shared libraries: libvchiq_arm.so: cannot open shared object file: No such file or directory
在root用户下执行:
echo "/opt/vc/lib" >> /etc/ld.so.conf
ldconfig
即可。
如果需要,可以将/opt/vc/bin加入到环境变量PATH内。
ubuntu@ubuntu:/opt/vc/bin$ ./vcgencmd
Usage: vcgencmd [-t] command
Send a command to the VideoCore and print the result.
-t Time how long the command takes to complete
-h, --help Show this information
Use the command 'vcgencmd commands' to get a list of available commands
Exit status:
0 command completed successfully
-1 problem with VCHI
-2 VideoCore returned an errors
按照您的方法执行了一下,出现如上错误,执行指令 vcgencmd commands
也出现了“VCHI initialization failed"。
请问您晓得是啷个回事吗?