hyperion.ng: Random error - Rs232 SerialPortError: Resource temporarily unavailable
- I confirm that this is an issue rather than a question.
Bug report
First of all I’m aware I’m using CoreElec and you most likely will tell me to go to the CE forums and ask there, but I tried and unfortunatelly folks there weren’t able to help me. Here’s the link to my previous topic in CE forums: https://discourse.coreelec.org/t/amlogicgrabb-stops-working-after-couple-hours-hyperion-ng/13091/11?u=newkind
So I’m using a WS2812B leds connected to the Arduino Uno clone and the issue is that randomly after random amount of time the Hyperion.ng stops working because of the Rs232 error. This Hyperion.ng addon build is based on the latest Hyperion.ng 2.0.0-alpha.9
Here’s the part of the log:
2021-02-03T09:56:52.173 hyperiond HYPERION : <DEBUG> PriorityMuxer.cpp:270:clearInput() | Removed source priority 250
2021-02-03T09:56:52.173 hyperiond HYPERION : <DEBUG> PriorityMuxer.cpp:351:setCurrentTime() | Set visible priority to 255
2021-02-03T09:56:52.174 hyperiond HYPERION : <DEBUG> Hyperion.cpp:559:handlePriorityChangedLedDevice() | priority[255], previousPriority[250]
2021-02-03T09:56:52.174 hyperiond HYPERION : <DEBUG> Hyperion.cpp:562:handlePriorityChangedLedDevice() | No source left -> switch LED-Device off
2021-02-03T09:56:52.175 hyperiond COMPONENTREG : <DEBUG> ComponentRegister.cpp:36:setNewComponentState() | Framegrabber: disabled
2021-02-03T09:56:52.177 hyperiond AmLogic : <DEBUG> GrabberWrapper.cpp:58:stop() | Grabber stop()
2021-02-04T00:37:52.156 hyperiond LEDDEVICE : <DEBUG> ProviderRs232.cpp:95:close() | Close UART: ttyUSB0
2021-02-04T00:37:52.156 hyperiond LEDDEVICE : <ERROR> Device disabled, device 'adalight' signals error: 'Rs232 SerialPortError: Resource temporarily unavailable'
2021-02-04T00:37:52.157 hyperiond COMPONENTREG : <DEBUG> ComponentRegister.cpp:36:setNewComponentState() | LED device: disabled
Link to the full log: https://pastebin.com/raw/ZwyptMHK
When the error happens, doing killall hyperiond
and waiting couple seconds for the daemon to restart fixes the issue for the next X hours until it happens again.
This happens randomly and can happen ie. after an hour or 20 hours. There’s no general rule for that. I could set the CRON to restart hyperiond
every couple hours but that is certainly not a fix for this issue.
I’ll gladly test all the patches or code that would fix this.
Thank you!
Steps to reproduce
None, just wait couple hours.
What is expected?
Hyperion.ng works just fine and in case of such error - restarts the daemon automatically.
What is actually happening?
Error Device disabled, device 'adalight' signals error: 'Rs232 SerialPortError: Resource temporarily unavailable
is thrown and the daemon never restarts keeping the device dead until the whole box is restarted or the killall hyperiond
command is used.
System
Hyperion Server:
- Build: coreelec-9.2 (Portisch-de94399e92/d7336cbe8c-1611911223)
- Build time: Jan 31 2021 10:29:42
- Git Remote: https://github.com/CoreELEC/CoreELEC.git
- Version: 2.0.0-alpha.9
- UI Lang: en (BrowserLang: pl)
- UI Access: default
- Avail Capt: v4l2,framebuffer,amlogic,qt
- Database: read/write
Hyperion Server OS:
- Distribution: CoreELEC (official): 9.2.5
- Architecture: arm64
- CPU Model: Amlogic S912 rev a
- CPU Hardware: Amlogic
- Kernel: linux (3.14.29 (WS: 32))
- Qt Version: 5.13.0
- Python Version: 3.7.3
- Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:86.0) Gecko/20100101 Firefox/86.0
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22
Everything still works fine, so I can confirm that the issue was the poor cable shielding causing interference and linux kernel disabling the usb internal hub port because of the EM interference.
One more time thank you @Lord-Grey for your support.
Update: So changing to the Atmel powered Uno R3 didn’t help. However I noticed one more thing - the Atmel version of Uno R3 allows me to set baudrate to 460800 - something that non-Atmel version didn’t allow, so I’m going to try it. The non Atmel version allowed me only 115200 or 500000, 460800 didn’t worked for some reason.
I’ll come with more updates later.
The older code was slower and had more delays. That is why it might have been working before. The real Android Uno can technically only do 115200. In case your Uno like model can do higher baud-rate, I would suggest you increase the latch-time. The “Temporarily Available” error is an indication that the board cannot cope with the data volume sent in the configured timeframe.
If it is slow you might want also to check, if you grabbing too quickly or with a too high resolution…