How can I change the GPIO port of cpu temperature sensor on OrangePI PC

Recommended Posts

I need to change this port, couse it is in conflict with DS18B20 temperature sensor.

I'm connected sensor on pin 37 (PA=20) with:

Linux orangepipc 5.3.13-sunxi #19.11.3 SMP Fri Dec 6 14:09:51 CET 2019 armv7l GNU/Linux

Linux orangepipc 5.3.13-sunxi #19.11.3 SMP Fri Dec 6 14:09:51 CET 2019 armv7l GNU/Linux

but in this case I have a conflict when I type:

root@orangepipc:~# armbianmonitor -m
Stop monitoring using [ctrl]-[c]
Time        CPU    load %cpu %sys %usr %nice %io %irq   CPU  C.St.

05:29:18: 1368MHz  0.49  27%   8%  13%   0%   4%   0% 21.5°C  0/8
05:29:23: 1368MHz  0.45   7%   3%   3%   0%   0%   0% 21.5°C  0/8
05:29:29: 1368MHz  0.38   6%   2%   3%   0%   0%   0% 21.5°C  0/8
05:29:35: 1368MHz  0.43   7%   3%   3%   0%   0%   0% 21.5°C  0/8^C

It is exchanged (overwriten) the cpu temp sensor.

How I did this?

I edited the file:

root@orangepipc:~# cat /boot/armbianEnv.txt
overlays=i2c0 i2c1 w1-gpio

and add line: param_w1_pin=PA20 to force PIN 37.

Why I'm doing this?

On armbian with kernel what will be my already used backup system I'm already used pin 37 (PA20)

Because if I need to go back to kernel version (I won't be physically home) I can ask just to change the backup SD card and not even cabel from PIN.

On kernel I have not this conflict.


I know that correct wiring on Kernel would be PIN 12 (PD14) without conflict with cpu sensor, but in that case I can not use on kernel

I tried same to put those two lins in:

overlays=i2c0 i2c1 w1-gpio

to force it but it do not "see" because result give next line:

root@orangepipc:~# dmesg|grep w1
[    9.913536] W1_SUNXI: Added w1-gpio on GPIO-20

on kernel


How can I solve this conflict?




Interesting is that command htop showing me the correct temperature of cpu sensor, but when I login to ssh it showing me on welcome screen temperature of DS18B20 sensor.

Link to post
Share on other sites

Armbian is a community driven open source project. Do you like to contribute your code?

7 minutes ago, martinayotte said:

BTW, there is no "overlays" in kernel 3.x ...

Thx for replay..

Yes I realised, that worked in that way that I enterd next values in file:

cat /etc/modules

I'm thinking is it posible to change/edit in the welcome screen and armbianmonitor -m the pointer to the cpu sensor?
Because htop showing the right value.

Link to post
Share on other sites

Just now, Pol Isidor said:

What is the meaning?

This is CPU temp sensor. 57027 means 57.027 Celsius.


So, maybe it is possible to change that symbolic link to another readout, the one from DS18B20 driver ... Although I didn't try it out, a script that would translate DS18B20 result found here :

cat /sys/bus/w1/devices/28-000003ebdd28/w1_slave 
56 01 4b 46 7f ff 0a 10 d1 : crc=d1 YES
56 01 4b 46 7f ff 0a 10 d1 t=21375

The 21375 is ambient temp 21.375 Celsius ...

Link to post
Share on other sites

20 hours ago, Pol Isidor said:

Yes but how to change in welcome screen for example to how me the real cpu temp

You can edit the script /etc/update-motd.d/30-armbian-sysinfo and make sure that getboardtemp() function is always use the /sys/devices/virtual/thermal/thermal_zone0/temp ...

board_temp=$(awk '{printf("%d",$1/1000)}' < /sys/devices/virtual/thermal/thermal_zone0/temp)


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


1 1