amclain / stingray

Build farm automation and remote management
Other
5 stars 0 forks source link

Keep console open after target firmware update #18

Open amclain opened 1 year ago

amclain commented 1 year ago

Updating a Nerves target's firmware causes the console to crash when the target reboots.

** (EXIT from #PID<0.1160.0>) shell process exited with reason: an exception was raised:
    ** (ArgumentError) errors were found at the given arguments:

  * 2nd argument: not valid character data (an iodata term)

        (stdlib 4.1.1) io.erl:99: :io.put_chars(:standard_io, <<114, 101, 98, 111, 111, 116, 58, 32, 82, 101, 115, 116, 97, 114, 116, 105, 110, 103, 32, 115, 121, 115, 116, 101, 109, 13, 254, 82, 111, 109, 66, 79, 79, 84, 10, 13>>)
        (stingray 0.1.0) lib/stingray/console/server.ex:152: Stingray.Console.Server.handle_info/2
        (stdlib 4.1.1) gen_server.erl:1123: :gen_server.try_dispatch/4
        (stdlib 4.1.1) gen_server.erl:1200: :gen_server.handle_msg/6
        (stdlib 4.1.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
amclain commented 1 year ago

Regression from #16

amclain commented 1 year ago

It's still not working. The error might be caused by invalid logic levels getting sent to the UART when the target loses power. I don't think it's a specific byte sequence causing the issue.

Take a look at this:

Process.flag(:trap_exit, true)