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:
https://github.com/boydm/scenic_new/pull/41

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
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 Postgres...
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
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
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
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
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
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement