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

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
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
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
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
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
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
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
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement