Trouble with running a release on a raspberry pi zero, iex works fine

Hi, I’m having some strange problems with running a release of my app (weather station which posts to mqtt via erlang lib emqtt) on my raspberry pi zero as it crashes at startup but works fine when running in iex:

2023-01-03 23:22:41.034344 ~s~n
“driver_select(0xb6200a38, 0, ERL_DRV_READ ERL_DRV_USE, 1) by fd (0/1) driver #Port<0.11> stealing control of fd=0 from input driver tcp_inet #Port<0.7> \n”
=ERROR REPORT==== 3-Jan-2023::23:22:41.034344 ===
driver_select(0xb6200a38, 0, ERL_DRV_READ ERL_DRV_USE, 1) by fd (0/1) driver #Port<0.11> stealing control of fd=0 from input driver tcp_inet #Port<0.7>
Crash dump is being written to: erl_crash.dump…done

Running it with iex -S mix works fine without any problems. However not really a good “production” setup. Tried bumping my packages from buster to bullseye which somewhat changed the above error msg (earlier was “driver was unselected” or something similiar).

Env:

Erlang/OTP 23 [erts-11.1.8] [source] [smp:1:1] [ds:1:1:10] [async-threads:1]
Elixir 1.10.3 (compiled with Erlang/OTP 22)

Any ideas? The error message is quite exotic and google didnt do much…

Are you building the release on pi?

Yes, setting up a build env for ARM outside of my pi is on my todo.

So I know that would be useful for troubleshooting. However since my apps works fine while running in iex I’m a bit perplexed. I also thinking about ditching emqtt in favor for tortoise but not there yet.

Found the culprint of the issue: config/releases.exs along with circuits_gpio

Removed the file and now everything works fine.

1 Like