1-Wire sensors on Home automation HAT V4

jhp

New member
Hello everyone,

I recently acquired the latest version of the Home Automation HAT version 4. I started with a clean installation on a Raspberry Pi 4B, performed all updates, installed and compiled ioplus-rpi, and updated the HAT firmware to version 1.32. Initially, the HAT was detected as hardware version 3 with firmware 1.12.

I connected a 1-wire temperature sensor DS18B20 and successfully scanned the bus with the command: `ioplus 0 owbscan`. However, when I tried to determine the number of connected sensors using the command `ioplus 0 owbcntrd`, I consistently get a reading of 0. I have tried different HAT boards, other Raspberry Pis, and different sensors, but I still can't resolve this issue.

Does anyone have experience with a similar problem or any tips on how I can get the system to read temperatures from the sensors? Any suggestions or advice would be greatly appreciated. Thanks in advance for your help!
 

jhp

New member
I have also tried several DS18B20 temperature sensors, both original DALLAS and its copies. I experimented with both 2-wire and 3-wire connections. Additionally, I tested the DHT-11 sensor. I even attempted using Python for installation and communication, but the outcome remains consistent: the scan is OK, but the sensor count is always 0 (Python shows 1 on scan but 0 for sensor count). Does anyone have any ideas on what else I could try?
 

jhp

New member
I turned off the Raspberry Pi and disconnected it from the power supply. After booting up and logging in, I entered: ioplus 0 owbcntrd, but it still returns 0. Another interesting point is that after each restart, the result of the command ioplus 0 owbscan is: Segmentation fault. Subsequent repetitions of the command result in: OK. I have three HATs and they all behave the same way. I've tried Raspberry Pi models 3B 2GB and 4B 4GB, running the OS BookWorm. I've tested the power supply separately through USB-C and the header on the HAT, ensuring each source maintained a voltage of 5V.
 

alexburcea

Moderator
Staff member
Hi,
It looks like the last firmware changes affect the one-wire bus functionality, give me some time to dig into it.
 

alexburcea

Moderator
Staff member
Hi,

A new firmware version for the Home Automation card has been released. Please update the firmware on the card and let me know how the one-wire bus sensor is working. Firmware update instructions here.

Alex.
 

jhp

New member
Dear alexburcea,

Thank you very much for your prompt resolution of the issue. I have installed the new firmware on several HAT v4 units, and all of them now correctly read the temperature data from the 1-wire bus. However, a persistent issue remains where, after restarting the Raspberry Pi and executing the ioplus command, a Segmentation Fault occurs, which complicates the practical use of the ioplus program. It may be related to some settings, but it occurs on both the RPi3 and RPi4. Could you please confirm if this is an expected feature, or offer any advice on where the problem might lie?
 

alexburcea

Moderator
Staff member
Please let me know which command you run (full string) that returns a segmentation fault.
I am sure we can fix it.
 

acalleu

New member
Hi,

A new firmware version for the Home Automation card has been released. Please update the firmware on the card and let me know how the one-wire bus sensor is working. Firmware update instructions here.

Alex.
Hi Alex:
I'm using The Home Automation Card. I have a problem reading thermometers (DS18B20) through a 1-wire port. They stopped working a couple of months ago.
The HAT can't identify the thermometers:
~/ioplus-rpi/update $ ioplus 0 owbtrd 1
Invalid channel number, only 0 sensors connected!


According to the system, the Firmware version is 01.29:
~ $ ioplus 0 board
Hardware 04.00, Firmware 01.29, CPU temperature 35 C, voltage 3.32 V


I tried to do the Firmware update that you suggested, but I couldn't:
~ $ cd ioplus-rpi/update/
~/ioplus-rpi/update $ dir
fwrevhist.md README.md rockupd update update64
~/ioplus-rpi/update $ ./update 0
bash: ./update: cannot execute: required file not found


Do you have any suggestions about how to solve the issues with it?

Thanks for your help.

Andres
 

ipa

New member
I am using home automation card as well. Card did not recognize any 1-wire sensors at first, so I did firmware upgrade with update64.
This is where I am now:
$ ioplus 0 board
Hardware 04.00, Firmware 01.34, CPU temperature 30 C, voltage 3.30 V

After FW upgrade I got some readings but there are lots of strange anomalies like ioplus was unable to read sensor id - output was just 0x0 and/or temperature started to increase with 5 degree increments until it reached the actual temperature and in some readings it jumped 5 degrees higher than the actual temperature.

I have 2 sensors at room temperature, taped together, attached to board 0.
I am using this test script:
#!/bin/bash

# scan until 2 attached sensors are found
until [ $(ioplus 0 owbcntrd) -eq 2 ];do ioplus 0 owbscan;sleep 1;done

# read id and value in a loop from 2 sensors
while true; do

date
ioplus 0 owbidrd 1
ioplus 0 owbidrd 2
ioplus 0 owbtrd 1
ioplus 0 owbtrd 2
sleep 1

done

test script output:
Tue Feb 11 11:59:58 AM EET 2025
0x0
0xaf0e231445014128
5.00 C
5.00 C

Tue Feb 11 11:59:59 AM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
10.00 C
10.00 C

Tue Feb 11 12:00:00 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
10.00 C
10.00 C

Tue Feb 11 12:00:01 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
15.00 C
15.00 C

Tue Feb 11 12:00:02 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
15.00 C
15.00 C

Tue Feb 11 12:00:03 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
20.00 C
20.00 C

Tue Feb 11 12:00:04 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
20.00 C
20.00 C

Tue Feb 11 12:00:05 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.50 C
22.50 C
Tue Feb 11 12:00:06 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.50 C
22.50 C
Tue Feb 11 12:00:07 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.50 C
27.50 C
Tue Feb 11 12:00:08 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.50 C
27.50 C

After 10-20 readouts its all good and temperature readings of two sensors stabilize on generally the same temperature (as they should as they are taped together)

Some time later when I checked, one sensor was lost:
$ ioplus 0 owbcntrd
1

I started the read test again which started with OK as it was scanned:
OK
Tue Feb 11 12:44:44 PM EET 2025
0x0
0xaf0e231445014128
22.50 C
0.00 C
Tue Feb 11 12:44:45 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.50 C
0.00 C
Tue Feb 11 12:44:46 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.43 C
5.00 C
Tue Feb 11 12:44:47 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.43 C
5.00 C
Tue Feb 11 12:44:48 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.37 C
10.00 C
Tue Feb 11 12:44:49 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.37 C
10.00 C
Tue Feb 11 12:44:50 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.43 C
15.00 C
Tue Feb 11 12:44:51 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.43 C
15.00 C
Tue Feb 11 12:44:52 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.37 C
20.00 C
Tue Feb 11 12:44:53 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.37 C
20.00 C
Tue Feb 11 12:44:54 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.43 C
22.50 C
Tue Feb 11 12:44:55 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.43 C
22.50 C
Tue Feb 11 12:44:57 PM EET 2025
0x3d0e231437e12e28
0xaf0e231445014128
22.43 C
23.50 C

What could be the issue with 5 degree increments and incorrect ID readouts?

If I am not using "sleep 1" command after each "while" cycle in my test script, I am getting readouts for few seconds and then just following errors:
IO-PLUS id 0 not detected
IO-PLUS id 0 not detected
IO-PLUS id 0 not detected
IO-PLUS id 0 not detected
Is there some issue with the frequency of reading the values with ioplus?

Thank you!
 

alexburcea

Moderator
Staff member
Hi,

Because we experienced errors in readings, we implemented this filter that does not let the reported temperature to change more than 5 degrees per read.
I do not know why your sensor is lost, usually when it does not respond to the query. I will make a setup and run a stress test.
The scanning sensor procedure prevents communication with the card so you have to wait to be finished until you communicate again. We think that will not be a problem since the scanning procedure is done once at power-up and then very rarely when you add or remove a sensor.
 

ipa

New member
Thank you for the information.
So, this filter has to store previous reading somewhere and if previous/initial reading is 0 then it takes ~5 readings to go to 23 degrees?
It seems to me that this filter feature just makes harder to understand what are the correct readings.
Its would be easy to drop results which result is 0 as the temperature is never exactly 0 and it is also quite easy to take, lets say, 30 readings, sort them according to the value, drop first and last 10 and take average of the rest.

Anyway, I replaced both sensors and changed board ID to 1 but nothing changed...
This is the result of reading 100 times id and value from 2 sensors with 1 second sleep after each batch of 4 readouts:
1 0x0
89 0x4c0e231446881d28
90 0x840e23144b920728
89 21.75 C
89 21.87 C
1 Fail to read one wire bus info!
41 IO-PLUS id 1 not detected
after the test, board was gone
$ ioplus -list
0 board(s) detected

~5 minutes later, board was again detected so I ran another test of reading 100 times id and value from 2 sensors:
1 0x0
21 0x4c0e231446881d28
22 0x840e23144b920728
2 20.00 C
19 21.87 C
19 22.00 C
2 5.00 C
1 Fail to read one wire bus info!
8 Invalid channel number, only 0 sensors connected!
305 IO-PLUS id 1 not detected

.... and again, board was gone after that
$ ioplus -list
0 board(s) detected


I want to note for the reference, that I have building automation board attached to the same raspberry, which does not have any issues with same 1-wire sensors. (megabas 0 board: Firmware ver 02.03, CPU temperature 29 C, Power source 3.94 V, Raspberry 5.11 V)
Reading 100 times id and value from 2 sensors is working perfectly and also without the "sleep 1" between the readings.
100 0x4e0e231450588928
100 0x690e23141c457828
39 21.81 C
61 21.87 C
100 21.93 C


Any help is appreciated and if I can help to debug something, please let me know.
 

alexburcea

Moderator
Staff member
The main difference between 1-Wire implementations between the 2 cards is that the Building automation uses the USART port and Home automation emulates the bitstream software. Give me a few days to finish my current task and I will dive into it. You are right the sample filtration algorithm is bad and I will change it asap.
Could you tell me if the card hung only when you initiate the search procedure or just read the sensors?
Alex.
 

ipa

New member
Loosing sensors or entire board happens during sensor reading.
This is the last output from continuous reading of 2 sensor id-s and values with one second sleep between each batch of 4 readouts.
0x0
0x840e23144b920728
5.00 C
5.00 C
0x4c0e231446881d28
0x840e23144b920728
5.00 C
5.00 C
0x4c0e231446881d28
0x840e23144b920728
10.00 C
10.00 C
0x4c0e231446881d28
0x840e23144b920728
10.00 C
10.00 C
0x4c0e231446881d28
0x840e23144b920728
15.00 C
15.00 C
0x4c0e231446881d28
0x840e23144b920728
15.00 C
15.00 C
IO-PLUS id 1 not detected
IO-PLUS id 1 not detected
IO-PLUS id 1 not detected
IO-PLUS id 1 not detected
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
Invalid channel number, only 0 sensors connected!
0.00 C
Invalid channel number, only 1 sensors connected!
0x4c0e231446881d28
Invalid channel number, only 1 sensors connected!
5.00 C
Invalid channel number, only 1 sensors connected!
0x4c0e231446881d28
Invalid channel number, only 1 sensors connected!
5.00 C
Invalid channel number, only 1 sensors connected!
 

dwmacauley

New member
The main difference between 1-Wire implementations between the 2 cards is that the Building automation uses the USART port and Home automation emulates the bitstream software. Give me a few days to finish my current task and I will dive into it. You are right the sample filtration algorithm is bad and I will change it asap.
Could you tell me if the card hung only when you initiate the search procedure or just read the sensors?
Alex.
Hi. We are having similar issues with the sensors stop reporting. Removing and replacing power solves the issue. Any thought
Dan
 

dwmacauley

New member
Hi Dan,

We did not have the time to dig deeper but it's on our short list.

Alex.
Hi Alex,

Thanks for the quick response. Some additional information. The sensors work fine for a while and then stop responding. Reseting the Pi does not fix it but if we remove the power from the board the sensors start talking. We have seen this in two of our 10 units using the board.

Let me know if you need more information. We would be happy to help.
 
Top