hyperion-project / hyperion.ng

The successor to Hyperion aka Hyperion Next Generation
https://hyperion-project.org/
MIT License
3.04k stars 377 forks source link

alpha.7 crashes when using a non-default serial name #943

Closed cmsimike closed 3 years ago

cmsimike commented 4 years ago

Bug report

When using alpha.7, hyperion crashes with the following error: 2020-08-04T06:54:21.013 hyperiond HYPERION : Hyperion instance 'First LED Hardware instance' has been started 2020-08-04T06:54:21.025 hyperiond LEDDEVICE : ProviderRs232.cpp:145:tryOpen() | portName: 2020-08-04T06:54:21.025 hyperiond LEDDEVICE : ProviderRs232.cpp:146:tryOpen() | systemLocation: 2020-08-04T06:54:21.026 hyperiond LEDDEVICE : ProviderRs232.cpp:147:tryOpen() | description: 2020-08-04T06:54:21.026 hyperiond LEDDEVICE : ProviderRs232.cpp:148:tryOpen() | manufacturer: 2020-08-04T06:54:21.026 hyperiond LEDDEVICE : ProviderRs232.cpp:149:tryOpen() | productIdentifier: 0x0 2020-08-04T06:54:21.026 hyperiond LEDDEVICE : ProviderRs232.cpp:150:tryOpen() | vendorIdentifier: 0x0 2020-08-04T06:54:21.026 hyperiond LEDDEVICE : ProviderRs232.cpp:151:tryOpen() | serialNumber: 2020-08-04T06:54:21.026 hyperiond LEDDEVICE : Device disabled, device 'adalight' signals error: 'Invalid serial device name: [lg_back_lights]!'

This seemed to work fine in alpha.6

Steps to reproduce

1) attach usb lights to computer 2) create udev rule to create persistent name for the attached usb device

SUBSYSTEM=="tty", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0483", SYMLINK+="lg_back_lights" 3) create LED device referencing the new serial path 4) start hyperion

What is expected?

Hyperion should start and be fine with the name of the serial device

What is actually happening?

Hyperion crashes because it thinks the serial device name is incorrect.

System

Hyperion Server:

Hyperion Server OS:

cmsimike commented 4 years ago

I see a image on other issues, but not on this one. not sure if i messed anything up but happy to fix or update if anyone knows?

cmsimike commented 4 years ago

Ah got it!

cmsimike commented 4 years ago

Trying the latest from master still has an error with custom serial names.

2020-08-30T08:56:05.342 hyperiond LEDDEVICE : Device disabled, device 'adalight' signals error: 'Invalid serial device name: [lg_back_lights]!'

I've tried lg_back_lights with and without /dev/ before it. Switching lg_back_lights to ttyACM1 (what lg_back_lights is symlinked to) fixes the issue.

Hyperion Server: 
- Build:       master (GitHub-2d1a9a2/5a684e2-1598791632)
- Build time:  Aug 30 2020 15:47:36
- Git Remote:  https://github.com/hyperion-project/hyperion.ng.git
- Version:     2.0.0-alpha.7
- UI Lang:     auto (BrowserLang: en-US)
- UI Access:   default
- Avail Capt:  v4l2,framebuffer,x11,xcb,qt

Hyperion Server OS: 
- Distribution: Ubuntu 16.04.6 LTS
- Arch:         x86_64
- Kernel:       linux (4.4.0-186-generic (WS: 64))
- Browser:      Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36 
Lord-Grey commented 3 years ago

"Switching lg_back_lights to ttyACM1 (what lg_back_lights is symlinked to) fixes the issue."

Paulchen-Panther commented 3 years ago

@Lord-Grey ❓

Lord-Grey commented 3 years ago

@Paulchen-Panther I closed the issue, as using the correct device name in line with the symlink resolved the issue.

Paulchen-Panther commented 3 years ago

Thanks for the explanation 🚀

cmsimike commented 3 years ago

Sorry, maybe I wasn't clear but the symlink does NOT work. At least not when I added info to this ticket. I switched from using the symlinked name to the device name, and that worked, but the symlink (which otherwise is correctly setup using udev rules) still does not work at the time of that writing.

fightforlife commented 3 years ago

Same for me. Symlinks seem to not work for hyperion.

udev rule

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A98VVXTL", SYMLINK+="ttyUSB-Adalight"

working symlink

lrwxrwxrwx 1 root root          7 Jan 30 10:52 /dev/ttyUSB-Adalight -> ttyUSB0

hyperion error (alpha9). ttyUSB0 is wokring as expected, the symlink is not

Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <INFO> Start LedDevice 'adalight'.
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:148:init() | deviceConfig: [{"colorOrder":"rgb","currentLedCount":50,"delayAfterConnect":200,"hardwareLedCount":50,"latchTime":30,"lightberry_apa102_mode":false,"output":"/dev/ttyUSB0","rate":500000,"rewriteTime":1000,"type":"adalight"}]
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:407:setLatchTime() | LatchTime updated to 30ms
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:428:setRewriteTime() | Refresh interval = 1000ms
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:434:setRewriteTime() | RewriteTime updated to 1000ms
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:36:init() | DeviceType   : adalight
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:37:init() | LedCount     : 50
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:38:init() | ColorOrder   : rgb
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:39:init() | RefreshTime  : 1000
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:40:init() | LatchTime    : 30
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:52:init() | deviceName   : ttyUSB0
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:53:init() | AutoDevice   : 0
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:54:init() | baudRate_Hz  : 500000
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:55:init() | delayAfCon ms: 200
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> LedDeviceAdalight.cpp:59:init() | Adalight header for 50 leds: Ada 0x00 0x31 0x64
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <INFO> Opening UART: ttyUSB0
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.155 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:141:tryOpen() | _rs232Port.open(QIODevice::ReadWrite): ttyUSB0, Baud rate [500000]bps
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.187 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:146:tryOpen() | portName:          ttyUSB0
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.187 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:147:tryOpen() | systemLocation:    /dev/ttyUSB0
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.187 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:148:tryOpen() | description:       FT232R USB UART
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.187 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:149:tryOpen() | manufacturer:      FTDI
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.187 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:150:tryOpen() | productIdentifier: 0x6001
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.187 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:151:tryOpen() | vendorIdentifier:  0x403
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.187 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:152:tryOpen() | serialNumber:      A98VVXTL
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.191 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:173:tryOpen() | delayAfterConnect for 200 ms - start
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.392 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:180:tryOpen() | delayAfterConnect for 200 ms - finished
Jan 30 10:54:49 server hyperiond[862]: 2021-01-30T10:54:49.392 hyperiond COMPONENTREG : <DEBUG> ComponentRegister.cpp:36:setNewComponentState() | LED device: enabled
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.424 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:93:close() | Flush was successful
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.424 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:95:close() | Close UART: ttyUSB0
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.451 hyperiond LEDDEVICE    : <INFO>  Stopped LedDevice 'adalight'
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.451 hyperiond COMPONENTREG : <DEBUG> ComponentRegister.cpp:36:setNewComponentState() | LED device: disabled
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.451 hyperiond LEDDEVICE    : <INFO> Start LedDevice 'adalight'.
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:148:init() | deviceConfig: [{"colorOrder":"rgb","currentLedCount":50,"delayAfterConnect":200,"hardwareLedCount":50,"latchTime":30,"lightberry_apa102_mode":false,"output":"/dev/ttyUSB-Adalight","rate":500000,"rewriteTime":1000,"type":"adalight"}]
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:407:setLatchTime() | LatchTime updated to 30ms
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:428:setRewriteTime() | Refresh interval = 1000ms
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:434:setRewriteTime() | RewriteTime updated to 1000ms
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:36:init() | DeviceType   : adalight
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:37:init() | LedCount     : 50
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:38:init() | ColorOrder   : rgb
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:39:init() | RefreshTime  : 1000
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:40:init() | LatchTime    : 30
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:52:init() | deviceName   : ttyUSB-Adalight
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:53:init() | AutoDevice   : 0
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:54:init() | baudRate_Hz  : 500000
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.452 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:55:init() | delayAfCon ms: 200
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.453 hyperiond LEDDEVICE    : <DEBUG> LedDeviceAdalight.cpp:59:init() | Adalight header for 50 leds: Ada 0x00 0x31 0x64
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.453 hyperiond LEDDEVICE    : <INFO> Opening UART: ttyUSB-Adalight
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.453 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:141:tryOpen() | _rs232Port.open(QIODevice::ReadWrite): ttyUSB-Adalight, Baud rate [500000]bps
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.487 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:146:tryOpen() | portName:
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.487 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:147:tryOpen() | systemLocation:
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.487 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:148:tryOpen() | description:
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.487 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:149:tryOpen() | manufacturer:
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.487 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:150:tryOpen() | productIdentifier: 0x0
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.487 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:151:tryOpen() | vendorIdentifier:  0x0
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.487 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:152:tryOpen() | serialNumber:
Jan 30 10:54:57 server hyperiond[862]: 2021-01-30T10:54:57.487 hyperiond LEDDEVICE    : <ERROR> Device disabled, device 'adalight' signals error: 'Invalid serial device name: [ttyUSB-Adalight]!'
Jan 30 10:54:57 server [862]: Device disabled, device 'adalight' signals error: 'Invalid serial device name: [ttyUSB-Adalight]!'
Jan 30 10:56:16 server hyperiond[862]: 2021-01-30T10:56:16.767 hyperiond HYPERION     : <DEBUG> PriorityMuxer.cpp:351:setCurrentTime() | Set visible priority to 200
Jan 30 10:56:16 server hyperiond[862]: 2021-01-30T10:56:16.767 hyperiond HYPERION     : <DEBUG> Hyperion.cpp:559:handlePriorityChangedLedDevice() | priority[200], previousPriority[254]
Jan 30 10:56:17 server hyperiond[862]: 2021-01-30T10:56:17.017 hyperiond HYPERION     : <DEBUG> PriorityMuxer.cpp:351:setCurrentTime() | Set visible priority to 254
Jan 30 10:56:17 server hyperiond[862]: 2021-01-30T10:56:17.018 hyperiond HYPERION     : <DEBUG> Hyperion.cpp:559:handlePriorityChangedLedDevice() | priority[254], previousPriority[200]
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.862 hyperiond LEDDEVICE    : <INFO>  Stopped LedDevice 'adalight'
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.864 hyperiond LEDDEVICE    : <INFO> Start LedDevice 'adalight'.
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.864 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:148:init() | deviceConfig: [{"colorOrder":"rgb","currentLedCount":50,"delayAfterConnect":200,"hardwareLedCount":50,"latchTime":30,"lightberry_apa102_mode":false,"output":"ttyUSB-Adalight","rate":500000,"rewriteTime":1000,"type":"adalight"}]
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.864 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:407:setLatchTime() | LatchTime updated to 30ms
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.864 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:428:setRewriteTime() | Refresh interval = 1000ms
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.864 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:434:setRewriteTime() | RewriteTime updated to 1000ms
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.864 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:36:init() | DeviceType   : adalight
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.864 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:37:init() | LedCount     : 50
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.864 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:38:init() | ColorOrder   : rgb
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.864 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:39:init() | RefreshTime  : 1000
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.865 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:40:init() | LatchTime    : 30
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.865 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:52:init() | deviceName   : ttyUSB-Adalight
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.865 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:53:init() | AutoDevice   : 0
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.865 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:54:init() | baudRate_Hz  : 500000
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.865 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:55:init() | delayAfCon ms: 200
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.865 hyperiond LEDDEVICE    : <DEBUG> LedDeviceAdalight.cpp:59:init() | Adalight header for 50 leds: Ada 0x00 0x31 0x64
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.865 hyperiond LEDDEVICE    : <INFO> Opening UART: ttyUSB-Adalight
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.865 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:141:tryOpen() | _rs232Port.open(QIODevice::ReadWrite): ttyUSB-Adalight, Baud rate [500000]bps
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.895 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:146:tryOpen() | portName:
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.895 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:147:tryOpen() | systemLocation:
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.895 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:148:tryOpen() | description:
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.895 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:149:tryOpen() | manufacturer:
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.895 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:150:tryOpen() | productIdentifier: 0x0
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.895 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:151:tryOpen() | vendorIdentifier:  0x0
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.895 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:152:tryOpen() | serialNumber:
Jan 30 11:30:37 server hyperiond[862]: 2021-01-30T11:30:37.895 hyperiond LEDDEVICE    : <ERROR> Device disabled, device 'adalight' signals error: 'Invalid serial device name: [ttyUSB-Adalight]!'
Jan 30 11:30:37 server [862]: Device disabled, device 'adalight' signals error: 'Invalid serial device name: [ttyUSB-Adalight]!'
fightforlife commented 3 years ago

@Lord-Grey I think here is the reason for this error: https://forum.qt.io/topic/30632/qserialport-and-port-naming-on-linux-centos

By design, use of SYMLINK isn't provided (because then it would be necessary to pick up analogs of SYMLINK and for other platforms like Windows, MacOSX). Also it complicates internal implementation.

Just saving my research history here: https://stackoverflow.com/questions/21867628/opening-a-virtual-serial-port-created-by-socat-with-qt One solution describes a way of checking for a symlink and if it detects a symlink it uses the target for the serialdevice

QFileInfo file_info("/dev/mytty");
QSerialPort* serial = nullptr;
if (file_info.isSymLink()) {
  serial = new QSerialPort(file_info.symLinkTarget());
} else {
  serial = new QSerialPort(file_info.path());
}
serial->open(QIODevice::ReadWrite);
bgberk commented 3 years ago

@fightforlife Do you know which files need to be changed to implement this? As it stands, it’s impossible to use Hyperion on a Pi that has any other USB peripherals and needs to be shut down, as the numbering is inconsistent.

Lord-Grey commented 3 years ago

In case you are going to issue a PR with changes (which would be appreciated), please take care that it works in context of PR1164 too.

Thank you!

Lord-Grey commented 3 years ago

@fightforlife & @bgberk Would you be able to test PR1246 for udev support on serial devices?

