Skip to content
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

Timeouts waiting for blinkchain OS process to reply #27

Open
joelbyler opened this issue Dec 18, 2019 · 12 comments
Open

Timeouts waiting for blinkchain OS process to reply #27

joelbyler opened this issue Dec 18, 2019 · 12 comments

Comments

@joelbyler
Copy link

I'm looking for tips or maybe additional data back to understand these errors. I notice that they've been coming up on a somewhat regular basis. Can I configure timeouts, or should I try and block updates until the previous reply has been received? Is that possible?

20:37:06.682 [error] GenServer Blinkchain.HAL terminating
** (RuntimeError) timeout waiting for blinkchain OS process to reply
    (blinkchain) lib/blinkchain/hal.ex:194: Blinkchain.HAL.receive_from_port/1
    (blinkchain) lib/blinkchain/hal.ex:109: Blinkchain.HAL.handle_call/3
    (stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:690: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message (from :lamp): :render

20:37:06.730 [error] GenServer :lamp terminating
** (stop) exited in: GenServer.call(Blinkchain.HAL, :render, 5000)
    ** (EXIT) an exception was raised:
        ** (RuntimeError) timeout waiting for blinkchain OS process to reply
            (blinkchain) lib/blinkchain/hal.ex:194: Blinkchain.HAL.receive_from_port/1
            (blinkchain) lib/blinkchain/hal.ex:109: Blinkchain.HAL.handle_call/3
            (stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
            (stdlib) gen_server.erl:690: :gen_server.handle_msg/6
            (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
    (elixir) lib/gen_server.ex:1009: GenServer.call/3
    (lamp_control) lib/lamp_control/lamp.ex:48: LampControl.Lamp.handle_cast/2
    (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {:"$gen_cast", {:set_color, "#19ff02"}}
@mobileoverlord
Copy link
Contributor

I see this too. It appears that blinkchain doesn't work anymore with the latest systems

@GregMefford
Copy link
Owner

Hm yeah that's strange that it would time out without actually crashing.
I just got the example rainbow project updated to work with the latest Nerves conventions and it fired right up for me like I expected. I'll push the updates up for that example project and keep fiddling with it to see if I can get it to break.

@GregMefford
Copy link
Owner

Ah I see! I am getting the same error messages during boot-up but it's still working fine apart from a momentary glitch that is visible, presumably as a result of the crash. I'm testing it on rpi3 and rpi3a with latest systems (1.11.1).

@mobileoverlord it sounds like maybe it's not working at all for you, right? Do you have a project I can clone and try, or a fw file that's not working?

If you're trying it on a rpi4, I do have one of those to test with, but I haven't had a chance to try it yet - need to get all the hardware put together.

@joelbyler
Copy link
Author

FWIW, when I reported back in December, this was on an rpi0, I have a project but haven't touched it since January. I can dust it off and send you a link if thats of interest?

@GregMefford
Copy link
Owner

No pressure @joelbyler - if the only problem was seeing those logs, then I am able to reproduce that and I can try to figure out why they're happening. It seems like on my end, it's quickly restarting and continuing to work, but that's on much faster hardware (rpi3).

If your project was just breaking and not immediately fixing itself, then I'd definitely be interested to understand why.

@joelbyler
Copy link
Author

👍 that's correct, mostly just extra noise in the logs. Thanks for looking into this @GregMefford

@konstantinzolotarev
Copy link

@GregMefford @joelbyler Any news on this issue ?

Getting same error from time to time.

18:51:05.713 [error] GenServer Blinkchain.HAL terminating
** (RuntimeError) timeout waiting for blinkchain OS process to reply
    (blinkchain 1.0.0) lib/blinkchain/hal.ex:194: Blinkchain.HAL.receive_from_port/1
    (blinkchain 1.0.0) lib/blinkchain/hal.ex:109: Blinkchain.HAL.handle_call/3
    (stdlib 3.12.1) gen_server.erl:661: :gen_server.try_handle_call/4
    (stdlib 3.12.1) gen_server.erl:690: :gen_server.handle_msg/6
    (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message (from Stairs.Controller): :render
State: %Blinkchain.HAL.State{config: %Blinkchain.Config{canvas: %Blinkchain.Config.Canvas{height: 1, width: 420}, channel0: %Blinkchain.Config.Channel{arrangement: [%Blinkchain.Config.Strip{count: 420, direction: :right, origin: {0, 0}, spacing: 1}], brightness: 32, gamma: nil, invert: false, number: 0, pin: 18, type: :grb}, channel1: %Blinkchain.Config.Channel{arrangement: [], brightness: 255, gamma: nil, invert: false, number: 1, pin: 0, type: :gbr}, dma_channel: 5}, port: #Port<0.33996>, subscriber: nil}
Client Stairs.Controller is alive

    (stdlib 3.12.1) gen.erl:167: :gen.do_call/4
    (elixir 1.10.2) lib/gen_server.ex:1020: GenServer.call/3
    (stairs 0.1.0) lib/stairs.ex:66: anonymous fn/2 in Stairs.on/1
    (elixir 1.10.2) lib/enum.ex:3371: Enum.reduce_range_inc/4
    (stairs 0.1.0) lib/stairs/controller.ex:32: Stairs.Controller.handle_cast/2
    (stdlib 3.12.1) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib 3.12.1) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

18:51:05.719 [error] GenServer Stairs.Controller terminating
** (stop) exited in: GenServer.call(Blinkchain.HAL, :render, 5000)
    ** (EXIT) an exception was raised:
        ** (RuntimeError) timeout waiting for blinkchain OS process to reply
            (blinkchain 1.0.0) lib/blinkchain/hal.ex:194: Blinkchain.HAL.receive_from_port/1
            (blinkchain 1.0.0) lib/blinkchain/hal.ex:109: Blinkchain.HAL.handle_call/3
            (stdlib 3.12.1) gen_server.erl:661: :gen_server.try_handle_call/4
            (stdlib 3.12.1) gen_server.erl:690: :gen_server.handle_msg/6
            (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
    (elixir 1.10.2) lib/gen_server.ex:1023: GenServer.call/3
    (stairs 0.1.0) lib/stairs.ex:66: anonymous fn/2 in Stairs.on/1
    (elixir 1.10.2) lib/enum.ex:3371: Enum.reduce_range_inc/4
    (stairs 0.1.0) lib/stairs/controller.ex:32: Stairs.Controller.handle_cast/2
    (stdlib 3.12.1) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib 3.12.1) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib 3.12.1) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {:"$gen_cast", {:on, :from_middle}}
State: []

@AlejandroHuerta
Copy link

I get this error often when rendering. Sometimes multiple times in a row.

@jasonmj
Copy link

jasonmj commented Feb 12, 2021

I too am getting this error. It's hard to pinpoint when or why.

@jasonmj
Copy link

jasonmj commented Feb 12, 2021

Well, I think I got this worked out by setting my dma_channel to 9 as described here: https://github.com/GregMefford/blinkchain#dma-channel-selection

@Lechindianer
Copy link

Can confirm @jasonmj fix works on RPI2 with nerves 1.7.4 and nerves_system_rpi2 nerves_system_rpi2

@EricHigdon
Copy link

Setting dma_channel to 9 worked for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants