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
verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=303f1c61-31c2-4d19-b229-300667548666
rootfstype=ext4
overlays=i2c0 i2c1 w1-gpio
param_w1_pin=PA20
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
root@orangepipc:~# 

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

Why I'm doing this?

On armbian with kernel v3.xxx 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 v3.xxx (I won't be physically home) I can ask just to change the backup SD card and not even cabel from PIN.

On kernel v3.xxx I have not this conflict.

 

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

I tried same to put those two lins in:

/boot/armbianEnv.txt
overlays=i2c0 i2c1 w1-gpio
param_w1_pin=PA20

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 v3.xxx

 

How can I solve this conflict?

Thx

 

EDIT:

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
w1-sunxi
w1-gpio
w1-therm

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.

Guest
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.

Loading...
 Share

1 1