adrian

adrian

Setup mdns on nerves & elixir project

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!

Most Liked

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.

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

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!

Where Next?

Popular in Questions Top

siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
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
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
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
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
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
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
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

Other popular topics Top

mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
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
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52341 488
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
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
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
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement