adrian

adrian

I’m setting up a project using nerves and phoenix in a Raspberry Pi 3. I’m using nerves_init_gadget and I have this configuration:

config :nerves_init_gadget,
  ifname: "wlan0",
  address_method: :dhcp,
  mdns_domain: "nerves.local",
  node_name: "test_app",
  node_host: :mdns_domain,
  ssh_console_port: 22

I’ve being able to deploy, and the app is accessible on the device ip, but I can’t resolve nerves.local

I can’t figure out how this works from the mdns docs.

Should I do something on the router?

my resolv.conf contains the gateway nameserver: 192.168.1.1

Thanks!

First 4 of 4 Posts Switch mode

tmecklem

tmecklem

Hi Adrián!

nerves_init_gadget is most useful for projects on gadget capable hardware like the Raspberry Pi Zero. The Pi 3 can’t do gadget mode, which would give you the networking over usb that I think you may be expecting.

Can you describe a little more about your project setup? Namely, what’s your host OS and how are you networking the two devices together? If it’s over WiFi, there may be some additional things your DNS server or host OS need in order for mdns to work so it’s delpful to know more context.

adrian

adrian OP

Hi @tmecklem, thanks for your answer!

understood about nerves_init_gadget, I used it because it set up all the network and mdnds. Do you recommend me to use those packages instead of nerves_init_gadget?

My test setup is using wifi, but I haven’t decided yet if on production will be via wifi or ethernet. Probably a mix of them depending on my customer’s networks.

My host OS is ArchLinux, the host is connected via ethernet, and the Raspberry Pi over wifi as I mentioned.

My idea is to connect the device in my customer’s location and ask use mdnds to setup a hostname like: http://myapp for using it. I’d need to know what changes I need on the router or the hosts. For my customers I could have windows, macOS and Linux hosts.

Thanks a lot!

ConnorRigby

ConnorRigby

Nerves Core Team

I use a very similar config, and i get mdns on my rpi3 via wifi, and i also run arch linux. Have you tried getting Mdns working before this? I found i had to change a few configurations and install a few packages to get mdns to work.

adrian

adrian OP

I didn’t know I had to install some packages in order to make it work, thanks!

I followed these instructions and it worked: Avahi - ArchWiki

I have other questions though.

  1. http://nerves.local works on the host, but not on android phones

  2. If I want to use GitHub - rosetta-home/mdns: basic mdns server and discovery client · GitHub (and forget about nerves_init_gadget), the docs says:

To start the server, call Mdns.Server.start

but where? I can’t find an example of how to use it.

  1. Once the device starts, I can connect to a iex shell with ssh nerves.local. Is it possible to access the started mddns server that nerves_init_gadget started?

Thanks!

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
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
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
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement