theAntimon

theAntimon

$ mix firmware fail -> :ssh_sftpd is not available

Hi nerves community. I try to follow the steps to build the weather station based on nerves. But I fail pretty early while trying to build the firmware:

$ mix firmware
==> nerves
==> sensor_hub

Nerves environment
  MIX_TARGET:   rpi0
  MIX_ENV:      dev

==> nerves_ssh
Compiling 7 files (.ex)

== Compilation error in file lib/nerves_ssh/options.ex ==
** (UndefinedFunctionError) function :ssh_sftpd.subsystem_spec/1 is undefined (module :ssh_sftpd is not available)
    :ssh_sftpd.subsystem_spec([cwd: ~c"/"])
    lib/nerves_ssh/options.ex:50: (module)
could not compile dependency :nerves_ssh, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile nerves_ssh --force", update it with "mix deps.update nerves_ssh" or clean it with "mix deps.clean nerves_ssh"

Anyone having an idea what is going on here?

First 2 of 2 Posts Switch mode

fhunleth

fhunleth

Co-author of Nerves

Hi @theAntimon,

I haven’t seen this specific error, but I have a guess. The :ssh_sftpd module is provided by Erlang and I think that it may not be included if Erlang wasn’t compiled with OpenSSL support. To see if this is the case, start up IEx and see what you get from :crypto.info_lib/0:

$ iex
Erlang/OTP 26 [erts-14.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Interactive Elixir (1.15.6) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :crypto.info_lib
[{"OpenSSL", 269488511, "OpenSSL 1.1.1w  11 Sep 2023"}]

If you get an error, you’ll have to reinstall Erlang. I’d assume that OpenSSL development libraries or header files were missing when Erlang was installed, but I don’t know without more info. Hopefully this will give a clue that you can google for a next step.

A second thing to try, but please ensure that OpenSSL is definitely working before trying this, is to try my updated version of the Weather Station book code. That repository only updates the sensor_hub_poncho directory to let it be compiled with current versions of Elixir and Erlang. You can see the updates via the git commit history and they’re mostly dependency updates.

Hope this helps!

theAntimon

theAntimon

Thank you for your answer.

I get this:

iex(1)> :crypto.info_lib
[{"OpenSSL", 806354960, "OpenSSL 3.1.1 30 May 2023"}]

I also cloned your linked repository and tried it again but I get the same error.

But… I just removed all the erlang and elixir packages on my system and reinstalled them. And now it is working. It maybe really was because I already had Erlang installed before I installed some other dependencies. Anyway, now I’m happy :slight_smile:

Thank you!

— All posts loaded —

Where Next?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement