1 1
jps

Problems with Thermal zone and DS18B20

Recommended Posts

Hi. Recently i upgraded to Armbian_5.65_Orangepilite_Debian_stretch_next_4.14.78 and i have two problems. I can not read the thermal zones properly with neither of those:

cat /sys/class/thermal/thermal_zone0/temp
cat /sys/devices/virtual/thermal/thermal_zone0/temp
cat /etc/armbianmonitor/datasources/soctemp

because i have results like "30371". But when the system starts the correct temperature is displayed:

Welcome to ARMBIAN 5.73 stable Debian GNU/Linux 9 (stretch) 4.19.20-sunxi
System load:   0.07 0.15 0.10   Up time:       10 min
Memory usage:  29 % of 493MB    IP:            192.168.1.46
CPU temp:      33°C
Usage of /:    10% of 15G

and with armbianmonitor too:

 

Time        CPU    load %cpu %sys %usr %nice %io %irq   CPU  C.St.

17:39:34: 1200MHz  0.06   3%   1%   1%   0%   0%   0% 34.6°C  0/15
17:39:39:  480MHz  0.06   1%   0%   0%   0%   0%   0% 31.5°C  0/15
17:39:45:  480MHz  0.13   4%   3%   0%   0%   0%   0% 31.8°C  0/15

My second problem is that my DS18B20 sonda does not work anymore. In /etc/modules-load.d/modules.conf i have:

w1-sunxi
w1-gpio
w1-therm

but there is nothing in /sys/bus/w1/devices/
 

is there any changes in this new version? I check the forum but i does not found anything. Any iddeas?

 

Thanks in advance.

 

Share this post


Link to post
Share on other sites
10 minutes ago, jps said:

My second problem is that my DS18B20 sonda does not work anymore. In /etc/modules-load.d/modules.conf i have:

You should not place any W1 driver in /etc/modules-load.d/modules.conf ...

You should rely on DT overlays : https://docs.armbian.com/User-Guide_Allwinner_overlays/

... and more specially to H3 W1-Bus overlay parameters : https://github.com/armbian/sunxi-DT-overlays/blob/master/sun8i-h3/README.sun8i-h3-overlays#L231,L250

 

Share this post


Link to post
Share on other sites
16 hours ago, martinayotte said:

You should not place any W1 driver in /etc/modules-load.d/modules.conf ...

You should rely on DT overlays : https://docs.armbian.com/User-Guide_Allwinner_overlays/

... and more specially to H3 W1-Bus overlay parameters : https://github.com/armbian/sunxi-DT-overlays/blob/master/sun8i-h3/README.sun8i-h3-overlays#L231,L250

 

Yes. Thank you martinayotte. If sombody needs that, i just have to add this lines to '/boot/armbianEnv.txt'

overlays=w1-gpio
param_w1_pin=PA20
param_w1_pin_int_pullup=1

and works like a charm! Thank you very much.

Share this post


Link to post
Share on other sites

And, what about the strange readings in thermal_zones. My cpu give me 22.6ºC with armbianmonitor, but reading directly in any of the thermal zones with cat i have readings like '40898'.

 

What has changed from previous versions?

 

Than you in advance.

Share this post


Link to post
Share on other sites

wow. I just realized that the CPU temperature in armbianmonitor is the same that the one i have reading the DS18B20 sonda ....

 

What is going on??

 

Share this post


Link to post
Share on other sites

DS18B20 can't work for a long time 

 

<code>

yaofei@opione2:~$ dmesg | grep w1
[    8.227238] w1_master_driver w1_bus_master1: w1_search: max_slave_count 64 reached, will continue next search.
[   55.575200] w1_master_driver w1_bus_master1: Attaching one wire slave 00.800000000000 crc 8c
[   55.579572] w1_master_driver w1_bus_master1: Family 0 for 00.800000000000.8c is not registered.
[  114.185133] w1_master_driver w1_bus_master1: Attaching one wire slave 00.400000000000 crc 46
[  114.189866] w1_master_driver w1_bus_master1: Family 0 for 00.400000000000.46 is not registered.
yaofei@opione2:~$ uname -a
Linux opione2 4.19.20-sunxi #5.75 SMP Sat Feb 9 19:02:47 CET 2019 armv7l armv7l armv7l GNU/Linux
yaofei@opione2:~$ ls /sys/bus/w1/
devices/           drivers/           drivers_autoprobe  drivers_probe      uevent
yaofei@opione2:~$ ls /sys/bus/w1/devices/
00-400000000000  00-800000000000  w1_bus_master1
yaofei@opione2:~$

</code>

 

my armbianEnv.txt:

 

verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=fc233414-8f78-4254-8d95-049158fc59da
rootfstype=ext4
overlays=uart1 usbhost0 w1-gpio #pps-gpio
param_w1_pin=PA10
param_w1_pin_int_pullup=1

 

an OrangePi One 

 

yaofeideMac-Pro:~ yaofei$ ssh opione2.local
  ___                               ____  _    ___
 / _ \ _ __ __ _ _ __   __ _  ___  |  _ \(_)  / _ \ _ __   ___
| | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | | | | | '_ \ / _ \
| |_| | | | (_| | | | | (_| |  __/ |  __/| | | |_| | | | |  __/
 \___/|_|  \__,_|_| |_|\__, |\___| |_|   |_|  \___/|_| |_|\___|
                       |___/

Welcome to ARMBIAN 5.73 stable Ubuntu 18.04.2 LTS 4.19.20-sunxi
System load:   1.18 0.26 0.09  	Up time:       0 min
Memory usage:  23 % of 493MB  	IP:            192.168.20.60
CPU temp:      46°C
Usage of /:    51% of 7.2G

Last login: Mon Mar  4 19:17:02 2019 from 192.168.20.40

 

Share this post


Link to post
Share on other sites
8 minutes ago, mantouboji said:

DS18B20 can't work for a long time

what is the MIN_SPEED in /etc/default/cpufrequtils ? If it is too low, W1 may get into trouble, I´m usually set the MIN_SPEED to 480000 ...

Share this post


Link to post
Share on other sites
2 minutes ago, martinayotte said:

what is the MIN_SPEED in /etc/default/cpufrequtils ? If it is too low, W1 may get into trouble, I´m usually set the MIN_SPEED to 480000 ...

 

see:

 

yaofei@opione2:~$ cat /etc/default/cpufrequtils
# WARNING: this file will be replaced on board support package (linux-root-...) upgrade
ENABLE=true
MIN_SPEED=408000
MAX_SPEED=1200000
GOVERNOR=ondemand
 

Share this post


Link to post
Share on other sites
15 minutes ago, mantouboji said:

My OrangePi One and wires. Is it PA20 ?

As said in the other thread : In /boot/armbianEnv.txt, along with adding w1-gpio to overlays, did you provided W1 parameters, param_w1_pin and param_w1_pin_int_pullup ?

Share this post


Link to post
Share on other sites

mantouboji,

  • you can give this command: cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins, and cat /sys/kernel/debug/pinctrl/pinctrl-maps
  • you should have the sensor connected to pin 37 and the PA20 in your armbianEnv.txt: instead there seems to be PA10.
  • can you put a photo of your sensor and how it is connected?

ps: the dupont connector in the photo at pin 37 does not appear to be securely attached:)

Share this post


Link to post
Share on other sites

I chang to use PIN 4 to get 5V and PIN6 to get GND, it works. Thx .

 

But only works for a short time, now :

 

yaofei@opione2:~$ journalctl -fn | grep w1
3月 06 11:16:48 opione2 hass[808]: 2019-03-06 11:16:48 ERROR (SyncWorker_1) [homeassistant.components.sensor.onewire] No onewire sensor found. Check if dtoverlay=w1-gpio is in your /boot/config.txt. Check the mount_dir parameter if it's defined
3月 06 11:17:34 opione2 kernel: w1_master_driver w1_bus_master1: Attaching one wire slave 00.800000000000 crc 8c
3月 06 11:17:34 opione2 kernel: w1_master_driver w1_bus_master1: Family 0 for 00.800000000000.8c is not registered.
3月 06 11:18:32 opione2 kernel: w1_master_driver w1_bus_master1: Attaching one wire slave 00.400000000000 crc 46
3月 06 11:18:32 opione2 kernel: w1_master_driver w1_bus_master1: Family 0 for 00.400000000000.46 is not registered.

 

Share this post


Link to post
Share on other sites

Now I use another OrangePi One board to do some testing.

 

It runs an old version of Armbian 

  ___                               ____  _    ___
 / _ \ _ __ __ _ _ __   __ _  ___  |  _ \(_)  / _ \ _ __   ___
| | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | | | | | '_ \ / _ \
| |_| | | | (_| | | | | (_| |  __/ |  __/| | | |_| | | | |  __/
 \___/|_|  \__,_|_| |_|\__, |\___| |_|   |_|  \___/|_| |_|\___|
                       |___/

Welcome to ARMBIAN 5.65 user-built Ubuntu 18.04.1 LTS 4.14.81-sunxi
System load:   0.86 0.21 0.07  	Up time:       0 min
Memory usage:  12 % of 493MB  	IP:            192.168.20.113
CPU temp:      33°C
Usage of /:    20% of 7.3G

I connect 3 18B20 heads to PA20. 

It can't  find any of them.

 

so I upgrade to the latest version

Welcome to ARMBIAN 5.73 stable Ubuntu 18.04.2 LTS 4.19.20-sunxi

 

Now it works.

 

So there must be some fix after 4.14.81 .

 

My configuration files are:

/boot/armbianEnv.txt

verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=8d2923b7-39e0-426b-82b6-476bc5af0db2
rootfstype=ext4
# UART1 for GPS
# PPS for GPS
# w1-gpio for DS18B20
overlays=w1-gpio pps-gpio uart1 usbhost0
param_w1_pin=PA20
param_pps_pin=PA7
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

the /etc/default/cpufrequtils file is the default one.

 

# WARNING: this file will be replaced on board support package (linux-root-...) upgrade
ENABLE=true
MIN_SPEED=408000
MAX_SPEED=1200000
GOVERNOR=ondemand

 The pull-up resistor must be 4.7K.

Share this post


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