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

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
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
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
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

Other popular topics Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
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
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
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
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement