Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2016-04-11 05:39:12

darren.macleod@internode.on.net
Member
Registered: 2016-04-09
Posts: 8

Reading 1-Wire temperature sensor in REX (via w1 kernel module)

I don't seem to be able to get the OW Temp sensor working.
if I log into the Pi, I can see the sensor however I get an error when trying to read the temperature

pi@raspberrypi:~ $ ls /sys/bus/w1/devices
10-000802e6f12a  w1_bus_master1
pi@raspberrypi:~ $ owread /10-000802e6f12a/temperature12
ServerRead: Data error on /10-000802e6f12a/temperature12
pi@raspberrypi:~ $

Offline

#2 2016-04-11 08:35:07

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: Reading 1-Wire temperature sensor in REX (via w1 kernel module)

Hello Darren,

did you install "owserver"? See OW Driver documentation and go through - hope you will find some valuable information for you.

If you have any further question, feel free to let us know.

Good luck, Tomas

Offline

#3 2016-04-11 16:47:17

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: Reading 1-Wire temperature sensor in REX (via w1 kernel module)

Hello again,

I asked my colleague about your OW issue and he advised to read the temperature this way:

owread /10.2af1e6020800/temperature12

(it is the ID you get by ls /.../w1/devices but written backwards by pairs)

For more information refer to Getting started with REX on Raspberry Pi - part 5.2.2 Software connection of the sensor

Have a nice day, Tomas

Last edited by jaroslav_sobota (2016-04-12 13:54:12)

Offline

#4 2016-04-11 23:57:21

darren.macleod@internode.on.net
Member
Registered: 2016-04-09
Posts: 8

Re: Reading 1-Wire temperature sensor in REX (via w1 kernel module)

Hi Tomas,
I have tried the setup on "OW Driver Documentation", however when I edit the owfs.conf to include "i2c=ALL:ALL" I get no response to the owdir command. if I change this to server: w1 as per the "getting started with Rex on Raspberry Pi" after a while I get the following response from the owdir command

/bus.1
/bus.0
/uncached
/settings
/system
/statistics
/structure

as you can see there is no ow device detected here, but if do a ls /sys/bus/w1/devices command I get the following.

pi@raspberrypi:~ $ ls /sys/bus/w1/devices
10-000802e6f12a  w1_bus_master1

so I am not sure if this is working or not.
I have followed the setup step by step in the "Getting started with Rex on Raspberry Pi" chapter 5
I have tried combinations of "backwards by pairs" syntax

pi@raspberrypi:~ $  ls /sys/bus/w1/devices
10-000802e6f12a  w1_bus_master1
pi@raspberrypi:~ $ owread 10-000802e6f12a
ServerRead: Data error on 10-000802e6f12a
pi@raspberrypi:~ $ owread 10.000802e6f12a
ServerRead: Data error on 10.000802e6f12a
pi@raspberrypi:~ $ owread 10-2af1e6020800
ServerRead: Data error on 10-2af1e6020800
pi@raspberrypi:~ $ owread 10.2af1e6020800
ServerRead: Data error on 10.2af1e6020800
pi@raspberrypi:~ $

still no luck

Offline

#5 2016-04-12 14:08:21

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: Reading 1-Wire temperature sensor in REX (via w1 kernel module)

Hi Darren,
I updated the previous post with correct command. From the command line, you can read the temperature via owserver using

owread /10.2af1e6020800/temperature12

or via w1 kernel module

cat /sys/bus/w1/devices/10-000802e6f12a/w1_slave

In the REX control algorithm, you can only read data via the owserver, therefore you have to use /10.2af1e6020800/temperature12 in the 1-Wire driver configuration.

The owdir command does not work with w1 kernel module in the current version of Raspbian and this is not something we can influence. The command "freezes" for couple minutes and then returns no sensors. You can either compile newest version of owserver (OWFS), where this bug is fixed or read the device ID from /sys/bus/w1/devices/. In the latter case, NOTE the reversed order of bytes in the ID when using the two approaches to read the temperature.

Hope this helps!

Offline

#6 2016-04-13 09:04:32

darren.macleod@internode.on.net
Member
Registered: 2016-04-09
Posts: 8

Re: Reading 1-Wire temperature sensor in REX (via w1 kernel module)

Thanks,
I am now starting to suspect a faulty sensor as I am now getting results with both methods, however it is showing 85 degrees for both?
if I hold my finger over the sensor it still stays at 85

pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@raspberrypi:~ $ cat /sys/bus/w1/devices/10-000802e6f12a/w1_slave
aa 00 4b 46 ff ff 0c 10 87 : crc=87 YES
aa 00 4b 46 ff ff 0c 10 87 t=85000

Offline

#7 2016-04-13 12:24:44

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: Reading 1-Wire temperature sensor in REX (via w1 kernel module)

Hi Darren,
is your sensor powered and is it wired up correctly? 85 degrees is the startup value of the sensor, which in your case indicates that no temperature conversion was performed yet (typically due to insufficient power).

So far I was not successful setting up 1-Wire parasitic mode on the GPIO pins of Raspberry Pi.

If you have your sensor powered and still get the 85 deg reading then I would say the sensor is faulty.

Offline

#8 2016-04-14 23:52:46

darren.macleod@internode.on.net
Member
Registered: 2016-04-09
Posts: 8

Re: Reading 1-Wire temperature sensor in REX (via w1 kernel module)

It looks like the sensor is working, however only using kernel mode. The sensor I am using is a DS18S20-PAR which only supports parasitic power. I have edited the boot config to include pullup=yes, which has now provided consistently reliable readings in w1 kernel mode. When I try this using the owserver and I get inconsistent, unusable results.
jaroslav_sobota, I am wondering if this is similar to the results that you have had using parasitic power?
Does the owserver have compatibility issues with this model sensor?



pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
ServerRead: Data error on /10.2af1e6020800/temperature12
pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
ServerRead: Data error on /10.2af1e6020800/temperature12
pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
ServerRead: Data error on /10.2af1e6020800/temperature12
pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
ServerRead: Data error on /10.2af1e6020800/temperature12
pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
          85pi@rasp
pi@raspberrypi:~ $ owread /10.2af1e6020800/temperature12
ServerRead: Data error on /10.2af1e6020800/temperature12
pi@raspberrypi:~ $ cat /sys/bus/w1/devices/10-000802e6f12a/w1_slave
2f 00 4b 46 ff ff 02 10 9f : crc=9f YES
2f 00 4b 46 ff ff 02 10 9f t=23625
pi@raspberrypi:~ $ cat /sys/bus/w1/devices/10-000802e6f12a/w1_slave
2f 00 4b 46 ff ff 02 10 9f : crc=9f YES
2f 00 4b 46 ff ff 02 10 9f t=23625
pi@raspberrypi:~ $ cat /sys/bus/w1/devices/10-000802e6f12a/w1_slave
2f 00 4b 46 ff ff 02 10 9f : crc=9f YES
2f 00 4b 46 ff ff 02 10 9f t=23625
pi@raspberrypi:~ $ cat /sys/bus/w1/devices/10-000802e6f12a/w1_slave
36 00 4b 46 ff ff 10 10 df : crc=df YES
36 00 4b 46 ff ff 10 10 df t=26750
pi@raspberrypi:~ $ cat /sys/bus/w1/devices/10-000802e6f12a/w1_slave
39 00 4b 46 ff ff 08 10 bf : crc=bf YES
39 00 4b 46 ff ff 08 10 bf t=28250
pi@raspberrypi:~ $ cat /sys/bus/w1/devices/10-000802e6f12a/w1_slave
39 00 4b 46 ff ff 07 10 a7 : crc=a7 YES
39 00 4b 46 ff ff 07 10 a7 t=28312
pi@raspberrypi:~ $ cat /sys/bus/w1/devices/10-000802e6f12a/w1_slave
37 00 4b 46 ff ff 01 10 b4 : crc=b4 YES
37 00 4b 46 ff ff 01 10 b4 t=27687

Offline

#9 2016-04-15 16:32:22

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: Reading 1-Wire temperature sensor in REX (via w1 kernel module)

Yes, these were the conclusions I ended up with. I recommend

  • switching to powered DS18B20, or

  • switching to dedicated 1-Wire master (I2C or USB) if you insist on using parasitic power

If neither of these is an option for you, you can write e.g. a Python script which will parse the /sys/bus/w1/... files and store the temperatures in files on a disk (preferably ramdisk/tmpfs). These can be read into REX algorithm using SILO blocks.

Hope this helps!

Offline

#10 2016-04-20 10:35:05

darren.macleod@internode.on.net
Member
Registered: 2016-04-09
Posts: 8

Re: Reading 1-Wire temperature sensor in REX (via w1 kernel module)

I just received the non parasitic version of the same sensor today.
After swapping this out and updating the serial number, it now works flawlessly.
Thank you so much for your expertise and advise in getting this resolved, I really appreciate it

Darren

Offline

Board footer

Powered by FluxBB