![]() I used psutil and netifaces to get my data. Getting the data was done in another way. Temp = subprocess.check_output(cmd, shell = True )īelow code was modified accordingly to remove 'b' character from the OLED display. The following lines will be added to show CPU temperature on OLED display module: cmd = "vcgencmd measure_temp |cut -f 2 -d '='" This code is perfect on boot when you want to find your Raspberry Pi's IP address for SSH or VNC. Will be replaced by the following line: cmd = "hostname -I |cut -f 2 -d ' '" It will be slightly modified in order to get rid of the b-prefix and add CPU temperature of Raspberry Pi 4 Model B as well. Also, b-prefix in front of each strings can be seen. In this folder you should find example script:īy default it shows memory usage, disk usage, CPU load and ip address. Navigate into the examples directory: cd examples This is the default hex address for this type of device. It showed the device had been detected with an address of 0x3c. On the older Raspberry Pi type the following command: sudo i2cdetect -y 0 To find a list of the devices connected to the I2C bus on the Raspberry Pi you can use the following command: sudo i2cdetect -y 1 The following libraries may already be installed but run these commands anyway to make sure : sudo apt-get install python-smbus After this, we need to reboot Raspberry Pi by typing below command:. ![]() ![]() After this, we need to select Yes and press enter and then ok.After this, we need to select I2C option.You can do this within the raspi-config tool on the command line by running: sudo raspi-config The I2C interface is disabled by default so you need to enable it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |