PaperUI unable to select ttyUSB1

The ttyAMA0 is listed but not sure why this is important as I want to be able to use two USB serial adaptors which are listed as ttyUSB0 and ttyUSB1 in ls -la /dev. Should I modify them in the files with =/dev/ttyUSB0), /dev/ttyUSB1?

Once I get that working I might address the labelling of the serial ports so that they can be plugged in randomly.

Can you provide a screen shot with the above outputs? AMA0 is listed tell’s nothing other than it’s listed. What are its permissions? Is it linked? If linked, whats the name? etc… for all the other info that’s needed to help troubleshoot an issue.

I would very much like to help solve your issue but with vague information this post may become extremely long with wild guesses from every direction.

Will post info tomorrow, many thanks.

I checked the two files you requested but neither exist. I do have a /etc/init/d/openhab2 file but no -Dosgi.noShutdown entry to put new line under. Below are the outputs you requested

[14:04:09] openhabian@openHABianPi:~$ dmesg -T | grep tty
[Mon Aug 13 16:57:05 2018] Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/sda1 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[Mon Aug 13 16:57:05 2018] console [tty1] enabled
[Mon Aug 13 16:57:05 2018] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[Mon Aug 13 16:57:22 2018] usb 1-1.4: cp210x converter now attached to ttyUSB0
[Mon Aug 13 16:57:22 2018] usb 1-1.3: pl2303 converter now attached to ttyUSB1
[Mon Aug 13 17:13:43 2018] pl2303 ttyUSB1: pl2303 converter now disconnected from ttyUSB1
[Tue Aug 14 13:54:06 2018] usb 1-1.3: pl2303 converter now attached to ttyUSB1

[14:07:20] openhabian@openHABianPi:~$ ls -l /dev/ttyAMA0
crw-rw---- 1 root dialout 204, 64 Aug 13 16:57 /dev/ttyAMA0

[14:08:36] openhabian@openHABianPi:~$ ls -la /dev
total 4
drwxr-xr-x 16 root root        3420 Aug 14 13:54 .
drwxr-xr-x 22 root root        4096 Aug  6 18:34 ..
crw-r--r--  1 root root     10, 235 Aug 13 16:57 autofs
drwxr-xr-x  2 root root         620 Aug 13 16:57 block
drwxr-xr-x  2 root root          60 Jan  1  1970 bsg
crw-------  1 root root     10, 234 Aug 13 16:56 btrfs-control
drwxr-xr-x  3 root root          60 Jan  1  1970 bus
crw-------  1 root root     10,  63 Aug 13 16:57 cachefiles
drwxr-xr-x  2 root root        2540 Aug 14 13:54 char
crw-------  1 root root      5,   1 Aug 13 16:57 console
crw-------  1 root root     10,  62 Aug 13 16:57 cpu_dma_latency
crw-------  1 root root     10, 203 Aug 13 16:56 cuse
drwxr-xr-x  7 root root         140 Aug 13 16:57 disk
crw-rw----  1 root video    29,   0 Aug 13 16:57 fb0
lrwxrwxrwx  1 root root          13 Nov  3  2016 fd -> /proc/self/fd
crw-rw-rw-  1 root root      1,   7 Aug 13 16:57 full
crw-rw-rw-  1 root root     10, 229 Aug 13 16:56 fuse
crw-rw----  1 root gpio    254,   0 Aug 13 16:57 gpiochip0
crw-rw----  1 root gpio    254,   1 Aug 13 16:57 gpiochip1
crw-rw----  1 root gpio    254,   2 Aug 13 16:57 gpiochip2
crw-rw----  1 root gpio    248,   0 Aug 13 16:57 gpiomem
crw-------  1 root root     10, 183 Aug 13 16:57 hwrng
lrwxrwxrwx  1 root root          25 Nov  3  2016 initctl -> /run/systemd/initctl/fifo
drwxr-xr-x  2 root root          60 Jan  1  1970 input
crw-r--r--  1 root root      1,  11 Aug 13 16:57 kmsg
lrwxrwxrwx  1 root root          28 Nov  3  2016 log -> /run/systemd/journal/dev-log
brw-rw----  1 root disk      7,   0 Aug 13 16:57 loop0
brw-rw----  1 root disk      7,   1 Aug 13 16:57 loop1
brw-rw----  1 root disk      7,   2 Aug 13 16:57 loop2
brw-rw----  1 root disk      7,   3 Aug 13 16:57 loop3
brw-rw----  1 root disk      7,   4 Aug 13 16:57 loop4
brw-rw----  1 root disk      7,   5 Aug 13 16:57 loop5
brw-rw----  1 root disk      7,   6 Aug 13 16:57 loop6
brw-rw----  1 root disk      7,   7 Aug 13 16:57 loop7
crw-rw----  1 root disk     10, 237 Aug 13 16:57 loop-control
drwxr-xr-x  2 root root          60 Aug 13 16:56 mapper
crw-r-----  1 root kmem      1,   1 Aug 13 16:57 mem
crw-------  1 root root     10,  59 Aug 13 16:57 memory_bandwidth
brw-rw----  1 root disk    179,   0 Aug 13 16:57 mmcblk0
brw-rw----  1 root disk    179,   1 Aug 13 16:57 mmcblk0p1
brw-rw----  1 root disk    179,   2 Aug 13 16:57 mmcblk0p2
drwxrwxrwt  2 root root          40 Jan  1  1970 mqueue
drwxr-xr-x  2 root root          60 Aug 13 16:56 net
crw-------  1 root root     10,  61 Aug 13 16:57 network_latency
crw-------  1 root root     10,  60 Aug 13 16:57 network_throughput
crw-rw-rw-  1 root root      1,   3 Aug 13 16:57 null
crw-------  1 root root    108,   0 Aug 13 16:56 ppp
crw-rw-rw-  1 root tty       5,   2 Aug 14 14:08 ptmx
drwxr-xr-x  2 root root           0 Nov  3  2016 pts
brw-rw----  1 root disk      1,   0 Aug 13 16:57 ram0
brw-rw----  1 root disk      1,   1 Aug 13 16:57 ram1
brw-rw----  1 root disk      1,  10 Aug 13 16:57 ram10
brw-rw----  1 root disk      1,  11 Aug 13 16:57 ram11
brw-rw----  1 root disk      1,  12 Aug 13 16:57 ram12
brw-rw----  1 root disk      1,  13 Aug 13 16:57 ram13
brw-rw----  1 root disk      1,  14 Aug 13 16:57 ram14
brw-rw----  1 root disk      1,  15 Aug 13 16:57 ram15
brw-rw----  1 root disk      1,   2 Aug 13 16:57 ram2
brw-rw----  1 root disk      1,   3 Aug 13 16:57 ram3
brw-rw----  1 root disk      1,   4 Aug 13 16:57 ram4
brw-rw----  1 root disk      1,   5 Aug 13 16:57 ram5
brw-rw----  1 root disk      1,   6 Aug 13 16:57 ram6
brw-rw----  1 root disk      1,   7 Aug 13 16:57 ram7
brw-rw----  1 root disk      1,   8 Aug 13 16:57 ram8
brw-rw----  1 root disk      1,   9 Aug 13 16:57 ram9
crw-rw-rw-  1 root root      1,   8 Aug 13 16:57 random
drwxr-xr-x  2 root root          60 Jan  1  1970 raw
crw-rw-r--  1 root netdev   10,  58 Aug 13 16:57 rfkill
brw-rw----  1 root disk      8,   0 Aug 13 16:57 sda
brw-rw----  1 root disk      8,   1 Aug 13 16:57 sda1
drwxr-xr-x  4 root root          80 Aug 13 16:57 serial
lrwxrwxrwx  1 root root           7 Aug 13 16:57 serial1 -> ttyAMA0
crw-rw----  1 root disk     21,   0 Aug 13 16:57 sg0
drwxrwxrwt  2 root root          40 Nov  3  2016 shm
drwxr-xr-x  3 root root         160 Aug 13 16:57 snd
lrwxrwxrwx  1 root root          15 Nov  3  2016 stderr -> /proc/self/fd/2
lrwxrwxrwx  1 root root          15 Nov  3  2016 stdin -> /proc/self/fd/0
lrwxrwxrwx  1 root root          15 Nov  3  2016 stdout -> /proc/self/fd/1
crw-rw-rw-  1 root tty       5,   0 Aug 14 13:58 tty
crw--w----  1 root tty       4,   0 Aug 13 16:57 tty0
crw--w----  1 root tty       4,   1 Aug 13 16:57 tty1
crw--w----  1 root tty       4,  10 Aug 13 16:57 tty10
crw--w----  1 root tty       4,  11 Aug 13 16:57 tty11
crw--w----  1 root tty       4,  12 Aug 13 16:57 tty12
crw--w----  1 root tty       4,  13 Aug 13 16:57 tty13
crw--w----  1 root tty       4,  14 Aug 13 16:57 tty14
crw--w----  1 root tty       4,  15 Aug 13 16:57 tty15
crw--w----  1 root tty       4,  16 Aug 13 16:57 tty16
crw--w----  1 root tty       4,  17 Aug 13 16:57 tty17
crw--w----  1 root tty       4,  18 Aug 13 16:57 tty18
crw--w----  1 root tty       4,  19 Aug 13 16:57 tty19
crw--w----  1 root tty       4,   2 Aug 13 16:57 tty2
crw--w----  1 root tty       4,  20 Aug 13 16:57 tty20
crw--w----  1 root tty       4,  21 Aug 13 16:57 tty21
crw--w----  1 root tty       4,  22 Aug 13 16:57 tty22
crw--w----  1 root tty       4,  23 Aug 13 16:57 tty23
crw--w----  1 root tty       4,  24 Aug 13 16:57 tty24
crw--w----  1 root tty       4,  25 Aug 13 16:57 tty25
crw--w----  1 root tty       4,  26 Aug 13 16:57 tty26
crw--w----  1 root tty       4,  27 Aug 13 16:57 tty27
crw--w----  1 root tty       4,  28 Aug 13 16:57 tty28
crw--w----  1 root tty       4,  29 Aug 13 16:57 tty29
crw--w----  1 root tty       4,   3 Aug 13 16:57 tty3
crw--w----  1 root tty       4,  30 Aug 13 16:57 tty30
crw--w----  1 root tty       4,  31 Aug 13 16:57 tty31
crw--w----  1 root tty       4,  32 Aug 13 16:57 tty32
crw--w----  1 root tty       4,  33 Aug 13 16:57 tty33
crw--w----  1 root tty       4,  34 Aug 13 16:57 tty34
crw--w----  1 root tty       4,  35 Aug 13 16:57 tty35
crw--w----  1 root tty       4,  36 Aug 13 16:57 tty36
crw--w----  1 root tty       4,  37 Aug 13 16:57 tty37
crw--w----  1 root tty       4,  38 Aug 13 16:57 tty38
crw--w----  1 root tty       4,  39 Aug 13 16:57 tty39
crw--w----  1 root tty       4,   4 Aug 13 16:57 tty4
crw--w----  1 root tty       4,  40 Aug 13 16:57 tty40
crw--w----  1 root tty       4,  41 Aug 13 16:57 tty41
crw--w----  1 root tty       4,  42 Aug 13 16:57 tty42
crw--w----  1 root tty       4,  43 Aug 13 16:57 tty43
crw--w----  1 root tty       4,  44 Aug 13 16:57 tty44
crw--w----  1 root tty       4,  45 Aug 13 16:57 tty45
crw--w----  1 root tty       4,  46 Aug 13 16:57 tty46
crw--w----  1 root tty       4,  47 Aug 13 16:57 tty47
crw--w----  1 root tty       4,  48 Aug 13 16:57 tty48
crw--w----  1 root tty       4,  49 Aug 13 16:57 tty49
crw--w----  1 root tty       4,   5 Aug 13 16:57 tty5
crw--w----  1 root tty       4,  50 Aug 13 16:57 tty50
crw--w----  1 root tty       4,  51 Aug 13 16:57 tty51
crw--w----  1 root tty       4,  52 Aug 13 16:57 tty52
crw--w----  1 root tty       4,  53 Aug 13 16:57 tty53
crw--w----  1 root tty       4,  54 Aug 13 16:57 tty54
crw--w----  1 root tty       4,  55 Aug 13 16:57 tty55
crw--w----  1 root tty       4,  56 Aug 13 16:57 tty56
crw--w----  1 root tty       4,  57 Aug 13 16:57 tty57
crw--w----  1 root tty       4,  58 Aug 13 16:57 tty58
crw--w----  1 root tty       4,  59 Aug 13 16:57 tty59
crw--w----  1 root tty       4,   6 Aug 13 16:57 tty6
crw--w----  1 root tty       4,  60 Aug 13 16:57 tty60
crw--w----  1 root tty       4,  61 Aug 13 16:57 tty61
crw--w----  1 root tty       4,  62 Aug 13 16:57 tty62
crw--w----  1 root tty       4,  63 Aug 13 16:57 tty63
crw--w----  1 root tty       4,   7 Aug 13 16:57 tty7
crw--w----  1 root tty       4,   8 Aug 13 16:57 tty8
crw--w----  1 root tty       4,   9 Aug 13 16:57 tty9
crw-rw----  1 root dialout 204,  64 Aug 13 16:57 ttyAMA0
crw-------  1 root root      5,   3 Aug 13 16:57 ttyprintk
crw-rw----  1 root dialout 188,   0 Aug 14 14:08 ttyUSB0
crw-rw----  1 root dialout 188,   1 Aug 14 13:54 ttyUSB1
crw-------  1 root root     10, 239 Aug 13 16:56 uhid
crw-------  1 root root     10, 223 Aug 13 16:56 uinput
crw-rw-rw-  1 root root      1,   9 Aug 13 16:57 urandom
crw-rw----  1 root video   246,   0 Aug 13 16:57 vchiq
crw-rw----  1 root video   249,   0 Aug 13 16:57 vcio
crw-------  1 root root    250,   0 Aug 13 16:57 vc-mem
crw-rw----  1 root tty       7,   0 Aug 13 16:57 vcs
crw-rw----  1 root tty       7,   1 Aug 13 16:57 vcs1
crw-rw----  1 root tty       7,   2 Aug 13 16:57 vcs2
crw-rw----  1 root tty       7,   3 Aug 13 16:57 vcs3
crw-rw----  1 root tty       7,   4 Aug 13 16:57 vcs4
crw-rw----  1 root tty       7,   5 Aug 13 16:57 vcs5
crw-rw----  1 root tty       7,   6 Aug 13 16:57 vcs6
crw-rw----  1 root tty       7, 128 Aug 13 16:57 vcsa
crw-rw----  1 root tty       7, 129 Aug 13 16:57 vcsa1
crw-rw----  1 root tty       7, 130 Aug 13 16:57 vcsa2
crw-rw----  1 root tty       7, 131 Aug 13 16:57 vcsa3
crw-rw----  1 root tty       7, 132 Aug 13 16:57 vcsa4
crw-rw----  1 root tty       7, 133 Aug 13 16:57 vcsa5
crw-rw----  1 root tty       7, 134 Aug 13 16:57 vcsa6
crw-------  1 root root     10, 137 Aug 13 16:56 vhci
crw-------  1 root root     10, 130 Aug 13 16:57 watchdog
crw-------  1 root root    252,   0 Aug 13 16:57 watchdog0
crw-rw-rw-  1 root root      1,   5 Aug 13 16:57 zero

