nerves-project-attic / nerves_network

Connect to wired and wireless networks on Nerves platforms.
Apache License 2.0
58 stars 20 forks source link

running (from IEx) `Network.setup` doesn't seem set a new network #92

Closed tcoopman closed 5 years ago

tcoopman commented 5 years ago

Environment

|nerves_bootstrap| Loadpaths Start

Nerves environment MIX_TARGET: rpi3 MIX_ENV: dev

|nerves_bootstrap| Environment Variable List target: rpi3 toolchain: /home/thomas/.nerves/artifacts/nerves_toolchain_arm_unknown_linux_gnueabihf-linux_x86_64-1.1.0 system: /home/thomas/.nerves/artifacts/nerves_system_rpi3-portable-1.5.1 app: /home/thomas/Workspace/nerves/multiwifi

|nerves_bootstrap| Loadpaths End


* Shoehorn apps:

iex(multiwifi@nerves.local)11> Shoehorn.children
```elixir
[
  {Shoehorn.ApplicationController,
   {Shoehorn.ApplicationController, :start_link,
    [[init: [:nerves_runtime, :nerves_init_gadget], app: :multiwifi]]},
   :permanent, 5000, :worker, [Shoehorn.ApplicationController]}
]

Current behavior

I have a basic setup, started with the template from nerves_init_gadget, and a working network configured. When I log into an IEx and try to update the network to a new ssid with Nerves.Network.setup this doesn't do anything. I've looked into the code and can't figure out directly why this wouldn't work.

if I do SystemRegistry.register() in the IEx session and then flush, I get the original network configuration. So I thought, if I do Nerves.Network.setup that calls eventually into SystemRegistry.update, I should get the updated information when I flush, but I don't see anything new? So it seems that the new setup isn't passed into the SystemRegistry so, it can't get updated.

Expected behavior

Expected the network to change to the new network passed into setup. I was thinking that this would be a simple workaround for #72, but as this doesn't work, it doesn't help. I've also checked out the branch that is created for #72, but it seems that it's not completely trivial to update the branch for the current version of nerves_network.

ConnorRigby commented 5 years ago

I also noticed this with eth0. I'm not really sure why it's happening. I think it might be a quirk in SystemRegistry. Investigating more right now.

ConnorRigby commented 5 years ago

Fixed in #97