fightforlife commented 3 years ago

Hi @Lord-Grey, I am no expert in compiling from source. Is there an easy way to build this PR with the docker compile script?

I downloaded your branch as a zip and tried to compile locally but it fails since some dependencies are missing in the zip. (most likely because you would normally clone recursive)

Paulchen-Panther commented 3 years ago

Hi @Lord-Grey, I am no expert in compiling from source. Is there an easy way to build this PR with the docker compile script?

I downloaded your branch as a zip and tried to compile locally but it fails since some dependencies are missing in the zip. (most likely because you would normally clone recursive)

Download pre-compiled artifacts here: https://github.com/hyperion-project/hyperion.ng/actions/runs/851038985

fightforlife commented 3 years ago

Thanks, I did not know about this!

For me it is working fine! See the following log:

2021-05-23T17:21:26.112 hyperiond LEDDEVICE    : <INFO> Start LedDevice 'adalight'.
2021-05-23T17:21:26.112 hyperiond COMPONENTREG : <DEBUG> ComponentRegister.cpp:36:setNewComponentState() | LED device: disabled
2021-05-23T17:21:26.112 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:148:init() | deviceConfig: [{"colorOrder":"rgb","currentLedCount":50,"delayAfterConnec                                                                                                                                                                                                                                                                                                                                t":200,"hardwareLedCount":50,"latchTime":30,"lightberry_apa102_mode":false,"output":"/dev/ttyUSB-Adalight","rate":500000,"rewriteTime":1000,"type":"adalight"                                                                                                                                                                                                                                                                                                                                }]
2021-05-23T17:21:26.112 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:413:setLatchTime() | LatchTime updated to 30ms
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:438:setRewriteTime() | Refresh interval = 1000ms
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:444:setRewriteTime() | RewriteTime updated to 1000ms
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:48:init() | DeviceType   : adalight
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:49:init() | LedCount     : 50
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:50:init() | ColorOrder   : rgb
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:51:init() | RefreshTime  : 1000
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:52:init() | LatchTime    : 30
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:73:init() | DeviceName   : ttyUSB0
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:74:init() | Location     : /dev/ttyUSB-Adalight
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:75:init() | AutoDevice   : 0
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:76:init() | baudRate_Hz  : 500000
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:77:init() | delayAfCon ms: 200
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> LedDeviceAdalight.cpp:59:init() | Adalight header for 50 leds: Ada 0x00 0x31 0x64
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <INFO> Opening UART: ttyUSB0 (/dev/ttyUSB-Adalight)
2021-05-23T17:21:26.113 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:170:tryOpen() | _rs232Port.open(QIODevice::ReadWrite): ttyUSB0, Baud rate [500000]                                                                                                                                                                                                                                                                                                                                bps
2021-05-23T17:21:26.150 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:175:tryOpen() | portName:          ttyUSB0
2021-05-23T17:21:26.150 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:176:tryOpen() | systemLocation:    /dev/ttyUSB0
2021-05-23T17:21:26.150 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:177:tryOpen() | description:       FT232R USB UART
2021-05-23T17:21:26.150 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:178:tryOpen() | manufacturer:      FTDI
2021-05-23T17:21:26.150 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:179:tryOpen() | vendorIdentifier:  0x403
2021-05-23T17:21:26.150 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:180:tryOpen() | productIdentifier: 0x6001
2021-05-23T17:21:26.150 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:181:tryOpen() | serialNumber:      A98VVXTL
2021-05-23T17:21:26.154 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:212:tryOpen() | delayAfterConnect for 200 ms - start
2021-05-23T17:21:26.354 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:219:tryOpen() | delayAfterConnect for 200 ms - finished
2021-05-23T17:21:26.354 hyperiond COMPONENTREG : <DEBUG> ComponentRegister.cpp:36:setNewComponentState() | LED device: enabled