Issue getting a usb serial adapter working in a FreeNAS 9.3 jail

Status
Not open for further replies.

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Hi, I am trying to install Z-Wave in a FreeNAS 9.3 jail in order to use it together with Domoticz. While I was following the guide here. I ran into trouble compiling Open Z-Wave due to this warning that it gives me:

cc1: warnings being treated as errors
/usr/home/domoticz/open-zwave/cpp/hidapi/libusb/hid.c: In function 'get_usb_string':
/usr/home/domoticz/open-zwave/cpp/hidapi/libusb/hid.c:376: warning: passing argument 2 of 'libiconv' from incompatible pointer type
/usr/home/domoticz/open-zwave/cpp/build/support.mk:112: recipe for target '/usr/home/domoticz/open-zwave/.lib/hid.o' failed

The part that this warning is referring too is this (starting on row 338 of the hid.c file):
#ifdef FreeBSD
const char *inptr;
#else
char *inptr;
#endif
char *outptr;

Does anyone know how this warning can be resolved?

When I remove the -Werror flag (so it ignores warnings) it compiles just fine, but then I get stuck at getting access to the Zwave.me usb stick in the jail.

I found the device is connected on ugen0.4 and then tried to make a symbolic link by doing the following:
ln -s /dev/ttyu1 /mnt/tank/jails/domoticz/dev/ttyUSB0

When I test the connection with MinOZW it gets stuck at:
Trying to open serial port /dev/ttyUSB0 (attempt 1)

Any suggestion what I am doing wrong and how I can fix this? Thanks.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Moved to off-topic as this forum isn't for support of Z-Wave. :P
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Have you done a 'pkg upgrade' in your jail? I ask because a number of packages seem to have trouble with libiconv until that's done, and that same library seems to be involved in your problems.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Thanks for your reply. When I started with a clean jail I first did a pkg update followed by a pkg upgrade.

Do you know what the correct way is to make a USB dongle available in a jail?

Is the way I described above the correct way?
 
Last edited:
Joined
Mar 6, 2014
Messages
686
You shouldn't ignore errors. Fix them (seems like you already did) and then start with fixing access to the USB. I guess it is an USB serial device of some kind, so if i am correct it would be listed as /dev/cuaU# if supported.
 
Last edited:

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Yes, thanks that is what I was looking for, there is a cuau1 in my /dev so I'll create a link from that and report back.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
I am now able to access the USB device on cuau1 so now looking to get Open Zwave working with my installation.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Still looking to get this device working, I found this thread on the FreeBSD forum which says your device should show up as cuaU1 after the ucom driver was loaded (instead of cuau1 as it shows up on my box). So I thought it may be the issue that I did not load the ucom driver. So I have added a tunable with variable: ucom_load value:YES type:loader. I have enabled the tunable and did a reboot but I did not see any differences. The device is still shown as cuau1 instead of cuaU1 and ttyu1 instead of ttyU1. Did I do something wrong with the tunable or do I need to do something else? I believe the usb stick is based on this Sigma designs chip do I need another driver to load?
 
Last edited:

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Instead of guessing, use dmesg and/or watch kernel console messages to see if your driver's being loaded. USB is hotplug so you can just unplug it and replug it and see what it says on the console.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Sorry I am not that experienced with FreeNAS yet, I looked at dmesg, don't know how to watch kernel console messages. Can you explain that?

Attached is the result of dmesg. I know the stick is on ugen0.4. On line 96 I see pci4: <serial bus, USB> at device 0.0 (no driver attached) looks like no driver is attached, is referring to ugen0.4?

Edit: found the option in the system/advanced menu to watch the console messages in the footer.

When I unplug the device the following happens:
Code:
ugen0.4: <vendor 0x0658> at usbus0 (disconnected)
usb_alloc_device: set address 4 failed (USB_ERR_STALLED, ignored)
usbd_setup_device_desc: getting device descriptor at addr 4 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=4, set address failed! (USB_ERR_STALLED, ignored)
usbd_setup_device_desc: getting device descriptor at addr 4 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=4, set address failed! (USB_ERR_STALLED, ignored)
usbd_setup_device_desc: getting device descriptor at addr 4 failed, USB_ERR_STALLED
ugen0.4: <vendor 0x0658> at usbus0
ugen0.4: <vendor 0x0658> at usbus0 (disconnected)
ugen0.4: <vendor 0x0658> at usbus0


Not sure what that means but it doesn't look good.
 

Attachments

  • dmesg.txt
    12.9 KB · Views: 325
Last edited:

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Okay, then, no driver is attached. If you look on the VGA console, unplug and replug your device. Any messages show up?
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Okay, then, no driver is attached. If you look on the VGA console, unplug and replug your device. Any messages show up?
I think I just posted that as an edit on my previous post. Or do you mean something else?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Edits aren't good because there's no notification of activity in the thread. Anyways, that doesn't look like it is working. It may be that the USB driver for your device isn't included. I believe that there's still some way programs can make use of it through a generic driver, but I haven't looked at that in a loooong time.

In any case, usually for jails, speaking generally about FreeBSD because I don't do jails in FreeNAS, what you want is to mount a jail-ified /dev within the jail. You cannot make symlinks or hard links to the host system /dev directory.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Edits aren't good because there's no notification of activity in the thread. Anyways, that doesn't look like it is working. It may be that the USB driver for your device isn't included. I believe that there's still some way programs can make use of it through a generic driver, but I haven't looked at that in a loooong time.

In any case, usually for jails, speaking generally about FreeBSD because I don't do jails in FreeNAS, what you want is to mount a jail-ified /dev within the jail. You cannot make symlinks or hard links to the host system /dev directory.
Ok any suggestions or links to instructions on how to do that? As said I don't have a lot off experience with FreeNAS and FreeBSD.

Another option I am looking into is using it in a virtualbox jail with a debian vm. Since I know it should work out of the box with Linux. I need to look into how to forward the USB port to virtualbox, but using it in a normal jail has my preference.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Honestly, out of my realm of experience and interest. There's a full ESXi virtualization environment here so there's no need to run jails or try to do stuff like this.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
With full ESXi virtualization environment you mean the Virtualbox solution right? When I started trying to install Domoticz I used this instruction. Therefore I did not look into the virtualbox solution. In the jail I have the software installed and all is working except my USB z-wave stick.

I have now also installed debian in a virtualbox machine and installed the software there but I am struggling with getting my usb stick pass through to the vm. I followed the instructions in this thread but without success. Any ideas on how to fix this?
 
Last edited:

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
No, I mean /here/. /I/ don't do jails or virtualbox because there's no need /here/. At our site. So I don't know all that much about your issue.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
So he's saying he uses ESXi (VMware Product) on his system so he cannot give you further advice. From my point of view, you need to do a lot more reading about how FreeBSD and jails work. There is a lot to read and it's difficult for someone to just give you the simple answer because it's not simple. As you already know, your USB serial port doesn't appear to have a device driver built in to FreeNAS because when you plug it in or unplug it, on the Console you do not see any messages stating an item was installed or removed.

If you were working from FreeBSD then it might work or you might be able to find a device driver that works and then install it, however with FreeNAS, installing a device driver and making it work in a unique environment can be problematic.
 

wmn79

Explorer
Joined
Apr 23, 2015
Messages
59
Ok thanks for your answers, I know the jail system and FreeBSD is quite difficult to understand quickly. I have found that out the past 1.5 month when I have been looking to solve this issue. I did learn quite a lot but I think the best is now to go the Virtualbox way. I have now setup a virtualbox jail with a debian machine installed. That seems to recognize the device so next step is to see if it works correctly with the Open-ZWave software.
 
Status
Not open for further replies.
Top