USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz) Topic is solved

On various Hardware and OS systems: pi / windows / routers / nas, etc
Post Reply
Lazeebo
Posts: 4
Joined: Wednesday 06 July 2016 19:52
Target OS: Raspberry Pi
Domoticz version:
Contact:

USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by Lazeebo » Wednesday 06 July 2016 20:09

Hi all,

I've just started using Domoticz on a Raspberry Pi 3 with a Aeon Labs Z-stick connected via USB. All is working well so far and I must say I was a bit surprised it worked so well from the start with very little configuration. Kudos to the Domoticz team!

Now to my question... Is there a supported way to "safely" eject the USB stick while Domoticz is running? I need to unplug it when I want to pair it with some new Z-Wave device. Would be nice if it could be done from the Domoticz interface, but if there is a command I can run that's fine too. Right now I have to shut down the Raspberry and that seems so "un-Linux" like :)

User avatar
jumbotroll
Posts: 513
Joined: Tuesday 13 January 2015 15:36
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Oslo,Norway
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by jumbotroll » Wednesday 06 July 2016 20:42

Go to Setup --> Hardware.
Mark OpenZwave and remove the "Enable" ticker and then the Update button.
Then remove the USB device.

Then when you plug inn the device again:
Go to Setup --> Hardware.
Mark OpenZwave and add the "Enable" ticker and then the Update button.
Regards
Jumbotroll
http://www.jadahl.com

trixwood
Posts: 510
Joined: Friday 18 March 2016 8:20
Target OS: -
Domoticz version: Offline
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by trixwood » Thursday 07 July 2016 0:14

I just unplug it. It's plug and play. The assigned serial port will not change if you do not change the usb port. If you do plug it into another usb port and the operating system of your choice assigned another serial port to it, you can easily modify the new serial port assign to it in the hardware screen. No need to disable, enable stuff. Domoticz will ignore it when not present, and will use it when it is.

They only hardware that has to be "safely" ejected are* harddrives, flashdrives or any other memory drive like sd cards. And the only reason for that is that there could be data in cache memory of those drives that is not written to the disk and manufactures are too "cheap" to add a battery or capacitor such that the cache can be written to disk after power failure. Luckily, after more then 20 years since the introduction of the usb implementation (which promised us full plug and play!) and with the introduction of ssd https://en.wikipedia.org/wiki/Solid-sta ... _capacitor (as a boot disk) they started doing that. Only on expensive ssd and on some very expensive usb drives flash drives though (but then again I could be wrong, can't keep up these days :o ). The other reason is unplugging it in the middle of a file write operation (like file copying) will corrupt your data...

* yeah yeah, probably there is other hardware that writes and have crappy implementation on how to deal with it.

Lazeebo
Posts: 4
Joined: Wednesday 06 July 2016 19:52
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by Lazeebo » Thursday 07 July 2016 7:36

Ok! I guess I'm a bit overcautious and think I would break something if I just unplug it in the middle of sending/receiving stuff in Domoticz. Better to be safe than sorry! Anyhow, disabling/enabling before removing the stick worked fine (although the UI is a bit horrendous) :)

Thanks for your help!

trixwood
Posts: 510
Joined: Friday 18 March 2016 8:20
Target OS: -
Domoticz version: Offline
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by trixwood » Thursday 07 July 2016 12:06

Always be cautious and always verify! Assumptions are the dead of truth.

USB is designed to be removed when power on. You would add or remove a keyboard or mouse without powering the pi down. A keyboard receives (keys) and sends (status, those 3 leds Num,Caps,Scoll-Lock). Anyway.

Rule of thumb:

Storage based usb (usb stick, external usb drives,...) : remove safely
Message based usb (camera's, keyboard, serial devices like rflink, z-wave sticks) : just rip it out, except when flashing do not remove the usb when flashing firmware. Then stuff gets written to memory on your stick this is the only exception.

User avatar
jannl
Posts: 851
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Geleen
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by jannl » Thursday 07 July 2016 12:50

Why not add new hardware from the Domoticz webinterface?
In this way you also know directly if the device is reachable in the network

trixwood
Posts: 510
Joined: Friday 18 March 2016 8:20
Target OS: -
Domoticz version: Offline
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by trixwood » Thursday 07 July 2016 13:03

I really do not get why adding new hardware is relevant. Not to mention all those script (blocky, lua) depending on the "id" of the sensor will become rather useless and have to be re-edited.

Either
  • Enable/disable it, if you are insecure about usb devices
  • Unplug and plug it.
  • Don't unplug it and use the openzwave interface included in domoticz to include a node instead of the button (if you can get the sensor in short distance to your usb stick), with as bonus encryption works and you do not miss messages from other senors.

Lazeebo
Posts: 4
Joined: Wednesday 06 July 2016 19:52
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by Lazeebo » Thursday 07 July 2016 13:22

Well, from what I know it's best to bring the Z-stick close to the device I want to pair, press the button on the stick and then on the device and let them pair. This is especially handy for stuff that is mounted in a wall, like a dimmer. That way I can see that all went fine with the pairing.

But maybe this can be done directly in Domoticz like you say. I'm still new to this and learning... :)

trixwood
Posts: 510
Joined: Friday 18 March 2016 8:20
Target OS: -
Domoticz version: Offline
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by trixwood » Thursday 07 July 2016 13:56

It's really handy when you have to reset the z-wave controller and stuff is already mounted. But my Aeon Labs Aeotec Gen 5 Z-Wave does not encrypt zwave+ between aeon devices (multisensor6,...) if included with the button and not with the openzwave interface. Encryption is disabled by default at least on my stick.

Lazeebo
Posts: 4
Joined: Wednesday 06 July 2016 19:52
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by Lazeebo » Thursday 07 July 2016 19:23

Oh, I didn't know that. Well, I guess there is still much for me to learn... Thanks for sharing :)

User avatar
sincze
Posts: 704
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by sincze » Thursday 13 April 2017 17:35

I guess something is broken now?? As Zwave is devices are not working anymore and the ZWAVE configuration is totally empty.
zwave.JPG
zwave.JPG (14.7 KiB) Viewed 4787 times
zwave2.JPG
zwave2.JPG (43.73 KiB) Viewed 4787 times
Using Pass2php since 2016-12
LAN: RFLink, P1-Port, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266, Xiaomi Gateway
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

User avatar
sincze
Posts: 704
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by sincze » Thursday 13 April 2017 17:43

sincze wrote:I guess something is broken now?? As Zwave is devices are not working anymore and the ZWAVE configuration is totally empty.

zwave.JPG
zwave2.JPG

Code: Select all

 2017-04-13 17:42:31.591 OpenZWave: Starting...
2017-04-13 17:42:31.591 OpenZWave: Version: 1.4-2499-g636ec52-dirty
2017-04-13 17:42:31.592 OpenZWave: using config in: /home/linaro/domoticz/Config/
2017-04-13 17:42:32.605 OpenZWave: Received timeout notification from HomeID: 0, NodeID: 255 (0xff)
2017-04-13 17:42:33.607 OpenZWave: Received timeout notification from HomeID: 0, NodeID: 255 (0xff)
2017-04-13 17:42:34.610 OpenZWave: Received timeout notification from HomeID: 0, NodeID: 255 (0xff)
2017-04-13 17:42:35.612 OpenZWave: Received timeout notification from HomeID: 0, NodeID: 255 (0xff)
2017-04-13 17:42:35.589 (RFXCom) Temp + Humidity (TH7_Woonkamer)
2017-04-13 17:42:36.615 OpenZWave: Received timeout notification from HomeID: 0, NodeID: 255 (0xff) 
If I unplug and replug the stick my dmesg shows:

Code: Select all

[94521.140936] usb 5-1: USB disconnect, device number 2
[94540.446004] ehci_irq: port change detect
[94540.575920] ehci_irq: port change detect
[94540.925375] usb 5-1: new full-speed USB device number 3 using sw-ohci
[94541.121095] cdc_acm 5-1:1.0: This device cannot do calls on its own. It is not a modem.
[94541.130311] cdc_acm 5-1:1.0: ttyACM1: USB ACM device
So I need to update the port in the hardware settings
zwave.JPG
zwave.JPG (12.18 KiB) Viewed 4771 times
Using Pass2php since 2016-12
LAN: RFLink, P1-Port, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266, Xiaomi Gateway
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

User avatar
sincze
Posts: 704
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by sincze » Thursday 13 April 2017 19:16

The LED on the ZWAVE stick were not flashing anymore.
I unplugged the device.
Waited 30seconds.
Replugged the device.

The device was now recognized as ttyACM1.

Modified the settings in Domoticz. And now the network is back online
zwave-replugged.JPG
zwave-replugged.JPG (12.32 KiB) Viewed 4768 times
Using Pass2php since 2016-12
LAN: RFLink, P1-Port, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266, Xiaomi Gateway
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

vanathi
Posts: 8
Joined: Monday 29 May 2017 12:49
Target OS: Linux
Domoticz version:
Contact:

Re: USB handling (Raspberry Pi + Aeon Labs Z-stick + Domoticz)

Post by vanathi » Wednesday 31 May 2017 7:48

Instead of Raspberry pi,
I want to use Odroid C2 if it works well with Z-stick..?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests