Nrjavaserial upgrade causes "Serial Error: Port /dev/ttyACM0 does not exist"


(erland_lestander) #61

Thanks !
That's almost exactly what I did yesterday. :grinning:
apt-purge removes user openhab. which in turn meant that I needed to att the user to tty and dialout again after reinstall and after getting the good old Serial Error: Port /dev/ttyACM0 does not exist back when installing tellstick,astro and zwave.
On that, rebooting and back to current non working state.
no rules, no sitemap, no manual editing of files.

BUT:


I have not done this. IIRC, a change OH that required these was reverted between christmas and new year.
I will try and report back.

Can anyone confirm that those packages are required?

Edit: ./openhab2 start didn't change behaviour.
reboot: I got the initial webpage (Basic, Paper,Habmin, Classic) up for a few seconds, And then it died.

i am running wheezy unaware it was old.
pi@homeauto ~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

This may help
From /var/log/openah2/openhab.log:
2017-01-13 19:49:20.068 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at /start
2017-01-13 19:49:21.720 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-01-13 19:49:21.885 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-01-13 19:49:22.157 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2017-01-13 19:49:24.097 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2017-01-13 19:49:28.302 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyACM0'
2017-01-13 19:49:28.397 [INFO ] [andler.core.TelldusCoreBridgeHandler] - Loading telldus-core from C:/Program Files/Telldus/;C:/Program Files (x86)/Telldus/

Notice: it says andler arthome ing.zwave Is that okey?
Also, loading from c:\xxx looks strange.

How can I remove the tellstick binding?


(erland_lestander) #62

As all was lost, I edited
/var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.Thing.json
down to
{}

And lo and behold , Openhab started!!!
When all else fails , use vi .

Edit 1:
Started PaperUI, it discovered tellstick.
I pressed the check button and OH reads att the items configured in tellstick/telldus center!
I choose not to att the immediately, instead I do a
reboot !
OH starts after reboot! - I'm still happy.

Edit 2: All tellstick items added thru PaperUI.
Rebooted ok!

Edit 3:
Added zwave (Aeon) manually on /dev/ttyACM0 . :frowning: Got
error -1-
error undefined-undefined

Closing in ...

Edit 4: OH chrasched after those errors.


(erland_lestander) #63

jsondb zwave entry

  "zwave:serial_zstick:0f30e162": {
    "class": "org.eclipse.smarthome.core.thing.internal.BridgeImpl",
    "value": {
      "label": "Z-Wave Serial Controller",
      "channels": [
        {
          "acceptedItemType": "Number",
          "kind": "STATE",
          "uid": {
            "segments": [
              "zwave",
              "serial_zstick",
              "0f30e162",
              "serial_sof"
            ]
          },
          "channelTypeUID": {
            "segments": [
              "zwave",
              "serial_sof"
            ]
          },
          "configuration": {
            "properties": {}
          },
          "properties": {},
          "defaultTags": []
        },
        {
          "acceptedItemType": "Number",
          "kind": "STATE",
          "uid": {
            "segments": [
              "zwave",
              "serial_zstick",
              "0f30e162",
              "serial_ack"
            ]
          },
          "channelTypeUID": {
            "segments": [
              "zwave",
              "serial_ack"
            ]
          },
          "configuration": {
            "properties": {}
          },
          "properties": {},
          "defaultTags": []
        },
        {
          "acceptedItemType": "Number",
          "kind": "STATE",
          "uid": {
            "segments": [
              "zwave",
              "serial_zstick",
              "0f30e162",
              "serial_nak"
            ]
          },
          "channelTypeUID": {
            "segments": [
              "zwave",
              "serial_nak"
            ]
          },
          "configuration": {
            "properties": {}
          },
          "properties": {},
          "defaultTags": []
        },
        {
          "acceptedItemType": "Number",
          "kind": "STATE",
          "uid": {
            "segments": [
              "zwave",
              "serial_zstick",
              "0f30e162",
              "serial_can"
            ]
          },
          "channelTypeUID": {
            "segments": [
              "zwave",
              "serial_can"
            ]
          },
          "configuration": {
            "properties": {}
          },
          "properties": {},
          "defaultTags": []
        },
        {
          "acceptedItemType": "Number",
          "kind": "STATE",
          "uid": {
            "segments": [
              "zwave",
              "serial_zstick",
              "0f30e162",
              "serial_oof"
            ]
          },
          "channelTypeUID": {
            "segments": [
              "zwave",
              "serial_oof"
            ]
          },
          "configuration": {
            "properties": {}
          },
          "properties": {},
          "defaultTags": []
        }
      ],
      "configuration": {
        "properties": {
          "controller_softreset": 0,
          "security_networkkey": "9E **** EDITED ***** 0B 81",
          "security_inclusionmode": 0,
          "controller_suc": false,
          "controller_sync": 0,
          "port": "/dev/ttyACM0",
          "controller_master": true,
          "inclusion_mode": 2,
          "controller_wakeupperiod": 3600,
          "heal_time": 2,
          "controller_exclude": 0,
          "controller_inclusiontimeout": 30,
          "controller_hardreset": 0
        }
      },
      "properties": {},
      "uid": {
        "segments": [
          "zwave",
          "serial_zstick",
          "0f30e162"
        ]
      },
      "thingTypeUID": {
        "segments": [
          "zwave",
          "serial_zstick"
        ]
      }
    }
  }
}

I will remove it to see if i can start OH.

Edit 1: zwave entry brutally removed.
- OH starts!

Edit2: Added zwave manually thru PaperUI and inbox.
Deliberately set port to /dev/noSuchPort
NO ERRORS !!! Except for zwave device being online which was expected.
OH still runs !

Edit 3:
Changed device to 'correct' device i.e, /dev/ttyACM0.
Saved and OH crasched !

From here on, any help is appreciated.

Edit 4:
Interesting and it surprised me:
The jsondb file said:

"controller_suc": false,
"controller_sync": 0,
"port": "/dev/noSuchPort",
"controller_master": true,
"inclusion_mode": 2,
"controller_wakeupperiod": 3600,
"heal_time": 2,
"controller_exclude": 0,
"controller_inclusiontimeout": 30,
"controller_hardreset": 0

Note that the device entry is not updated with the one that crasched...
And I can restart, and it still holds the fake device.

So it crasched immediately when I put in /dev/ttyACM0 , without even saving it to the DB.
What gives ?

Edit 5:
stopped OH.
Entered /dev/ttyACM0 in jsondb.
started OH and it crasched immediately


(Chris Van Orman) #64

The current build of nrjavaserial requires glibc >= 2.15. Debian Wheezy has glibc 2.13 and so it will crash on that platform.

You can follow the issue here: https://github.com/openhab/openhab-core/issues/111


(erland_lestander) #65

Thanks! Now I understand the issues I'm seeing.


(da_kurgan) #66

That solved it for me. Ran on Wheezy so a clean install with Jessie and my Razberry is now working again.


(Rob B) #67

Nice to have a succinct answer to this problem. :slight_smile:


(Michael Aschenborn) #68

I just installed a fresh openhabian today and get the "Port /dev/ttyACM0 does not exist" error.
After reading this thread I don't understand the best solution...
Is there a fix available?


(erland_lestander) #69

First, it may not work yet ...
But let's cover the basics:
installed using apt-get ? if so, make sure the user is added to the group dialout.

dialout:x:20:pi,openhab

(I also aadded openhab to the tty group , but I don't think that is needed)

And make sure the grou can read and write to the port
crw-rw---T 1 root dialout 166, 0 Jan 1 1970 ttyACM0

Are you using the production release? Or rather , what version are you using?


(Brandon Johnson) #70

I was just running into this following the instructions here helped me get past the "port /dev/tty... does not exist"

However I still can not able discover the Razberry card.

Here are my logs:

09:49:43.183 [INFO ] [smarthome.event.ItemAddedEvent      ] - Item 'zwave_serial_zstick_1aa30a97_serial_sof' has been added.
09:49:43.185 [INFO ] [smarthome.event.ItemAddedEvent      ] - Item 'zwave_serial_zstick_1aa30a97_serial_ack' has been added.
09:49:43.188 [INFO ] [smarthome.event.ItemAddedEvent      ] - Item 'zwave_serial_zstick_1aa30a97_serial_nak' has been added.
09:49:43.192 [INFO ] [smarthome.event.ItemAddedEvent      ] - Item 'zwave_serial_zstick_1aa30a97_serial_can' has been added.
09:49:43.197 [INFO ] [smarthome.event.ItemAddedEvent      ] - Item 'zwave_serial_zstick_1aa30a97_serial_oof' has been added.
09:49:43.248 [INFO ] [smarthome.event.ThingAddedEvent     ] - Thing 'zwave:serial_zstick:1aa30a97' has been added.
09:49:43.291 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Initializing ZWave serial controller.
09:49:43.292 [DEBUG] [zwave.handler.ZWaveControllerHandler] - Initializing ZWave Controller.
09:49:43.301 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'zwave:serial_zstick:1aa30a97' changed from UNINITIALIZED to INITIALIZING
09:49:43.329 [INFO ] [smarthome.event.ThingUpdatedEvent   ] - Thing 'zwave:serial_zstick:1aa30a97' has been updated.
09:49:43.331 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyAMA0'
09:49:43.337 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'zwave:serial_zstick:1aa30a97' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE): Controller is offline
09:49:43.338 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Starting receive thread
09:49:43.341 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Serial port is initialized
09:49:43.341 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Starting ZWave thread: Receive
09:49:43.342 [DEBUG] [zwave.handler.ZWaveControllerHandler] - Initialising ZWave controller
09:49:43.343 [INFO ] [mmandclass.ZWaveSecurityCommandClass] - Update networkKey
09:49:43.346 [INFO ] [ve.internal.protocol.ZWaveController] - Starting ZWave controller
09:49:43.348 [INFO ] [ve.internal.protocol.ZWaveController] - ZWave timeout is set to 5000ms. Soft reset is false.
09:49:43.354 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Starting ZWave thread: Send
09:49:43.355 [DEBUG] [ve.internal.protocol.ZWaveController] - Starting ZWave thread: Input
09:49:43.355 [DEBUG] [wave.discovery.ZWaveDiscoveryService] - Activating ZWave discovery service for zwave:serial_zstick:1aa30a97
09:49:43.364 [DEBUG] [org.openhab.binding.zwave           ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=326, service.bundleid=211, service.scope=singleton} - org.openhab.binding.zwave
09:49:46.352 [DEBUG] [.ZWaveController$InitializeDelayTask] - Initialising network
09:49:46.354 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 1. Queue={}
09:49:46.355 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 0
09:49:46.356 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 1. Queue={}
09:49:46.357 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 15 E9 
09:49:46.360 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 15 E9 
09:49:46.360 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 2. Queue={}
09:49:46.366 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 3. Queue={}
09:49:46.368 [DEBUG] [rialmessage.GetSucNodeIdMessageClass] - Get SUC NodeID
09:49:46.372 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 4. Queue={}
09:49:51.381 [ERROR] [ocol.ZWaveController$ZWaveSendThread] - NODE 255: Timeout while sending message. Requeueing - 2 attempts left!
09:49:51.382 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 5. Queue={}
09:49:51.384 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 4
09:49:51.387 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 15 E9 
09:49:51.389 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 15 E9 
09:49:56.401 [ERROR] [ocol.ZWaveController$ZWaveSendThread] - NODE 255: Timeout while sending message. Requeueing - 1 attempts left!
09:49:56.408 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 5. Queue={}
09:49:56.409 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 4
09:49:56.412 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 15 E9 
09:49:56.414 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 15 E9 
09:50:01.431 [ERROR] [ocol.ZWaveController$ZWaveSendThread] - NODE 255: Timeout while sending message. Requeueing - 0 attempts left!
09:50:01.439 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 5. Queue={}
09:50:01.441 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 4
09:50:01.443 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 15 E9 
09:50:01.446 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 15 E9 
09:50:06.462 [WARN ] [ocol.ZWaveController$ZWaveSendThread] - NODE 255: Too many retries. Discarding message: Message: class=GetVersion[0x15], type=Request[0x00], priority=High, dest=255, callback=0, payload=
09:50:06.470 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 3
09:50:06.473 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 20 DC 
09:50:06.475 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 20 DC 
09:50:11.491 [ERROR] [ocol.ZWaveController$ZWaveSendThread] - NODE 255: Timeout while sending message. Requeueing - 2 attempts left!
09:50:11.498 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 4. Queue={}
09:50:11.499 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 3
09:50:11.502 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 20 DC 
09:50:11.504 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 20 DC 
09:50:16.521 [ERROR] [ocol.ZWaveController$ZWaveSendThread] - NODE 255: Timeout while sending message. Requeueing - 1 attempts left!
09:50:16.522 [DEBUG] [ve.internal.protocol.ZWaveController] - Message queued. Queue length = 4. Queue={}
09:50:16.529 [DEBUG] [ocol.ZWaveController$ZWaveSendThread] - Took message from queue for sending. Queue length = 3
09:50:16.531 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 20 DC 
09:50:16.533 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 20 DC

For fun I tried the zway software and it seemed to pick up the zwave controller but I really don't want to go down that route.


(Rob B) #71

Try running
sudo openhabian-config
and select option 20 Serial Port.
This script should set your serial port up on Openhabian. I found it worked flawlessly.


(happenpappen) #72

On my system the zwave 2.2 binding isn’t working as well. My system is a Raspberry Pi 3 with Raspian 9 (stretch) and openHAB 2.2.0 installed from the ZIP archive. As Z-Wave controller i’m using an Aeotec Z-stick Gen5 which is connected to /dev/ttyACM0. The stick is working without any problem, when i replace the z-wave 2.2 binding by the 1.x version, so file access and jvm-startup options are correctly set. My zwave.cfg file for zwave1 binding in the services folder contains these settings:

port=/dev/USBzwave
healtime=2
softReset=false
masterController=true
setSUC=true

The file “/dev/USBzwave” is a link to the correct device file which is created by an udev rule.

To solve the issue with the zwave2 binding I already tried:

  • removing the serial console from /boot/cmdline.txt
  • had installed liblockdev1 and liblockdev1-dev packages (might be it was on Raspian 8 (jessie) and not with the current version, because i can’t find the packages in the stretch repos)

When i deploy the zwave2 binding, i can’t select the correct usb port in the settings of the controller. The drop-down box only lists one port (/dev/ttyUSB37) which is actually a link to a virtual device create by socat, all other ports are not listed. I selected this, shut down openHAB and replaced this port by the correct one in the org.eclipse.smarthome.core.thing.Thing.json file. When re-starting openHAB in the controller thing the error message in the topic of this thread is shown… I’m rather clueless at this and don’t know what to do to get the zwave2 binding to work.

Maybe my descriptions help someone debugging this - i would be glad by helping to solve this, just tell me what to do.

kind regards,

Christoph


(Ben Clark) #73

Since you’re using the manual installation method, does setting the environment variable

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0"

Do anything?


(happenpappen) #74

Hi Ben,

since i’m using some other serial ports as well, the jvm is started with:

-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0:/dev/ttyUSB0:/dev/ttyUSB37:/dev/ttyUSB38:/dev/USBrfxcom:/dev/USBzwave:/dev/ttyAMA0

where /dev/ttyACM0 is the port where the Aeotec stick is plugged in. The other ports work, in port /dev/ttyUSB0 i have a RFXtrx433E tranceiver for example. When using the zwave1 binding the port is accessible as well…

kind regards,

Christoph


(Ben Clark) #75

Right, I’ve got a similar setup (multiple serial devices and the Aeotec Stick) but it’s working for me. Other things to try:

  1. Is there a LCK file in /var/run/lock that has persisted while using the 1.x binding? Try deleting it.
  2. I’m assuming that all the openhab.log states is the “does not exist error”.
  3. What is the version of nrjavaserial in the Karaf console?

(happenpappen) #76

Hi Ben,

thank you for your fast response, i’ve look after the things you asked:

No, i wasn’t able to find any LCK file on the system. In fact on Raspbian 9 there is no directory “/var/run/lock”, there is a symbolic link “/var/lock” which points to “/run/lock”.

The strange thing is, that in the zwave.log file (i’ve customized the logging settings) there is only an entry about connecting to the serial device, while in PaperUI there is the massage “Serial Error: Port /dev/ttyACM0 does not exist” (when using the zwave2 binding). I’ll switch to DEBUG logging this evening and look if there will be more logging entries while connecting.

How can i find the version number of nrjavaserial in Karaf console? In the openHAB directory there is this jar file:

./runtime/system/org/openhab/nrjavaserial/3.12.0.OH/nrjavaserial-3.12.0.OH.jar

So nrjavaserial version is 3.12.0?

kind regards,

Christoph


(SiHui) #77

list|grep -i nrj

25 │ Active │ 80 │ 3.12.0.OH │ nrjavaserial


(happenpappen) #78

Thank you, the output on my system is the same as on yours.


(happenpappen) #79

Switched on debugging this evening, this is the result when starting the zwave2 binding:

14-Feb-2018 16:45:47.469 [DEBUG] [org.openhab.binding.zwave.internal.ZWaveActivator ] - Z-Wave binding started. Version 2.2.0
14-Feb-2018 16:45:47.655 [DEBUG] [org.openhab.binding.zwave                         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=org.openhab.binding.zwave.internal.ZWaveHandlerFactory, component.id=285, service.id=445, service.bundleid=317, service.scope=bundle} - org.openhab.binding.zwave
14-Feb-2018 16:45:47.685 [DEBUG] [org.openhab.binding.zwave                         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.events.EventFactory}={component.name=org.openhab.binding.zwave.event.BindingEventFactory, component.id=287, service.id=446, service.bundleid=317, service.scope=bundle} - org.openhab.binding.zwave
14-Feb-2018 16:45:48.132 [DEBUG] [org.openhab.binding.zwave                         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.core.ConfigOptionProvider, org.eclipse.smarthome.config.core.ConfigDescriptionProvider}={component.name=org.openhab.binding.zwave.ConfigDescription, component.id=289, service.id=447, service.bundleid=317, service.scope=bundle} - org.openhab.binding.zwave
14-Feb-2018 16:45:48.135 [DEBUG] [org.openhab.binding.zwave                         ] - BundleEvent STARTED - org.openhab.binding.zwave
14-Feb-2018 16:45:52.689 [DEBUG] [g.openhab.binding.zwave.handler.ZWaveSerialHandler] - Initializing ZWave serial controller.
14-Feb-2018 16:45:52.691 [DEBUG] [enhab.binding.zwave.handler.ZWaveControllerHandler] - Initializing ZWave Controller.
14-Feb-2018 16:45:52.709 [INFO ] [g.openhab.binding.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyACM0'

The logs just stop after the “Connecting to…” message. When using the zwave1 binding the continue after this point with some messages about starting Send/Receive threads and so on…

kind regards,

Christoph