Thanks, this will help. Do you have any errors in your logs regarding modbus, if so please post.

Looking at ls -l /dev/ttyAMA0 output the owner is root and user is dialout. Should this be tty instead of dialout? Asking cause I’m not sure but currently looking thru some doc’s to find out. If you know that it’s correct let me know.

Edit: Do you have a modbus.cfg file, if so please post the contents.

Think I may have overlooked something. Your not able to select ttyUSB1 and looking back over the post it may not be added to the EXTRA JAVA OPTS if you copied the examples above EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"

I dont see /dev/ttyUSB1 included. Add the /dev/ttyUSB1 to your extra java opts file and save.
Then run this:
sudo service openhab2 stop && sudo rm -rf /var/lib/openhab2/cache/* && sudo rm -rf /var/lib/openhab2/tmp/* && sudo reboot
to clean up the cache & temp files as well as reboot the system. Then you should be able to see and select the USB1.

I had already added the /dev/ttyUSB1 to the EXTRA JAVA OPTs but tried your clean up commands but still no luck. Neither the Heat Pump binding or Mod Bus binding can select anything but ttyUSB0. I know both USB ports work as I have got the Heat Pump going via the PaperUI and ModBus via text files. As I now have got it working for both I am giving up on the PaperUI issue and will use the text files for the ModBus as a work around.
Many thanks for all your help.

One last thing, both will work but only one at a time correct?

If so, look back at the output of ls -la /dev I see ttyAMA0 and a soft link to serial1. What I don’t see is the other serial having a soft link, its a directory, with no write access for the user and group. :thinking:

Both work and can use the heat pump on USB0 selected in PaperUI and Modbus selects USB1 in the things file.

But you need two serial devices to work at the same time. Compare your output with this screen shot.:astonished:

Screenshot%20at%202018-08-14%2016-37-25

On the RPI3 board the AMA serial is used for the Bluetooth connection. There are two serial ports enabled and these can be seen to be linked to their ttyUSBx devices in /dev/erial/by-id directory

[10:10:34] openhabian@openhabtest:~$ ls -all /dev/serial/by-id
total 0
drwxr-xr-x 2 root root 80 Aug 16 10:01 .
drwxr-xr-x 4 root root 80 Aug 16 10:01 …
lrwxrwxrwx 1 root root 13 Aug 16 10:01 usb-1a86_USB2.0-Serial-if00-port0 -> …/…/ttyUSB0
lrwxrwxrwx 1 root root 13 Aug 16 10:01 usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0 -> …/…/ttyUSB1

Got back to this as it is still causing problems and is inconsistent in its presentation. Not figured out how but occasionally when using the PaperUI I can edit the serial port location, other times only offers ports available in the drop down.
I have created links to fix ttyUSB0 and ttyUSB1 to specific interfaces called ttyModBus and ttyRego,

SUBSYSTEM=="tty", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="ttyUSBModBus", GROUP="dialout", MODE="0666"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="ttyUSBRego", GROUP="dialout", MODE="0666"

added

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/ttyUSB0:/dev/tty/USB1:/dev/ttyRego:/dev/ttyModBus"

These ports are passed to the openhab2.service and appear in the

sytemctl status openhab2.service
  

-Dgnu.io.rxtx.SerialPorts=/ttyUSB0:/dev/tty/USB1:/dev/ttyRego:/dev/ttyModBus

 but when I check via the console for the env variable it only lists 

```javascript
String  gnu.io.rxtx.SerialPorts /dev/ttyUSB1

I have cleaned the cache using openhab-cli but makes no difference, only ttyUSB1 is offered in the PaperUI for selection as this appears to be the only port JAVA is seeing.

Tried editing the json things file and it reported

[hingStatusInfoChangedEvent] - 'regoheatpump:serialRego6xx:53f727c3' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Serial port with name /dev/ttyRego does not exist. Available port names: [/dev/ttyAMA0, /dev/ttyUSB1, /dev/ttyUSB0]

and the env variable now has four ports appearing but the last is truncated.

String          gnu.io.rxtx.SerialPorts /ttyUSB0:/dev/tty/USB1:/dev/ttyRego:/dev/ttyM

Any ideas why the other ports aren’t available and why on USB1 is offered?

I am running on an RPI 3B having moved Root to an external USB hard drive so unlikely to be SD card issues

openHAB Distribution Version Information
----------------------------------------
build-no        : Milestone Build
online-repo     : https://openhab.jfrog.io/openhab/online-repo-milestone/2.4

Repository        Version
----------------------------------------
openhab-distro  : 2.4.0.M3
smarthome       : 0.10.0.oh240M3
openhab-core    : 2.4.0.M3
openhab1-addons : 1.13.0.M3
openhab2-addons : 2.4.0.M3
karaf           : 4.1.5

Here’s a post about symlinks and issues that may help.
https://community.openhab.org/t/raspberry-pi-make-serial-usb-ports-persistent-via-symlinks/35847

Also, have you looked if there may be a change to the modbus.cfg (/etc/openhab2/services) file for your setup?

Thanks for the link, checked it out and I have done all that they recommend. I have been configuring the ModBus using things file

Bridge modbus:serial:endpoint [ port="/dev/ttyModBus", baud = 9600,stopBits = "1", parity = "none", dataBits = 8, encoding ="rtu" ] {
    Bridge poller holding [ start=1032, length=2, refresh=30000, type="holding"] {
       Thing data HeatMeter_HeatPower    [readStart="1032", readValueType="float32",readTransform="default" ]      
    }   
}

Same problem arises, reports port not found.
I am sure it must be a problem with the JAVA port access as although I tell JAVA to use four ports the env lists only tty USB0

The modbus.cfg file says you can override settings if errors with default parameters. Not sure if this will solve the issue but may be worth trying.

EDIT: Since you have a udev rule set for the symlinks, ttyUSBModBus and ttyUSBRego, try changing your EXTRA_JAVA_OPTS to include only these. You may have to stop and restart OH for change to happen. Then see what the output of, ls -l /dev/ttyUSBRego and ttyUSBModBus show. They should indicate a symlink to the USB1 or whatever link you have assigned above.

@H102 you seem to be talking about modbus.cfg file. Are you mixing 1.x and 2.x bindings?

Quote from readme:

Some examples:

* parameter="value" for text parameters
* parameter=4 for integer
* parameter=true for boolean

Is your stopBit parameter with double quotes?

Miika - The stop bit should be a text value according to the documentation so quotes correct.
https://www.openhab.org/addons/bindings/modbus/#thing-configuration. I am using the newly merged 2.4 binding from 2.4.0.M3 which can still use the things files.

1 Like

Tried just the symlinks in the udev rules file but same problem PaperUI only allows /dev/USB0 to be selected and Things file causes error report reading ttyUSBModBus. I did spot that I used ttyUSBModBus in the udev file and ttyModBus in the EXTRA_JAVA_OPTS but corrected that and again no change in result.

Hi,
have you solved this problem? I’m facing the same.
Thanks

Hi,

Anyone solve this problem? I still have the same issue.

  • I’ve udpated to the last snapshot
  • clean cache and tmp
  • symlinks added in udev rules
    lrwxrwxrwx 1 root root 7 wrz 29 18:00 /dev/ttyBT -> ttyACM0
    lrwxrwxrwx 1 root root 7 wrz 29 18:00 /dev/ttyZigbee -> ttyACM1
    lrwxrwxrwx 1 root root 7 wrz 29 18:00 /dev/ttyZwave -> ttyACM2
  • EXTRA_JAVA_OPTS in /etc/default/openhab2
    EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyBT:/dev/ttyZwave:/dev/ttyZigbee"
  • variable is visible in systemctl status openhab2.service:
    -Dgnu.io.rxtx.SerialPorts=/dev/ttyBT:/dev/ttyZwave:/dev/ttyZigbee

Any ideas?