jjcarstens

jjcarstens

Nerves Core Team

(This is ported from an unrelated GitHub issue that I didn’t want to clog up)

I currently have a device that is just wlan0 network setup and have suddenly lost the ability to get to it via nerves.local (although IP address still works fine)

At first it would just last a few minutes but then I could connect as normal. Now I’m a week in and still can’t see nerves.local on my network from MacOS. Although not sure if that is network setup or my configuration…

Portion of my current config

config :nerves_init_gadget,
  ifname: "wlan0",
  address_method: :dhcp,
  node_host: :mdns_domain,
  ssh_console_port: 22

  [ssid, psk] = File.read!(".wlan_settings") |> String.split()

config :nerves_network, :default,
  wlan0: [
    ssid: ssid,
    psk: psk,
    key_mgmt: :"WPA-PSK"
  ]

case Mix.env do
  :dev ->
    config :nerves_init_gadget,
      mdns_domain: "nerves-dev.local",
      node_name: "nerves-dev"

  :prod ->
    config :nerves_init_gadget,
      mdns_domain: "nerves.local",
      node_name: "nerves"
end

Showing Posts 1 to 7

ConnorRigby

ConnorRigby

Nerves Core Team

I think there have been known issues with MacOS and mdns. I don’t run OSX, so i’m not really sure how to help, but on linux i need to restart avahi-daemon (the program responsible for mdns resolution) between network disconnects.

tmecklem

tmecklem

If you ping nerves.local, does it resolve to an IP that isn’t the same as your device, or does it say it can’t find the host nerves.local?

jjcarstens

jjcarstens OP

Nerves Core Team

Initial response from @fhunleth in GitHub..

@jjcarstens Since you can ping the device, I assume that it’s using DHCP to get an address and not link local. This particular issue deals with link local addressing. If you have any uncertainty, check your config.exs that both nerves_init_gadget and nerves_network are being told to use DHCP or post here.

My second guess is that multicast is being filtered on your wireless LAN. Some access points do this, but they’re usually corporate ones. To see if that’s the problem, could you try running Wireshark on your Mac and look for mDNS requests and responses? If you can log into your Nerves device, you can also run RingLogger.attach . The mDNS client that we use is pretty noisy, so you should see the requests there as well.

jjcarstens

jjcarstens OP

Nerves Core Team

Thanks for the suggestions @fhunleth. I checked my nerves_init_gadget and it sets address_method: :dhcp. nerves_network looks okay too. I wouldn’t except those to be the problem because for the first week or so running this I had no problem using nerves.local on mdns (and configs haven’t changed).

Did your second suggestion and RingLonger isn’t even logging thing from mDNS. Wireshark kind of confirms because all I see are mDNS requests from my machine and nothing back from my rpi3.

Device logs do show that this though which looks peculiar (seems like domain should not be empty):

12:00:22.666 [info]  DHCPManager(wlan0) udhcpc {Nerves.Udhcpc, :renew, %{domain: "", ifname: "wlan0", ipv4_address: "10.0.1.67", ipv4_broadcast: "", ipv4_gateway: "10.0.1.1", ipv4_subnet_mask: "255.255.255.0", nameservers: ["10.0.1.1"]}}

The other thing to note is that my network is an AirPort Extreme and the devies IP is a DHCP reservation mapped to its Mac address (not sure if that will matter)

Have to stop for now, but will start investigating more a little later tonight

jjcarstens

jjcarstens OP

Nerves Core Team

It says it cannot resolve the host. (Should have put that in there)

Sorry, there are also 2 other posts missing from this. Apparently they have to be approved by a moderator…

tmecklem

tmecklem

This does seem to be a router/switch problem. Getting mdns and the .local domain can be tricky on a local LAN if the router filters it out of the box, especially when WiFi is involved.

If you are assigning it a reserved IP address then you might get better results just adding a hostname/IP for it to your /etc/hosts file. I’m not sure if that’s a helpful solution for you or not.

jjcarstens

jjcarstens OP

Nerves Core Team

Thanks @tmecklem

I think you’re right it’s a router/switch problem. Using /etc/hosts worked like a charm and would be a great way to resolve this.

But, I wanted to go further (just for knowledges sake). Here’s what I ended up doing that seemed to get it all in a working state again:

  1. sudo killall -HUP mDNSResponder on MacOS machine to reset DNS cache and put mDNS daemon in clean state
  2. Restarted my router
  3. Restarted nerves device (rpi3) via unplug ↔ plug
  4. Performed a victory dance :tada::man_dancing:

I was hoping to be able to find more specific details for root cause and fixes, but decided this and utilizing /etc/hosts file was good enough in my case.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
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
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews