nekromant / esp8266-frankenstein

Alternative firmware for ESP8266 modules
318 stars 71 forks source link

Feature : auto connect to SSID at boot, plus more optionals #69

Closed pastcompute closed 9 years ago

pastcompute commented 9 years ago

I added the ability to optionally (disabled by default in config_default) have the controller automatically attempt to connect to an SSID at boot time. This is enabled only when default-mode=STA and new environment variable sta-auto=1 The variable sta-auto-ssid=something must be set, and optionally, sta-auto-password.

I also added kcnf options for disabling the banner and the second serial port (shown by default)

As an aside, I seemed to get a spurious DHCP server even when I was turning it off in .config. It seems there is one that gets turned on by libmain.a when DHCPS is compiled out, and this wierd behaviour only went away when I did a resetenv and rebooted.

(The following gets printed to the console, and the string I only found in the SDK fie libmain.a)

dhcp server start:(ip:192.168.1.1,mask:255.255.255.0,gw:192.168.1.1)

So I added a help reminder to kcnf

pastcompute commented 9 years ago

More changes:

nekromant commented 9 years ago

Hm... weird. Something changed in SDK once again, since up to some point it blobs would always automatically try to connect to an access point, and would always store the password plaintext somewhere at the end of the flash (don't remember the actual offsets). Can you check the last few blocks to see if they're still doing it? I'll merge this commit pr somewhere between Monday and Tuesday, as I get back.

pastcompute commented 9 years ago

Oh... maybe I did something wrong ..., I don't recall seeing my device auto connect but I wasn't paying much attention to that side of things until last weekend. Perhaps I flashed over the settings or something

Are you saying iwconnect followed by reset should have autoconnected using those settings next boot?

nekromant commented 9 years ago

@pastcompute Yes. That's what happened on <0.9.5 SDK and now it looks like it has changed. However it looks like the SSID and password data is still being written to flash, so we may be able to avoid exposing password information in environment at least

pastcompute commented 9 years ago

Heh, of course. (I have it stuck in my head to do it that way because on something else I spent a lot of time on recently the CONFIG_XXX things can be defined to 0 as well as 1... but presumably kconfig never does that) If you like I'll go through all the other ones I did that with and fix them to remove the extra check