-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(WIP) update to latest nonos-sdk (SDK3) #4853
Conversation
Connection to wep routers should probably be disallowed, it's not secure. I believe that's the current case in our core. |
@@ -127,6 +127,7 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase, | |||
} | |||
|
|||
conf.threshold.rssi = -127; | |||
conf.open_and_wep_mode_disable = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this new call should depend on whether passphrase is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but wep should not be left aside even if it is obsolete. People sometimes need to experiment with old hardware and at the same time are living in open country.
typedef enum { | ||
MIN_SLEEP_T, | ||
MAX_SLEEP_T | ||
} sleep_level_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there info about what this sleep level means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question already asked, no answer yet. Reading actual values and playing with them may help #2330.
bool wifi_set_sleep_level(sleep_level_t level); | ||
sleep_level_t wifi_get_sleep_level(void); | ||
|
||
bool wifi_set_listen_interval(uint8 interval); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there info about what this listen interval means, and the units of the argument (e.g. ms)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No doc to my knowledge yet.
@@ -0,0 +1,71 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments explaining this script would help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to #4855 (improved and documented)
Following your recent message in espressif's BBS about WPA2, please try this pull-request which contains the latest version of the nonos-sdk. |
As described here (and the next post) I now get this error "there is no poison after the block":
|
Heap is corrupted. |
I'm not a specialist in this area. I think the following patch reverts to using the original bss stack (at the price of 4KB in our precious heap). Can you try replacing the code around (ref: #4622)
@earlephilhower @Adam5Wu @igrr Please correct me if I'm going in the wrong direction |
Ok, the error is the same but the stack is now considerably shorter.
|
The "poison" is a magic value used by the allocator (new/malloc) at the beginning (or end) of allocated RAM blocks to check whether allocation mapping is valid. 0x41492238 is not a valid address since it's in the flash area (or beyond). So probably a malloc's block size is corrupted and the checker fails. This could be a buffer overflow. The patch above seems to be (luckily :) useless but I personally still can't blame espressif at that point. I only have WPA2 APs (apart from a TTLS/PAP WPA2-Enterprise network - eduroam - which does not work with the esp) and the new fw works with it, so I can't test right now with a WPA2-Enterprise network. I think you really should reproduce your bug with the full native SDK alone outside from the arduino environment. Only if you manage to reproduce that with a native MCVE, espressif will be able to reproduce and fix. If the issue disappears with a native MCVE then we have to look for the source of the issue in the arduino core. |
That goes somewhat beyond what I'm familiar with. I'm guessing that involves something like setting up a toolchain (https://github.com/pfalcon/esp-open-sdk) and using that to compile the flash firmware file? |
I understand :) |
That last comment leaves me more confused than before. I can use the Arduino compiler - from the arduino IDE? - but what do I have to set the path to? |
The most simple is to follow their procedure and to use their compiler since it is documented. To answer your question, the esp8266/Arduino core's compiler is located in |
@victorclaessen Did you have a chance to try out the whole standalone native SDK method as @d-a-v |
I have made several attempts but it turns out I don't precisely know which
steps to take...
…On Fri, Jul 6, 2018, 17:43 kapyaar ***@***.***> wrote:
@victorclaessen <https://github.com/victorclaessen> Did you have a chance
to try out the whole standalone native SDK method as @d-a-v
<https://github.com/d-a-v>
suggested? It sounded a bit complicated for my level, so wanted to check
with you first. Also, if I were to test this PR, how would I get the files?
is it in teh staging version? I installed esp8266 via boards manager, and I
am not sure how to update the files with those from this PR. much thanks
for info.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4853 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKqUHNMp2EWBavA7JjtZo_EbszoN3-teks5uD4WHgaJpZM4U475N>
.
|
Aaaah! Seems like we are so close to getting this working but far away :( I will try to read upon this and see if i can figure it out too. Hopefully one of the main guys would get a moment to help us out. :) |
I will have a try and come back to you.
|
Here's a command-line walkthrough with a fresh esp-nonos-sdk. Tested with linux.
edit: We luckily have arduino for the simplicity of installation, examples, libraries, compilation and flashing :) |
Thanks for attempting to hold my hand and walk me through it. However, I still managed to trip over something...
Edit 1: Edit 2: If I take out the "ru" argument, then it works. I had to make a lot of symlinks (from objcopy to xt-objcopy, etcetera, because those xt-prefixed binaries did not exist. I now have two eagle files. Let's see if I can flash it. (By the way: I changed the SSID in the wpa2_enterprise example to eduroam and substituted some valid credentials.) |
Ok I flashed both files to the ESP8266. Then after finding the baud rate (74880) I get this, repeating very fast.
I'm not sure what we've learned now. I hope this effort was in some way useful to you @d-a-v. |
Google with |
Thanks for the hint. The output is now:
(the last part scandone..reconnect keeps repeating). Does this mean it connected succesfully? Edit: I've tried adding a piece of code to tell me if I got an IP address, but the whole thing is sufficiently different from what I'm used to with the Arduino-interface that I've not been successful yet. |
Is it the WPA2 example ? (logs are different with my tests in espressif's issue, link from #4806, |
Edit: yes that is the wpa2_enterprise example, only changed to match ssid+credentials.
I didn't before, but I have now done the erase_flash and reflashed the new
firmware.
This time I hit reset after making the serial connection so I captured the
start of the output as well.
````
SDK ver: 3.0.0-dev(c0f7b44) compiled @ Jun 26 2018 16:54:37
phy ver: 1136_0, pp ver: 10.2
This is an example for wpa2 enterprise...
WPA2 ENTERPRISE VERSION: [v2.0] enable
mode : sta(5c:cf:7f:68:28:e6)
add if0
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt
pm open,type:2 0
state: 5 -> 0 (2)
rm 0
pm close 7
reconnect
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt
````
…On Thu, Jul 12, 2018 at 11:25 AM david gauchard ***@***.***> wrote:
Is it the WPA2 example ? (logs are different with my tests in espressif's
issue, link from #4806 <#4806>, ...EAP-TTLS:
Start...).
If the esp is keeping reconnecting, it means it does not connect.
Have you tried to perform a full erase before flashing ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4853 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKqUHJJkl7eDrxsGhV9sUyg4AtX8h7Arks5uFxYUgaJpZM4U475N>
.
|
@ustccw Hi, Just a quick question. On your hostapd.conf, you have
I don't see a line like
Which is what most online examples show when using hostapd. Is this intentional or do you have a different conf file that you used? |
@kapyaar hi, here are the hostapd setup way: |
@kapyaar about |
I was able to follow your instructions and, YES the device connects to the AP, gets an IP as well.
Definitely good news, but I guess you already know this will work :) |
@devyte attaching a short write up and associated files. let me know if you need any further info. |
@ustccw Just checking back on this to see if you had any chances or visiting this again :) |
@kapyaar sorry that i am on a two more weeks business travel. thanks |
@ustccw No worries, I really appreciate your response, and I will wait for your further updates |
Just wonder if you can share your code here - I'm currently trying to connect to eduroam as well using the code d-a-v commented on 12 Jul, but I have no luck. My board is NodeMCU 1.0 (ESP-12E Module). As far as I know, my university is using PEAP as eduroam authorization method. I also changed nothing except changing the authentication info to suite my needs. I tried to receive debug info from a 2x16 LCD screen, and I got basically "STA_CONNECTING" for station status. There is one time I received "STA_WRONGPWD" (when I was using 2.4.2, 2.5.0-dev has some problem with this, and I explained it below), but I'm really sure my password is correct (I connected eduroam with my iPhone and everything went well). Finally, after a long time of failure, I received "STATION_CONNECT_FAIL". I really appreciate any help here - the hardware unit is fine (I tried to connect to a normal WPA2 network at home, and everything was fine). Just wonder if this is something wrong with my coding, or the SDK is still not updated yet. I just upgraded SDK today (2.5.0-dev), and I hope someone can give me some tips here... I don't currently have a spare router for me to set up my own WPA-Enterprise network, so I hope you can share the code with us, along with your configurations and info about your boards/SDK version, etc. ----some updates: I'm trying to use my computer in university now (my home does not have school network), and I used Wi-Fi debug level, then I see these exceptions from the output: WPA2 ENTERPRISE VERSION: [v2.0] enable Exception (28): ctx: cont
R⸮��⸮^ Then I found this is related to a helper function: lcd.print(sta_status_to_string(wifi_station_get_connect_status())); const char* sta_status_to_string(station_status_t status) { The status given by wifi_station_get_connect_status() is 255, which is not in status list. It should be 0-5. Therefore, I think there is something wrong with 2.5.0-dev. 2.4.2 worked fine, but the thing is 2.4.2 will give me a result of STA_WRONGPWD (as I said, I'm sure my password is correct). |
@zhxq You are not alone in this. :) I did make it work but that was with a specific AP setting using hostapd. It does not work with eduroam or other wpa2 enterprise networks. ustccw is working on this, so we must wait. :) For all the info I have including instructions, working code and setup, please see my previous comment/ attachments. |
I just moved to ESP 32 Platform, but I still got no luck. I think I'm going to try more about that platform now. I just hate WPA2-Enterprise - I cannot connect it without any hassle with these development boards for once (e.g. Rasp Pi, Arduino, ESP8266, ESP32)! |
@ustccw Hi, just a gentle follow up to see if you or your assisting team had a chance to revisit this. kind regards. |
@kapyaar thanks for your follow up~ will do |
@ustccw thanks for the update. Ok, I was only hoping you would be able to get back to this sooner. A shorter time scale would have been much more exciting given it probably needs a lot more testing and back and forth which will take it even further away, but I totally understand that you are busy too :) Let me know as and when things move. I believe there are lot of people who may be able to contribute if given a chance. Just a thought ;) |
I would like to throw my hat into this, as I also need connect the esp8266 to wpa2 enterprise network. I got as far as getting an access-accept Id from my freeRadius server (using eap-msvchapv2 for auth); however, according to the debug from my board a STA disconnect: 204 (Handshake timeout) occurs, and then my board will just keep retrying the authorization with the radius server. |
@ustccw Hope all is going well with you and team. Just a kind and humble request to keep this in your calendar so it wont get pushed back further :) Looking forward to the updates. best! |
Hello @ustccw , I just wanted to get back here and say that now with the hostapd config, and arduino IDE, the board is able to get an IP. This is great! I just wanted to see if you could put some time on the freeradius server? My hope is that since we are this far, if we can let the sensor connect to most common types of networks (eduroam for example), it would be terrific. If you want me to test or troubleshoot or help with any thing, please let me know. |
@ustccw I tested esp32 with wpa2 enterprise and works well in most all cases. Is there an easy way to merge the relevant files only to esp8266? |
This PR reflects espressif/ESP8266_NONOS_SDK@89920dc (v2.2.0-28-g89920dc)
wifi_{get,set}_sleep_level()
andwifi_{get,set}_listen_interval()
Now open or wep network must be selected before connecting.
This is introduced by
struct station_config
.open_and_wep_mode_disable
(this new entry was forgotten in the former PR). This value is currently set to true by default.Opened questions:
open_and_wep_mode_disable
can be set to false if the password is empty (is an empty password is only allowed when using open APs ?)WiFi.wepAllowed()
.(former PR #4806 has links about unsolved eduroam issue)