New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random error - Rs232 SerialPortError: Resource temporarily unavailable #1183
Comments
@newkind Try setting the baud rate to 115200. An Arduino Uno cannot do 500000. Does that work? |
I tried different baudrates under 500000 but the leds were always slow and choppy - especially at 115200. The 500000 looks really nice and is very fluid and smooth. @Lord-Grey I'll try going with 460800 - this one is also smooth and fluid. This is the one I used in the past on my different setup with Arduino Uno and I didn't had such issues there. |
The older code was slower and had more delays. That is why it might have been working before. If it is slow you might want also to check, if you grabbing too quickly or with a too high resolution... |
Thank you very much for the suggestions! I'll test everything again and let you know the results. |
@newkind Any update? |
@Lord-Grey I'm sorry but last days has been crazy (we got a new puppy) so I wasn't able to do any testing, but today I'll be doing all changes to the configuration and the arduino sketch. It might take couple hours to see if the Hyperion.ng still breaks. Please give me couple more hours and I'll surely get back to you with an update! |
@newkind No worries. Take your time! I only wanted to check, if the issues still persist.... |
@Lord-Grey Sorry it took so long to get back to you. So I did play with the configuration and Arduino sketches today and my findings are:
@Lord-Grey "The "Temporarily Available" error is an indication that the board cannot cope with the data volume sent in the configured timeframe." I agree that this could be the case, but if it would - shouldn't the error happen only when Hyperion is actually working and controlling leds actively? The issue I'm facing happens overtime and 99% during night when no one is watching anything and leds are turned off, so the device just sits idle and waits until I'll start playing anything. It just behaves like it would lose the usb power or something like that and cannot reconnect properly. I'm also doing another test with a different Uno R3 device. I noticed that the one I used currently was not based on Atmel chip and reported on ttyUSB0. The new one has Atmel chip and connects as ttyACM0 - we'll see if this will help in any way. |
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. |
So it looks like this didn't change anything - I even think that the device is crashing much faster when using ttyACM0. Latest log: https://pastebin.com/raw/L4pPQPNN This time it took only about 5 minutes in idle to prevent device from working. Right now I'll switch the baudrate to 115200 (just for testing as it's unusable) to see if it'll still crash. I'll come back with new log. |
One more update - setting baudrate to 115200 also doesn't solve it. Here is the new log: https://paste.kodi.tv/eduxarocev.kodi Relevant part:
So it's either my device - Mecool M8S L or there's something with Hyperion.ng as this happens on two completely different Arduino devices. I have ordered today two Arduino Micro Leonardo to hopefully solve this once for all. I'm using it on another device on my main TV and that one works perfectly fine, so if it'll be having issues on my secondary TV, then I'll know for sure that the Mecool M8S L device is to blame. |
@newkind Just to see, if something is in the system log, could you do me an extract for the 28.02.2021 and 01.03.2021, please?
|
As you seem to use CoreElec, do you use the Suspend/Resume feature? |
@Lord-Grey Both of CoreElec devices are constantly up/awake - I do not put any of these devices under suspend/sleep. I'm not sure if I do something wrong but both of these commands output only
|
@newkind Could you do a
or alternatively, if the error occurs
|
@Lord-Grey Sure! Here's the log: http://ix.io/2RnY |
@newkind Thank you. At minimum there seems to be some indication in the Log:
|
@Lord-Grey So as suspected the device turns off the usb hub internally right? If that's the case then I'll take this topic to the CE forums and ask for advice there. |
@newkind In addition, I am going to check, if I just could ignore the error and do the next write or if I need to reopen the USB device.... to make the hyperion more robust for such a scenario.... |
That would be awesome! Thank you! |
@Lord-Grey Just coming back to you with another update. I took the kernel issue to the CoreElec forums and
My arduino is in a separate plastic case about 30cm from the CE device so I ruled that out as a source of interference. After that I replaced the usb cable that I have been using and I haven't noticed any crashes since then (almost 24h)! That was... well... unexpected! I still need a day or two to make sure that the crash won't happen again, but so far it looks really good! One more time thank you for your support and finding out the kernel error report! :) |
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. |
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:
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 thekillall hyperiond
command is used.System
Hyperion Server:
Hyperion Server OS:
The text was updated successfully, but these errors were encountered: