DS9097U issue with new raspbian (jessie)

139 views
Skip to first unread message

DJ exx

unread,
Jan 4, 2017, 8:02:18 PM1/4/17
to DigiTemp
After upgrade from raspbian wheezy to jessie on Raspberry Pi 2B   my 1-wire temperature logger stopped working.

System is based on DS9097U (chip DS2480B) connected to /dev/ttyAMA0 serial port
I get following messages:

Error 5: DS2480B Adapter Not Detected
Error 10: Read COM Failed
Error 10: Read COM Failed
Error 10: Read COM Failed
Error 10: Read COM Failed
Error 10: Read COM Failed
Error 10: Read COM Failed
Error 10: Read COM Failed
Error 10: Read COM Failed
Error 10: Read COM Failed


Any ideas?

keypunch

unread,
Jan 5, 2017, 8:26:11 PM1/5/17
to DigiTemp, John L. Males
DJ,

Have you done a "ls" command to see of the /dev/ttyAMA0 port is defined?

You indicated you are using a 1-wire master based on the DS2480B via a DS9097U.   In my experience to date that would mean the the DS9097U is connected bya a /dev/ttySx serial port or a /dev/ttyUSBx port if one is using a USB to Serial adapter.  This leads to the question how is the DS9097U comected to the Pi?

Next up Debian being Debian, did groups change and/or what groups the User ID being used to run your digitemp?  It seems the system sort of knows about the /dev/ttyAMA0 port, but maybe that is ot the port to communicate with now after the upgrade of from Raspbian Wheezy to Jessie.

Just a few thoughts that might help solve or stir the brain cells a bit to allow you to solve the problem.


Regards,

John L. Males
Toronto, Ontario
Canada
05 January 2017 20:25

DJ exx

unread,
Jan 9, 2017, 3:55:46 AM1/9/17
to DigiTemp, jlm...@gmail.com
The DS2480B chip is connected to TxD/RxD pins on Raspberry Pi 2B directly (not using USB). Port /dev/ttyAMA0 is working correctly and permissions are OK (666 - I'm using sudo anyway).

For now I think that Raspbian Jessie has a bug - during boot time  it sends one byte (0xFF) to serial port (if uart is enabled in /boot/config.txt) which confuses the DS2480B chip. When I connect the chip to gpio pins AFTER booting  - digitemp recognize the chip and all connected sensors. But after reboot WITH the chip connected to port - recognition fails.

Few years ago there was similar issue in Linux kernel https://github.com/raspberrypi/linux/issues/12 

Maybe the solution is to change  digitemp source code to discard this  unnecessary byte. Or somehow reset the DS2480B chip on digitemp start.

Brian C. Lane

unread,
Jan 9, 2017, 10:46:11 AM1/9/17
to DigiTemp
I'm not sure what else digitemp could do, the initial connection
sequence includes 10 tries to connect, and it sends a BREAK each time,
and flushes the buffers.

I tried getting one of my old Pi's running again with the latest Jessie
lite version, but ran into problems with the usb keyboard support so
didn't get anywhere. I use them with a USB to serial adapter though, not
the GPIO pins.


--
http://www.brianlane.com

DJ exx

unread,
Jan 9, 2017, 11:50:30 AM1/9/17
to DigiTemp, b...@brianlane.com
Well, in fact I'm not sure that RPi sends a byte  (interpreted as 0xFF by PC serial terminal , not tested on oscilloscope). It  might also be a voltage spike, as described in http://elinux.org/RPi_Serial_Connection#Glitch_when_opening_serial_port 
This may confuse the DS2480B chip so it don't recognize BREAK commands.

Of course I could separate RPi TxD from DS2480B through gate switched by another GPIO output pin before starting digitemp  but it requires some hardware work. For now I'll stay with Raspbian wheezy.
Thanks for your concern Brian. 

John L. Males

unread,
Jan 13, 2017, 10:50:48 PM1/13/17
to DJ exx, DigiTemp
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

DJ,

If there was a Kernel issue then the solution needs to be with
the Kernel and not with digitemp. This same approach would
apply to any situation where the Kernel breaks an application.
The fix needs to be where the problem is caused.

I indicated if there is a Kernel issue as I did read the link
you provided and many other related via various searches I
made. I am not a kernel developer or such. Lets just say I
have a unique background. I can tell you I have been party
to changes in the Kernel that broke things that had worked
for years with staple Unix type programs. I am not sure
based on what I read what the entire issue is the Kernel
developers are trying to address that seems to have tripped
your hardware configuration up with Debian Jessie.

I do not know if you have the skill to compile a newer
Kernel.org in Debian or not. I would not suggest doing so on
the PI even with a USB hard drive as the amount of disk i/o
that a kernel compile involves will still take quite a hit on
the flash as part of the compile process. I can tell you that
the Jessie Kernel has more than a few issues. It is also
possible that a later version of the Kernel.org may not have the
issues you experienced with Debian Jessie Kernel. I personally
tend to build my own Kernels.org. I cannot use the latest
Kernel from Kernel.org due to some problems in the Kernel. I
opened a Kernel bug in the Kernel bug tracking system as
the Kernel panics on boot. A first for me in years of building
Kernels myself.

Your conclusion that the Kernel in Raspbian Jessie has a bug is
a distinct possibility.

I do not know if it will make a difference or not, but maybe if
a MAX232 was between the Serial GPIO and DS2480B the issue you
experience with Raspbian Jessie may not exist.

If you feel inclined you might want to see if the same issues
you had with digitemp with Raspbian Jessie would would occur
with owfs? I understand why you use digitemp and I am not
suggesting you change to owfs. What I am suggesting is to see
if owfs experiences similar issues. If owfs has issues with
Raspbian Jessie then that would almost certainly suggest a
Raspbian Jessie Kernel issue.


Regards,

John L. Males
Toronto, Ontario
Canada
13 January 2017 22:50


================================================================

2017-01-13 22:25:42.653479038-0500-EST Time:
1484364342.655913872

13 Jan 22:25:42 ntpdate[15809]: ntpdate 4.2...@1.2194-o Sun
Oct 17 13:35:14 UTC 2010 (1)

13 Jan 22:25:57 ntpdate[15814]: step time server 132.246.11.229
offset -0.004894 sec

Linux 3.4.106-kernel.org-jlm-010-amd64 #1 SMP PREEMPT Fri Mar 6
21:19:19 EST 2015

Modified Debian GNU/Linux 6.0.3 (squeeze)
(Alternative to Debian determined, work in progress)

cat /proc/cpuinfo (Selected):

model name : Intel(R) Core(TM)2 CPU T5600 @
1.83GHz

vmstat -s:

3452460 K total memory
3255152 K used memory
2254596 K active memory
613936 K inactive memory
197308 K free memory
6008 K buffer memory
116976 K swap cache
8225244 K total swap
1842800 K used swap
6382444 K free swap
14478674 non-nice user cpu ticks
11085 nice user cpu ticks
3225717 system cpu ticks
102667140 idle cpu ticks
824167 IO-wait cpu ticks
4362 IRQ cpu ticks
67094 softirq cpu ticks
0 stolen cpu ticks
59323811 pages paged in
59323239 pages paged out
631323 pages swapped in
857358 pages swapped out
288594655 interrupts
552306387 CPU context switches
1481145013 boot time
177163 forks

/proc/vmstat (Selected):

pgpgin 59323847
pgpgout 59323239
pswpin 631332
pswpout 857358
pgfree 386493360
pgfault 195738462
pgmajfault 169270

/proc/meminfo (Selected):

Mlocked: 6536 kB
VmallocTotal: 34359738367 kB
VmallocChunk: 34359311484 kB
HugePages_Total: 0

vmstat --partition /dev/sda8 (Swap):

sda8 reads read sectors writes requested writes
291193 5052043 29271 6858864

sar -b:

Linux 3.4.106-kernel.org-jlm-010-amd64
(pwsdhhuesloejsgegsjwilastwhsk) 01/13/2017
_x86_64_ (2 CPU)

02:45:48 PM pgpgin/s pgpgout/s fault/s majflt/s pgfree/s
pgscank/s pgscand/s pgsteal/s %vmeff

10:05:01 PM 3.14 18.87 579.43 0.18
611.23 0.00 0.00 0.00 0.00 10:15:01 PM
0.10 14.11 574.72 0.01 587.59 0.00
0.00 0.00 0.00 10:25:01 PM 4.93 20.06
578.45 0.35 619.09 1.59 0.00 0.92
58.18 Average: 26.75 30.52 596.09 0.93
651.34 14.32 1.06 9.82 63.84

ps -A:

%CPU START TIME C CLS COMMAND TIME NI PID
POL PRI SZ RSS VSZ SIZE MAJFL MINFL SCH STAT
TIME WCHAN

0.0 Dec 7 1:47 0 TS kswapd0 00:01:47 0 27
TS 19 0 0 0 0 0 0 0 S
00:01:47 kswapd


Message replied to:

Date: Mon, 9 Jan 2017 00:55:46 -0800 (PST)
From: DJ exx <ad.ch...@gmail.com>
To: DigiTemp <digi...@googlegroups.com>
Cc: jlm...@gmail.com
Subject: Re: Re[01]: DS9097U issue with new raspbian (jessie)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAlh5oA0ACgkQ+V/XUtB6aBA8PQCgxljjpgTaUisheIHSJ3sI6sJj
VSwAn3ksWHdvV7GFbn7aa+5Dpn1gI72r
=uz4n
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages