owserver is not working correctly

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

owserver is not working correctly

samuix
Hello,
we are using since one week two ds9097u bus adapter at the same time. It works fine until this morning the owserver don't response any request, openhab or owdir, the process was still running. After restart its work fine again
Start command: owserver -d /dev/ttyUSB0 -d /dev/ttyUSB1 -p4304
Where is the problem? How we can findout if it is running normally or not to maybe auto restart? We are using the onewire network for temperature control in our house
 
Regards
   Detlef

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

Jan Kandziora
Am 14.10.2016 um 14:42 schrieb samuix:
> Hello,
> we are using since one week two ds9097u bus adapter at the same time. It works
> fine until this morning the owserver don't response any request, openhab or
> owdir, the process was still running. After restart its work fine again
> Start command: owserver -d /dev/ttyUSB0 -d /dev/ttyUSB1 -p4304
> Where is the problem? How we can findout if it is running normally or not to
> maybe auto restart?
>
Most likely these are USB problems. Check

# dmesg

for error messages first, should this happen again.


Kind regards

        Jan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

samuix
Hello,
i had a look at dmesg –e and saw the error message:
ftdi_sio ttyUSB1: usb_serial_generic_read_bulk_callback - urb stopped: -32
After the disconnection the USB device was connected to USB2 instead of USB1. It looks like that the owserver had the problem after the USB1 was disconnected, missing.
 
Why the values from the still connected USB0 are not available anylonger?
How can we recognize that the owserver has a problem ?
 
Thanks
Br
 
Gesendet: Freitag, 14. Oktober 2016 um 15:54 Uhr
Von: "Jan Kandziora" <[hidden email]>
An: "OWFS (One-wire file system) discussion and help" <[hidden email]>
Betreff: Re: [Owfs-developers] owserver is not working correctly
Am 14.10.2016 um 14:42 schrieb samuix:
> Hello,
> we are using since one week two ds9097u bus adapter at the same time. It works
> fine until this morning the owserver don't response any request, openhab or
> owdir, the process was still running. After restart its work fine again
> Start command: owserver -d /dev/ttyUSB0 -d /dev/ttyUSB1 -p4304
> Where is the problem? How we can findout if it is running normally or not to
> maybe auto restart?
>
Most likely these are USB problems. Check

# dmesg

for error messages first, should this happen again.


Kind regards

Jan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

Stefano Miccoli
/dev/ttyUSBx names are NOT persistent, and typically when you unplug an USB-to-serial adapter and reconnect it you get a new /dev/ttyUSBy device.

On the contrary owserver needs a persistent device name to work properly: try googling  "udev rules ttyusb” for some recipes on how to write a udev rule which creates a persistent symlink to the current serial adapter, and configure owserver to connect to the persistent name.

No idea why you loose also the first adapter, but before starting to debug the problem I would try to implement correct udev rules and see if you get a more stable environment.

From the spec the DS9097U-009 includes a DS2502 Identification Chip: if this is your case you can use the ‘owpresent’ command to check if the adapter is still connected.

Finally you have a chain adapters "usb-to-serial => serial-to-1wire": I would consider a usb-to1wire solution, since you will eliminate one point of failure.

Stefano



On 14 Oct 2016, at 17:07, samuix <[hidden email]> wrote:

Hello,
i had a look at dmesg –e and saw the error message:
ftdi_sio ttyUSB1: usb_serial_generic_read_bulk_callback - urb stopped: -32
After the disconnection the USB device was connected to USB2 instead of USB1. It looks like that the owserver had the problem after the USB1 was disconnected, missing.
 
Why the values from the still connected USB0 are not available anylonger?
How can we recognize that the owserver has a problem ?
 
Thanks
Br
 
Gesendet: Freitag, 14. Oktober 2016 um 15:54 Uhr
Von: "Jan Kandziora" <[hidden email]>
An: "OWFS (One-wire file system) discussion and help" <[hidden email]>
Betreff: Re: [Owfs-developers] owserver is not working correctly
Am 14.10.2016 um 14:42 schrieb samuix:
> Hello,
> we are using since one week two ds9097u bus adapter at the same time. It works
> fine until this morning the owserver don't response any request, openhab or
> owdir, the process was still running. After restart its work fine again
> Start command: owserver -d /dev/ttyUSB0 -d /dev/ttyUSB1 -p4304
> Where is the problem? How we can findout if it is running normally or not to
> maybe auto restart?
>
Most likely these are USB problems. Check

# dmesg

for error messages first, should this happen again.


Kind regards

Jan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

Jan Kandziora
Am 14.10.2016 um 17:36 schrieb Stefano Miccoli:

> /dev/ttyUSBx names are NOT persistent, and typically when you unplug
> an USB-to-serial adapter and reconnect it you get a new /dev/ttyUSBy
> device.
>
> On the contrary owserver needs a persistent device name to work
> properly: try googling  "udev rules ttyusb” for some recipes on how
> to write a udev rule which creates a persistent symlink to the
> current serial adapter, and configure owserver to connect to the
> persistent name.
>
While this is correct, it can be incredibly hard to write such a rule
when you have two or more otherwise identical adapters.


>
> From the spec the DS9097U-009 includes a DS2502 Identification Chip:
> if this is your case you can use the ‘owpresent’ command to check if
> the adapter is still connected.
>
You can use Johan Ström's owusbprobe for this. It's in the owshell
directory from recent owfs installations.


Kind regards

        Jan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

Tomasz Torcz-4
In reply to this post by Stefano Miccoli
On Fri, Oct 14, 2016 at 05:36:28PM +0200, Stefano Miccoli wrote:
> /dev/ttyUSBx names are NOT persistent, and typically when you unplug an USB-to-serial adapter and reconnect it you get a new /dev/ttyUSBy device.
>
> On the contrary owserver needs a persistent device name to work properly: try
> googling  "udev rules ttyusb” for some recipes on how to write a udev rule
> which creates a persistent symlink to the current serial adapter, and configure
> owserver to connect to the persistent name.  >

  No need to google, udev already ships such rule:
$ tree /dev/serial/
/dev/serial/
├── by-id
│   └── usb-FTDI_FT232R_USB_UART_A6XJSOX5-if00-port0 -> ../../ttyUSB0
└── by-path
    └── pci-0000:00:1d.0-usb-0:1.3:1.0-port0 -> ../../ttyUSB0

  One name encodes serial number of a dongle, second one physical
connection – up to USB port.
  Both are created by 60-serial.rules from upstream udev.

--
Tomasz Torcz                        To co nierealne -- tutaj jest normalne.
xmpp: [hidden email]          Ziomale na życie mają tu patenty specjalne.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

Matthias Urlichs-3
In reply to this post by Jan Kandziora
On 14.10.2016 18:06, Jan Kandziora wrote:
> While this is correct, it can be incredibly hard to write such a rule
> when you have two or more otherwise identical adapters.
I beg to differ. You just have to wrap your head around the whole
system, then it's reasonably easy. Just a bit tedious. ;-)

You can match devices either by serial number or, if the manufacturer
has been lazy, by USB path. If you use the latter, check their device
path (ATTRS{devpath}) with wildcards so that you explicitly match just
the digits that are actually different, as some of the others may be
assigned dynamically. (Plus, always check for idVendor and idProduct.)

Use "udevadm info --attribute-walk /sys/class/tty/ttyUSB0" (or USB1 or
…) to find matchable attributes. You want to look at the first block
that actually has an ATTRS{devpath}entry. Don't be fooled by serial
numbers (ATTRS{serial}) in blocks after that, they are part of the hub
or computer.

--
-- Matthias Urlichs


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

samuix
In reply to this post by Jan Kandziora
see inline
 
Gesendet: Freitag, 14. Oktober 2016 um 18:06 Uhr
Von: "Jan Kandziora" <[hidden email]>
An: "OWFS (One-wire file system) discussion and help" <[hidden email]>
Betreff: Re: [Owfs-developers] owserver is not working correctly
Am 14.10.2016 um 17:36 schrieb Stefano Miccoli:
> /dev/ttyUSBx names are NOT persistent, and typically when you unplug
> an USB-to-serial adapter and reconnect it you get a new /dev/ttyUSBy
> device.
>
> On the contrary owserver needs a persistent device name to work
> properly: try googling "udev rules ttyusb” for some recipes on how
> to write a udev rule which creates a persistent symlink to the
> current serial adapter, and configure owserver to connect to the
> persistent name.
>
While this is correct, it can be incredibly hard to write such a rule
when you have two or more otherwise identical adapters.
It works, they have different serial numbers

>
> From the spec the DS9097U-009 includes a DS2502 Identification Chip:
> if this is your case you can use the ‘owpresent’ command to check if
> the adapter is still connected.
>
You can use Johan Ström's owusbprobe for this. It's in the owshell
directory from recent owfs installations.
It shows only the difference of the USB adapters. My problem is during owserver is running and nobody knows when the USB adapter do not answer

Kind regards

Jan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

Jan Kandziora
In reply to this post by Matthias Urlichs-3
Am 14.10.2016 um 18:37 schrieb Matthias Urlichs:

> On 14.10.2016 18:06, Jan Kandziora wrote:
>> While this is correct, it can be incredibly hard to write such a rule
>> when you have two or more otherwise identical adapters.
> I beg to differ. You just have to wrap your head around the whole
> system, then it's reasonably easy. Just a bit tedious. ;-)
>
> You can match devices either by serial number or, if the manufacturer
> has been lazy, by USB path. If you use the latter, check their device
> path (ATTRS{devpath}) with wildcards so that you explicitly match just
> the digits that are actually different, as some of the others may be
> assigned dynamically. (Plus, always check for idVendor and idProduct.)
>
> Use "udevadm info --attribute-walk /sys/class/tty/ttyUSB0" (or USB1 or
> …) to find matchable attributes. You want to look at the first block
> that actually has an ATTRS{devpath}entry. Don't be fooled by serial
> numbers (ATTRS{serial}) in blocks after that, they are part of the hub
> or computer.
>
Yet, often enough there is no serial number exposed so all you have is
topological addressing. Which is a pain when you have different boards
you want to put your software on.

That's what I do for my machines in the field to tell apart different
USB sticks for data/backup purposes - topological addressing.

Kind regards

        Jan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

Jan Kandziora
In reply to this post by samuix
Am 14.10.2016 um 19:02 schrieb samuix:
>> While this is correct, it can be incredibly hard to write such a rule
>> when you have two or more otherwise identical adapters.
>
> It works, they have different serial numbers
>
That's nice, read out those serials then to make udev rules.


>> You can use Johan Ström's owusbprobe for this. It's in the owshell
>> directory from recent owfs installations.
>
> It shows only the difference of the USB adapters. My problem is during
owserver
> is running and nobody knows when the USB adapter do not answer*
>
The problem is, when USB fails then re-appears, the adapter gets
enumerated a second time and will get a different device node. That's
why owserver cannot see or use it anymore.

You must advise udev to create a symlink to the /dev/ttyUSBx node with a
name depending on the serial number of the adaptor. Then use that
symlink instead of /dev/ttyUSBn for owserver.

When the USB device fails, udev will remove the symlink, then create a
new symlink with the same name (based on the serial nu,ber) to the new
ttyUSB device node.

Kind regards

        Jan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

Stefano Miccoli
In reply to this post by Tomasz Torcz-4

On 14 Oct 2016, at 18:35, Tomasz Torcz <[hidden email]> wrote:

No need to google, udev already ships such rule:
$ tree /dev/serial/
/dev/serial/
├── by-id
│   └── usb-FTDI_FT232R_USB_UART_A6XJSOX5-if00-port0 -> ../../ttyUSB0
└── by-path
   └── pci-0000:00:1d.0-usb-0:1.3:1.0-port0 -> ../../ttyUSB0

 One name encodes serial number of a dongle, second one physical
connection – up to USB port.
 Both are created by 60-serial.rules from upstream udev.

You are perfectly right. I failed to mention that I prefer to write my own rules just because I like shorter, more descriptive names, like /dev/ttyOWbasement, and because I *never*ever* run owserver as root, but as a dedicated system user, so I need to setup permissions. In other words I split configuration in two steps: udev will find the serial adapter and setup symlink and permissions, while owfs.conf will point to a descriptive name.

But of course if default permissions are OK, and you can cope with 
/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A6XJSOX5-if00-port0
there is really no reason for writing a custom udev-rule.

In fact instructions for a basic owserver configuration on linux should use your suggestion, and not mine.

S.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: owserver is not working correctly

Johan Ström-3

Hi,

note that OWFS nowadays have built-in FTDI support, you just have to specify the correct serial. In your case, it looks like the serial is A6XJSOX5, so this might work:

owserver -d ftdi:s:0x0403:0x6001:A6XJSOX5

(If it is a LinkUSB device, use --link instead of -d for optimal performance). As mentioned before, owusbprobe can help you with identification (however not sure how reliable it is, yet).

Johan


On 14/10/16 21:47, Stefano Miccoli wrote:

On 14 Oct 2016, at 18:35, Tomasz Torcz <[hidden email]> wrote:

No need to google, udev already ships such rule:
$ tree /dev/serial/
/dev/serial/
├── by-id
│   └── usb-FTDI_FT232R_USB_UART_A6XJSOX5-if00-port0 -> ../../ttyUSB0
└── by-path
   └── pci-0000:00:1d.0-usb-0:1.3:1.0-port0 -> ../../ttyUSB0

 One name encodes serial number of a dongle, second one physical
connection – up to USB port.
 Both are created by 60-serial.rules from upstream udev.

You are perfectly right. I failed to mention that I prefer to write my own rules just because I like shorter, more descriptive names, like /dev/ttyOWbasement, and because I *never*ever* run owserver as root, but as a dedicated system user, so I need to setup permissions. In other words I split configuration in two steps: udev will find the serial adapter and setup symlink and permissions, while owfs.conf will point to a descriptive name.

But of course if default permissions are OK, and you can cope with 
/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A6XJSOX5-if00-port0
there is really no reason for writing a custom udev-rule.

In fact instructions for a basic owserver configuration on linux should use your suggestion, and not mine.

S.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers