nerves-project-attic/nerves_network

Can’t set a static IP when using WiFi

ejpcmac opened this issue · 14 comments

When I try to set a static IP configuration on the wlan0, it does not connect to the access point. This is kind of problematic when you want to use the device as a server with a static IP.

Expected behaviour

You should be able to set the method to :dhcp or :static like with wired interfaces.

@ConnorRigby I see you’ve already patched this in 315e403. Why isn’t this merged on master? Anyway, I’ve checked the history and cherry-picked this commit in a branch on my fork. I don’t have a target with Wi-Fi at home to try this, but I’ll do on Monday morning at work.

@fhunleth have you had a chance to check this out?

As far as I understand, all commits from allow_static_wifi_config have been rebased on master, except the last one effectively allowing the static config.

Have you tested it out? It's been a while since I worked in this repo, but I believe it is ready for a minor release

@ConnorRigby No, the Raspberry Pi I have at home does not handle WiFi, so I can’t right now. I’ll do this on Monday, I have a Nerves app that works on a Raspberry Pi 3 at work —and I need a static IP on Wi-Fi, that’s why.

@ConnorRigby Sorry, I'm not maintaining nerves_network so I wasn't even paying attention. Your change looks fine at a glance. Assuming that you and @ejpcmac are good with it, then I think that you should merge it to master and make a new release.

There is an issue with the ipv4_* parameters being passed to wpa_supplicant, that does not seem to enjoy their presence. I’ll patch this, try, and let you know.

@ejpcmac let me know if you hit any issues. I've been away for about 3 weeks, and am just now getting back to work, and this is near the top of my list to take care of.

@ConnorRigby I’ve done a pull request #56, all works as expected now. I’ve tried to configure the wlan0 interface without any ipv4_*, then with the DHCP method and static. Both options work.

Okay cool. I actually have a number of things on that branch where you found that commit that i want to pull in. I'm working on that right now, then i will make sure to address #56

@ConnorRigby Weren’t theese commits rebased on master already? Compare the author dates on both branches, there seems to be lots of identical commits.

You're right. Thanks for saving me loads of merge commits!

Okay i just merged that #56 Thanks for the help!

You’re welcome! Thanks for Nerves, I want to use more of this. There are great ideas there.