joshp

joshp

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:

Marked As Solved

joshp

joshp

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:

Also Liked

axelson

axelson

Scenic Core Team

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:

Where Next?

Popular in Questions Top

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New

We're in Beta

About us Mission Statement