Mix firmware.burn throws compiler version mismatch on fresh Scenic project

Trying to get started playing with Nerves and Scenic for the first time. Following all the instruction steps, and running into a problem every time I try and run the mix firmware.burn step:

The Erlang compiler that compiled Elixir is older than the compiler
used to compile OTP.
Elixir: 8.0.0
OTP: 7.6.7

This is slightly perplexing though, because the step it suggests, using asdf to set elixir 1.12.2-otp-24, I’ve already done. (asdf current confirms elixir 1.12.2-otp-24 and erlang 24.0.3)

Searching that error message leads me to the Nerves code, so I tried skipping Scenic and just building a plain Nerves project. This works just fine, and burns to the SD card. So although the problem is being thrown by Nerves, it’s only happening on a Scenic project. mix scenic.run works fine if running on the host.

I’ve deleted every elixir/erlang version from asdf except these latest two. My host system has neither elixir nor erlang installed. If I run iex -S mix in the project directory (or any directory on my machine) and then check Application.spec(:compiler, :vsn), (the code from Nerves that throws the error) I get “8.0.2”, so I’m not sure where it’s getting either 8.0.0 or 7.9.7

I’m not entirely certain how to go about debugging this one any further, as I seem to have everything set up as the documentation requests, and I can’t figure out how it’s even getting the versions it is. I think perhaps there’s something about how the toolchain is working that I’m missing, and I’m hoping someone can point me in the correct direction. :slight_smile:

The Nerves portion of Scenic is a little bit out of date at the moment (although there will likely be movement on it in the next month or so). So I think the generated projects doesn’t work with the most recent nerves versions. I’d suggest either downgrading the version of Nerves that you are using or following the Nerves upgrade guide to upgrade the generated nerves project. This was the last time the Nerves template for Scenic was updated so it should give you a clue as to which Nerves version was targeted at the time:

1 Like

Ah, good to know!

I cleared out everything, including the ~/.nerves directory, and retried everything after pinning nervers to “~> 1.6.5”, no joy. Tried again with “~> 1.5.0” and still the same error.

So I tried going all the way back and installing contemprary versions of elixir/erlang/nerves/scenic from the time the PR your referenced was merged, and I’m still getting a version mismatch. (Host version 22, Target version 24)

So, knowing that some things are changing soon, I think I’m going to save some effort and come back to this in a month or two and see if any updates have come along.

Appreciate the help!

What nerves system version are you using? I believe that is what is setting the target version. Also what screen are you planning to use with Scenic? I think only the official 7" touch screen is really tested/working.

At first I tried it using the latest installed, so 1.7.x I suppose. Then I tried it with 1.6.5, and when that didn’t work I cleared everything out and re-built with all older versions:

asdf local erlang 22.3.4.20
asdf local elixir 1.9.4-otp-22
mix archive.install hex nerves_bootstrap “== 1.6.0”
mix archive.install hex scenic_new “== 0.10.3”

This runs into the “Host version 22, Target version 24” error, but in the process of writing this out I’ve figured out why!

The generated project wants
:nerves_system_rpi1, "~1.8", but since it’s pinned to 1.8, (allowed to upgrade minor releases) mix actually pulled 1.16.1, which is presumably why it wants erlang 24.)
Changing the deps in mix.exs to:
{:nerves_system_rpi3, "~> 1.8.0", runtime: false, targets: :rpi3},
then rebuilding the deps and burning the firmware works!

Scenic is now running on my RPi3 7" touch screen! On older versions of everything maybe, but running!

As an aside, I went to try and figure out if there was a similarly simple solution to running the latest versions. The original error was compiler version mismatch.
Digging in a bit more to figure out if I can prevent having to pin to all the old versions, it looks like compiler 7.6.7 is OTP 23.3. Setting up the project in the following way:

asdf local erlang 23.3
asdf local elixir 1.12.2-otp-23
mix local.hex
mix local.rebar
mix archive.install hex nerves_bootstrap
mix archive.install hex scenic_new
mix scenic.new.nerves scenic_test

And change deps in mix.exs to:
{:nerves_system_rpi3, "~> 1.15.0", runtime: false, targets: :rpi3},
an suddenly running mix deps.get and then mix firmware.burn work fine!

I’m not sure how to to get nerves_system_rpi3 1.16.1 to work, because we get back to the original error about compiler version mismatch, but I’ve managed to figure out how to get it working with relatively recent versions, which is fine. :slight_smile:

1 Like

I’m glad you got it working! :tada:

Personally I’m still using nerves_system_rpi3 1.13.0 because on later versions I haven’t been able to figure out how to make the screen go to sleep.