OpenWrt Forum Archive

Topic: owfs not working with wireless

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm recently playing around with trunk, trying to get OWFS to work. I had it already working reasonably well with AA12.09, but needed to switch to trunk for various reasons.

In the new configuration
- OWFS fails if I use the router with extroot (pivot overlay).
- OWFS works, if I don't use extroot.

OLD: AA 12.09 on DIR-505, extrooted, DS9490R attached to USB hub -> working configuration

NEW1: BB r40502 on DIR-505, extrooted, DS9490R attached to USB hub -> not working
NEW2: BB r40502 on DIR-505, DS9490R attached directly to router -> working
NEW3: BB r40502 on DIR-505, DS9490R attached to USB hub -> working

=> extroot makes owfs fail

Failure:

root@DIR-505-2:/mnt# owfs -uall /mnt/1wire/
DEFAULT: ow_usb_msg.c:DS9490_open(276) Opened USB DS9490 bus master at 1:4.
DEFAULT: ow_usb_cycle.c:DS9490_ID_this_master(191) Set DS9490 1:4 unique id to 81 5F 90 31 00 00 00 D0
root@DIR-505-2:/mnt# ls -l 1wire/
drwxrwxrwx    1 root     root             8 Apr 16 00:01 28.1CC484040000
drwxrwxrwx    1 root     root             8 Apr 16 00:01 81.5F9031000000
drwxr-xr-x    1 root     root             8 Apr 16 00:01 alarm
drwxr-xr-x    1 root     root             8 Apr 16 00:01 bus.0
drwxr-xr-x    1 root     root             8 Apr 16 00:01 settings
drwxrwxrwx    1 root     root             8 Apr 16 00:01 simultaneous
drwxr-xr-x    1 root     root             8 Apr 16 00:01 statistics
drwxr-xr-x    1 root     root            32 Apr 16 00:01 structure
drwxr-xr-x    1 root     root             8 Apr 16 00:01 system
drwxr-xr-x    1 root     root             8 Apr 16 00:01 uncached

So far, so good, but when I try to get a temperature reading, I get an error:

root@DIR-505-2:/mnt# cat 1wire/28.1CC484040000/temperature12
cat: read error: Invalid argument

and afterwards, the relevant IDs (28.xxx + 81.xxx) are gone:

root@DIR-505-2:/mnt# ls -l 1wire/
drwxr-xr-x    1 root     root             8 Apr 16 00:01 bus.0
drwxr-xr-x    1 root     root             8 Apr 16 00:01 settings
drwxr-xr-x    1 root     root             8 Apr 16 00:01 statistics
drwxr-xr-x    1 root     root            32 Apr 16 00:01 structure
drwxr-xr-x    1 root     root             8 Apr 16 00:01 system
drwxr-xr-x    1 root     root             8 Apr 16 00:01 uncached

I'm clueless about how extroot could possibly influence owfs... any hints / thoughts?

Edit: it's not extroot that makes owfs fail, but rather wireless is the culprit. My extroot had wireless turned on, thus owfs failed when extroot was present and worked when extroot was absent.

Now I'm a little bit futher, but the question remains:
Why does owfs in BB r40502 fail when wireless is enabled, while the same worked with AA12.09?

(Last edited by tmo26 on 15 Apr 2014, 23:38)

Now it's getting confusing: owfs on A1 version of DIR-505 is sensitive to wireless status, while on A2 version, it is not.

DIR-505 A1, r40502, extroot:
- wifi on -> owfs fails
- wifi off -> owfs working


DIR-505 A2, r40004, no extroot:
- wifi on -> owfs working !!!

Seems strange to me...

Any hints where to look for the solution..?

(Last edited by tmo26 on 16 Apr 2014, 18:56)

Played around with the network settings on the A2 version.
- owfs is working with wifi enabled; LAN + WAN on different subnets
- set the IP to the same subnet for LAN + WAN via uci
- added dns + gateway for lan via uci
- uci commit
- /etc/init.d/network restart
-> owfs fails (before it was working)
- reboot
-> owfs fails with wifi enabled

Then I ran owfs with some more detailed error output:

root@DIR-505-3:/mnt# owfs --error_level=4 -uall /mnt/1wire/
CONNECT: owfs.c:main(100) fuse mount point: /mnt/1wire/
CONNECT: ow_avahi_link.c:OW_Load_avahi_library(72) No Avahi support. Library libavahi-client couldn't be loaded
CONNECT: ow_dnssd.c:OW_Load_dnssd_library(136) Zeroconf/Bonjour is disabled since dnssd library isn't found
   CALL: ow_parsename.c:FS_ParsedName_anywhere(95) path=[]
CONNECT: ow_usb_cycle.c:USB_next(68) Bus master found: 1:3
DEFAULT: ow_usb_msg.c:DS9490_open(276) Opened USB DS9490 bus master at 1:3.
   CALL: ow_parsename.c:FS_ParsedName_anywhere(95) path=[]
   CALL: ow_parsename.c:FS_ParsedName_anywhere(95) path=[/uncached/bus.0]
   CALL: ow_dir.c:FS_dir_both(98) path=/uncached/bus.0
   CALL: ow_parsename.c:FS_ParsedName_anywhere(95) path=[/uncached/bus.0/interface]
   DATA: ow_ds9490.c:DS9490_SetSpeed(919) set flexible speed
   DATA: ow_usb_msg.c:DS9490_getstatus(150) (HAVE_USB_INTERRUPT_READ) error reading ret=-32
   DATA: ow_usb_msg.c:DS9490_getstatus(159) (no HAVE_USB_INTERRUPT_READ) error reading ret=-32
   CALL: ow_parsename.c:FS_ParsedName_anywhere(95) path=[/uncached/bus.0/28.C47685040000]
   CALL: ow_parsename.c:FS_ParsedName_anywhere(95) path=[/uncached/bus.0/28.8E5785040000]
   DATA: ow_usb_msg.c:DS9490_getstatus(159) (no HAVE_USB_INTERRUPT_READ) error reading ret=-32
   DATA: ow_ds9490.c:DS9490_directory(668) ReadBufferstatus size 32 too large
   DATA: ow_ds9490.c:DS9490_directory(668) ReadBufferstatus size 48 too large
   CALL: ow_parsename.c:FS_ParsedName_anywhere(95) path=[/uncached/bus.0/simultaneous]
   CALL: ow_parsename.c:FS_ParsedName_anywhere(95) path=[/uncached/bus.0/alarm]
DEFAULT: ow_usb_cycle.c:DS9490_ID_this_master(213) Set DS9490 1:3 unique id to 28 C4 76 85 04 00 00 6A

The difference to the previously working status: those lines were not present when owfs was working:

DATA: ow_usb_msg.c:DS9490_getstatus(150) (HAVE_USB_INTERRUPT_READ) error reading ret=-32
DATA: ow_usb_msg.c:DS9490_getstatus(159) (no HAVE_USB_INTERRUPT_READ) error reading ret=-32

This makes me think that this is somehow related to AR9331 usb bug...
OK, I understand the interference of USB / Wifi thing which was resolved in a previous revision... but how is this related to my network settings, i.e. the static lan IP, dns and gateway?

Any thoughts on this are very welcome.

Found the solution, however, this rises another question... but one after the other.

  * I found out, that when booting with DS9490 attached to 4 port passive USB hub, owfs fails with the error given above (DATA: ow_usb_msg.c:DS9490_getstatus(159) (no HAVE_USB_INTERRUPT_READ) error reading ret=-32)
  * when I now disconnect the hub from the router and reconnect it, owfs works!
  * when I do an usbreset on the hub the DS9490 is connected to, owfs works!
  * when I do an usbreset on DS9490 directly, owfs doesn't work!

Solution to get owfs working with trunk r40659: Do an usbreset on the hub the DS9490 is connected to.

Now this rises another question: How can I get this to work with extroot? As soon as I reset the hub (to which the DS9490 and the USB storage with the extroot partition are connected), I will lose my extroot...

1. What's the reason for the need to reset the hub to get owfs to work? Once this root-cause is eliminated, I won't have to deal with workarounds (see below) any more.
2. How can I automatically reset the hub during the boot process (rc.local, but what about losing extroot during this hub reset?)?
3. How can I re-mount extroot after I lost it due to a hub-reset?

Any help much appreciated.

The discussion might have continued from here.