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

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
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
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
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New

Other popular topics Top

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
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
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

We're in Beta

About us Mission Statement