Raspberry pi 2 Debian 8 “Jessie” loses DS2423 counter modules

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Raspberry pi 2 Debian 8 “Jessie” loses DS2423 counter modules

Willy Verbiest
Hi,
With the new Debian 8 “Jessie” distribution with owfs version 2,9p8-6 for the Raspberry pi I'm losing the DS2423 modules when reading there values.
The DS1820 temperature modules stay working fine.
When I start up the Raspberry pi I see all the modules (7 x DS1820, and 2 x DS2423) when I request the value of one of the counters with: cat 1D.53BE04000000/counters.A 
the DS2423 disconnect from the cable.
The same happens when I read the module with owread and ownet.
I did not have this error in the Debian 7 “Wheezy” distribution with owfs version 2.8p15.
I use a DS9490R USB adaptor to connect to the 1-wire cabeling.

To solve this problem I removed: owfs, owfs-common, owfs-fuse, owftpd, owhttpd, ow-shell.
And I installed owfs version 3.1p1 from the Debian 9 “Stretch” distribution downloading and installing: 
libow-3.1-1_3.1p1-2_armhf.deb
owfs-common_3.1p1-2_all.deb
owftpd_3.1p1-2_armhf.deb
owserver_3.1p1-2_armhf.deb
owfs_3.1p1-2_all.deb
owfs-fuse_3.1p1-2_armhf.deb
owhttpd_3.1p1-2_armhf.deb
ow-shell_3.1p1-2_armhf.deb

After rebooting I had the same error losing the DS2423 modules.
The hardware was not changed, putting the old SD card with Debian 7 Wheezy back in the Raspberry pi and the DS2423 modules works fine.

Is this a known problem?

Kind regards,
Willy


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: Raspberry pi 2 Debian 8 “Jessie” loses DS2423 counter modules

Jan Kandziora
Am 10.02.2016 um 15:41 schrieb Willy Verbiest:
> Hi,
> I use a DS9490R USB adaptor to connect to the 1-wire cabeling.
> With the new Debian 8 “Jessie” distribution with owfs version 2,9p8-6
>
Debian Jessie has Linux-3.16 and the default package configuration for
owfs makes it use the w1 kernel subsystem. Unfortunately, just in
Linux-3.16 something in the w1 kernel subsystem changed and made all
owfs versions before 3.1p1 stop working correctly. Random errors.

So either:

* upgrade to owfs-3.1p1
* downgrade to linux-3.15 or earlier
* unload/blacklist the w1 kernel host adapter module (ds2490 in your
  case) and change the owfs configuration to use -u instead of --w1.

>
> I did not have this error in the Debian 7 “Wheezy” distribution with owfs
> version 2.8p15.
>
Most likely because wheezy has Linux-3.2.


> And I installed owfs version 3.1p1 from the Debian 9 “Stretch” distribution
>
Ah, fine.


> After rebooting I had the same error losing the DS2423 modules.
> The hardware was not changed, putting the old SD card with Debian 7 Wheezy
> back in the Raspberry pi and the DS2423 modules works fine.
>
Please check whether the ds2423 kernel module is loaded. it may
interfere with owfs' own DS2423 transactions, even when --w1 is not used.

Then, please stop all the ow daemons (check with ps aux|grep ow) and
start owserver with debugging by hand:

# owserver --debug -u

Then, in another terminal, do a bus scan:

$ owget /uncached


> Is this a known problem?
>
It has been a while since I tested my DS2423 based modules but I just
checked with owfs-3.1p1 and -u and it works. Kernel modules
blacklisted+unloaded.

(But I remember someone having just the same problem a year ago or so.
It was related to the ds2423 kernel module IIRC.)

Kind regards

        Jan

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: Raspberry pi 2 Debian 8 “Jessie” loses DS2423 counter modules

Willy Verbiest

Hi,
On the Raspberry pi I'm running Debian 8 “Jessie”
It returs the kernel info:
# uname -a
Linux hc-wv-rapi3 4.1.17-v7+ #838 SMP Tue Feb 9 13:15:09 GMT 2016 armv7l GNU/Linux

I've checked my blacklist
# cat /etc/modprobe.d/owfs-common.conf
blacklist ds9490r
blacklist ds2490
blacklist wire

The loaded kernel modules:
# lsmod
Module                  Size  Used by
cfg80211              399468  0
rfkill                 16799  1 cfg80211
rtc_pcf2127             2721  0
sg                     18207  0
snd_bcm2835            19739  0
i2c_bcm2708             5062  0
snd_pcm                75040  1 snd_bcm2835
snd_timer              19138  1 snd_pcm
bcm2835_gpiomem         3023  0
snd                    52636  3 snd_bcm2835,snd_timer,snd_pcm
bcm2835_rng             1824  0
uio_pdrv_genirq         2986  0
uio                     8228  1 uio_pdrv_genirq
i2c_dev                 6108  0
fuse                   82598  1
ipv6                  343556  60

No sign of w1

At the moment I concentrate me on the owserver.
The owhttpd server return only the “Apache2 Debian Default Page”?
Other defined apache2 sites are working fine.

# /etc/init.d/owhttpd start
[ ok ] Starting owhttpd (via systemctl): owhttpd.service.

# /etc/init.d/owhttpd status
● owhttpd.service - LSB: 1-wire HTTP server
   Loaded: loaded (/etc/init.d/owhttpd)
   Active: active (exited) since Tue 2016-02-16 20:41:42 CET; 13min ago
  Process: 3261 ExecStop=/etc/init.d/owhttpd stop (code=exited, status=0/SUCCESS)
  Process: 3268 ExecStart=/etc/init.d/owhttpd start (code=exited, status=0/SUCCESS)

Feb 16 20:41:41 hc-wv-rapi3 OWFS[3273]: DEFAULT: ow_daemon.c:(144) Entered background mode, quitting.
Feb 16 20:41:41 hc-wv-rapi3 OWFS[3273]: DEFAULT: ow_net_server.c:(360) Isolated from any control -- exit
Feb 16 20:41:42 hc-wv-rapi3 owhttpd[3268]: Starting 1-Wire HTTP Daemon: owhttpd failed!
Feb 16 20:41:42 hc-wv-rapi3 systemd[1]: Started LSB: 1-wire HTTP server.
Feb 16 20:55:10 hc-wv-rapi3 systemd[1]: Started LSB: 1-wire HTTP server.

Checking the running processes with 
# ps -ef | grep ow
I see only the owserver

The owget works:
# owget /10.0C95B7000800/temperature           7
# owget /1D.CAB804000000/counter.A       3335256
This for all 7 temperature sensors and the 2 DS2423 cards.

I wrote a small php script to read the sensors & counters
<?php
require "/usr/share/php/OWNet/ownet.php";
$ow = new OWNet("tcp://127.0.0.1:4304"); #default location, verbose errors, Celsius degrees
$owadds = $ow->dir('/')['data_php'];
$owaddresses = explode(",", str_replace('/', '', $owadds));
$ow10temperatures = array(); // DS1820 - 1-Wire temperatursensor
$ow1DdualCounters = array(); // DS2423 - 1-Wire Dual Counter
foreach ($owaddresses as $owaddress) {
  $fam = substr($owaddress, 0, 2);
  switch ($fam) {
    case '10':
 $ow10temperatures[] = $owaddress;
      break;
    case '1D':
      $ow1DdualCounters[] = $owaddress;
      break;
    default:
      break;
  }
}
$return_full_info_array = TRUE;
$parse_php_type = TRUE;
foreach ($ow1DdualCounters as $owaddress) {
  $ca = $ow->get("/" . $owaddress . "/counter.A", OWNET_MSG_READ, $return_full_info_array, $parse_php_type);
  echo "Counter A " . $owaddress . " = " . $ca['data'] . "\n";
  $cb = $ow->get("/" . $owaddress . "/counter.B", OWNET_MSG_READ, $return_full_info_array, $parse_php_type);
  echo "Counter B " . $owaddress . " = " . $cb['data'] . "\n";
}
foreach ($ow10temperatures as $owaddress) {
  $tg = $ow->get("/" . $owaddress . "/temperature", OWNET_MSG_READ, $return_full_info_array, $parse_php_type);
  echo "owt->get returned: ".print_r($tg, TRUE)."\n";
  echo "Temperature sensor = '" . $owaddress . "' = " . $tg['data'] . ' ' . $tg['unit'] . "\n";
}

This returns:
# php ownet-test.php
Counter A 1D.CAB804000000 =      3335256
Counter B 1D.CAB804000000 =     10985886
Counter A 1D.53BE04000000 =     10060396
Counter B 1D.53BE04000000 =         1024
owt->get returned: Array
(
    [0] => 0
    [1] => 12
    [2] => 12
    [3] => 258
    [4] => 12
    [5] => 0
    [data] =>        6.875
    [data_len] => 12
    [data_php] => 6.875
    [unit] => C
)

Temperature sensor = '10.0C95B7000800' =        6.875 C
owt->get returned:
Temperature sensor = '10.4282B7000800' =
owt->get returned:
Temperature sensor = '10.B284B7000800' =
owt->get returned:
Temperature sensor = '10.D6ADC4000800' =
owt->get returned:
Temperature sensor = '10.61B9C4000800' =
owt->get returned:
Temperature sensor = '10.832409000800' =
owt->get returned:
Temperature sensor = '10.6F90B7000800' =

If I check the owserver running in a separate console I see that all the temperatures are read but are not transferred to the  php script! Only the first one.

Here some cut-outs from the owserver debug lines:
  DEBUG: ow_read.c:(620) Read /10.6F90B7000800/temperature Extension 0 Gives result 0
  DEBUG: ow_cache.c:(384) Adding data for /10.6F90B7000800/temperature
  DEBUG: ow_cache.c:(421) 10 6F 90 B7 00 08 00 CA size=8
  DEBUG: ow_cache.c:(635) Add to cache sn 10 6F 90 B7 00 08 00 CA pointer=0x76f703f8 index=0 size=8
  DEBUG: ow_read.c:(253) return=0
Byte buffer OWQ_parse_output_offset_and_size, length=12
--000: 20 20 20 20 20 33 34 2E 39 33 37 35
   <     34.9375>

OWQ OneWireQuery structure of /10.832409000800/temperature
    OneWireQuery size=12 offset=0, extension=0
Byte buffer OneWireQuery buffer, length=12
--000: 20 20 20 20 20 2D 30 2E 39 33 37 35
   <     -0.9375>
    Cleanup = 0006    OneWireQuery I=12 U=12 F=-0.9375 Y=12 D=Thu Jan  1 01:00:12 1970

--- OneWireQuery done

All reading of the sensor & counters generate a lot of owserver debug information which I don't understand.

I hope this info will be enough so someone can help my further.

Kind regards,
Willy


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers