-
Notifications
You must be signed in to change notification settings - Fork 638
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
1.6.6 Sonoff Basic doesn't connect to wifi #86
Comments
Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown): Hi Tim, what is working well for me under 1.6.6 is just doing straight dhcp ... this is what my WIFI config looks like do you have anything configure other than AP and password ? Maybe you are running static? Later Ferdie |
Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown): This is the basic on 1.6.6 But this said - when I configure only static IP and Gateway and leave Netmask and DNS blank - it still uses dhcp. Let me try and get to your error where you are "stuck" in AP mode. Later Ferdie |
Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown): As a side note static only works if you define all the fields, no more auto semi-updating. ( This is relevant if you configure your ssdi and password via usb) Can you define yours as static, with all the fields and see if that makes for "fix" going to erase flash mine now. This should remove all previous configs. I use the terminal to set my initial wifi config have not use the AP mode in a while. Later Ferdie |
Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown): Yeah as of 1.6.6 I run embedded ... |
Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown): This worked for me - just did it again to double check.
All good - device comes up on dhcp in seconds. Later Ferdie |
Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown): Saw something interesting, Just did step 1 - 4 ... did not power cycle and the AP comes up with
No IP Power cycle and rest to see what is going on and I now have an AP IP. |
Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown): Access the AP via the standard fibonacci password - get the password change, define my new password, test it. Disconnect and forget the AP WIFI - reconnect to the same WIFI name but this time authenticate with your new password. Go back into 192.168.4.1 configure WIFI. Netmask and DNS was pre-populated rest device - device connects in STA mode all good.
Later Ferdie |
Original comment by Tim K (Bitbucket: clueo8, GitHub: clueo8): A few questions. Is the EMBEDDED_WEB a build flag? I've never tried Terminal access, but I feel it could really help me debug; can I use my same FTDI USB that I use to flash the firmware? Do you power off the main for that or do you connect to the 3.3 pin still? |
Yes, the EMBEDDED_WEB is a build flag and it's disabled by default atm. Still testing, will probably roll out in 1.7.0. You can use the same FTDI USB2UART you use to debug. Don't do it while plugged to mains!!! But if you do PLEASE USE CAUTION!! It can be deadly dangerous. If the board is powered in some other way just plug TX, RX and GND. Do not do it for the POW. NEVER. In the POW the ground is shared between the controller and mains. |
The static IP only works if you have all 4 fields populated (IP, GW, NETMASK and DNS). Otherwise it will always go DHCP. I have also seen the 0.0.0.0 IP for AP mode a couple of times. It looks like a race condition. Erasing the flash normally helps if your device does not respond. With the just released 1.6.7 you also have the option to hard-reset it holding the button for more than 10 seconds. Hard-resetting clears the (emulated) EEPROM, so all settings are lost. After doing it should start in AP mode with the default "fibonacci" password. |
I have noticed that too. Maybe due to noisy power supply? |
Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown): Not very scientific or accurate, but this helps me out when I am playing with the esp's. Voltage swings on the front side of the FTDI are ok as long as you get around 3.3 on the sonoff itself. Mine is 3.36 on the multi-meter even if (and this is different with various charger doctors because they are so cheap and nasty) inline drops to 4.8volts. For this FTDI and this charge doctor I track the following. 0.10A - serial + mqtt is being monitored in platformio. 0.04A device is being flashed. 0.09A reboot, wifi negotiation and working with normal mqtt this sits at around 0.07A. yes accuracy is problematic but the numbers give me some idea what is going on, like dead short or more current draw go look etc. Later Ferdie |
Original comment by Sachin Filinto (Bitbucket: sfilinto, GitHub: sfilinto): just flashed with the latest version & facing similar issue. i get the AP when connected via the usb to serial interface but wont work on 220V mains for 90% of the times i have flashed it. |
Original comment by Tim K (Bitbucket: clueo8, GitHub: clueo8): So this is still happening on 1.6.8? I'm waiting on 3 basics to come in the mail, was hoping it wasn't an issues anymore. Try 1.6.5, that's the latest which worked for me. Are you using any build flags or features apart from the OOTB configuration? |
Original comment by Sachin Filinto (Bitbucket: sfilinto, GitHub: sfilinto): I tried 1.6.8 as well as 1.1.0 ( which i am using on my other devices ) same behaviour. works on usb but no-go on mains. I am not using any build flags or any other configuration. its the stock firmware. |
Original comment by Jordi (Bitbucket: jorditpuig, GitHub: jorditpuig): I can confirm that I am also having issues with 1.6.8 at the original Sonoff. I have two of them and for both connecting when still powered by the USB seamed to work pretty well, when I connect them to the mains I have a hard time connecting them to any of my 2 wifis. Actually the hardest issue is that the hard reset (10sec press) requires repeating the process a couple of times till it works and even then connecting to the soft AP is really hard. In fact, I have managed to connect to one of them and configure it only after insisting more than 50ish times and even then only after setting my laptops IP statically to 192.168.4.2. During the process of connecting to the soft AP I was either getting authentication errors or timeouts while getting the DHCP response or simply the soft AP disappearing after I connected. Yesterday after disconnecting the connected Sonoff from the mains it returned to its old state of not being able to connect to my wifis. Resetting does work but I cannot connect to the soft AP no matter what kind of tricks I pull out or device I am using. Btw I have also bought two S20s. I flushed them with the same 1.6.8 and I have never had any issues with them. Both connected and responsive to REST requests. I am deploying using platformio and I am not setting any extra compile-time flags. I will try with older releases (e.g. 1.6.5) to see if this is a recently introduced "bug". |
Original comment by Sachin Filinto (Bitbucket: sfilinto, GitHub: sfilinto): From the 3 sonoff basic that i ordered, i got one working on mains after flashing it some 15+ times ( V 1.1.0). no changes in the firmware. |
Original comment by Tim K (Bitbucket: clueo8, GitHub: clueo8): I'm noticing inconsistent amungst my 4 basic sonoffs as well. Two of them took an OTA upgrade from 1.6.8 to 1.6.9 without issue but my other two were stuck in AP mode after a successful upgrade and I was forced to go back to 1.6.8 on just two of them. One of the bad ones wouldn't let me connect to the AP and I had to flash with the serial cable. The other I was able to connect to AP and downgrade OTA. |
I'm also inclined to think it's a hardware related issue, at least partially. One of my sonoffs struggles to connect to the WIFI but it behaves much better when there is no AC current flowing and closer to the AP. On the other hand my Sonoff TH, POW or S20 work great with the same firmware... |
@clueo8 An those two you had to downgrade, do they work fine with 1.6.8? |
Original comment by dscoolx6 (Bitbucket: dscoolx6, GitHub: dscoolx6): Hi guys, ive been breaking my head over this issue with 1.6.9! I have 3 SONOFF basics and 3 DUALs, the stuck-in-AP issue is seen only on mains power, stupid green LED keeps blinking forever. I do not see any issue with DC power. I also didnt see this issue on 1.50 (which is what i was using since it was released. The reason i wanted to update the firmware was to use OTA. After much struggle, i can flash the firmware over OTA but not the spiffs! Uhhh. |
Original comment by Garoyuki (Bitbucket: doughnut_eater, GitHub: Unknown): Although I use espuruna for I AI-Thinker Wifi Light, the problem witch is same with Aaron's one happens. AI-Thinker bulb connects router, and gets ip address. However, it disconnects soon. Sometimes it returns html, but in almost cases it does not show anything because it's has been disconnected. |
Original comment by gulfmeister (Bitbucket: gulfmeister, GitHub: Unknown): There is no difference in the code between SLAMPHER and SONOFF flags. |
Original comment by f-fish (Bitbucket: f-fish, GitHub: Unknown): Hmm flashed some new basic's with 1.8.1 had no issue, what I did notice if your dhcp server is slow in getting an IP to the device a hard reboot is needed and then the second time I got dhcp no issues. My IoT network is a separate AP device but the DHCP server is still on my primary network / gateway .. Later Ferdie |
Original comment by Garoyuki (Bitbucket: doughnut_eater, GitHub: Unknown): I found that my AI-Thinker Wifi Light also connected to wifi router and obtained IP address by changing wifi router's setting. Encryption mode: WPA-PSK and WPA and WPA protocol: TKIP allows my light bulb to connect wifi router. WPA2-PSK/WPA-PSK/AES combination does not work. I confirmed this with 1.8.1. |
Original comment by Simon Coggins (Bitbucket: cernnunos, GitHub: cernnunos): I have the same issue with my Sonoff Basics. Have seven of them in total. First worked fine. Second got really hot after reboot and burnt out, completely dead now. 3 through 7 all stuck in AP mode. Just keeps saying it failed to connect to Wi-Fi and falls back to AP. All have been working find with Ewelink. Flash all 6 working ones with latest Tasmota and all 6 working happily on Wi-Fi. Would say that since Tasmota works fine that it's a firmware issue. I just don't get why the first one worked perfectly. |
Original comment by Sachin Filinto (Bitbucket: sfilinto, GitHub: sfilinto): @cernnunos I faced the same problem. I erased and flashed it several time until each one connected to the Wi-Fi. Some devices took almost 6 tries to get connected to the wifi. All my devices are working now. |
Original comment by dadja.sam (Bitbucket: dadja_sam, GitHub: Unknown): My sonoff basic uses PN25F08B flash chip. Had to flash it in DOUT mode. Device stuck in AP mode. Tried to factory reset it few times but no use. AC power not helping. |
Original comment by Alexander Micklewright (Bitbucket: alexmick, GitHub: alexmick): Same problem here, two brand new Sonoff Basic, flashed with the latest as of today (1.8.3). On the first one I managed to get to the web interface to configure my wifi but it was very tedious, constantly disconnecting and even once it was configured it wouldn't connect to my wifi (I checked, I'm close enough). The second one I never managed to get onto the Wi-Fi, and having configured my Wi-Fi through console it also wouldn't connect. The only thing that seemed bizarre or at least undocumented is that if I reboot the device through long press I periodically get Then I flashed Tasmota and it seems to work immediately so I don't think my devices are faulty. Hope this report helps a bit... |
Right now connection timeout is the main suspect here. I have had good results with a problematic Sonoff Basic allowing it more time to connect. Can anyone give it a try? Just add this code below to the top of the wifiConfigure method in wifi.ino:
|
Original comment by dadja.sam (Bitbucket: dadja_sam, GitHub: Unknown): I set this config setting to wifi.ino
Made a factory reset and set my wifi credintenals. Unfornutanely device is stiil in connection loop. |
Original comment by Andrew Chappell (Bitbucket: andrewchappell, GitHub: Unknown): So, I grabbed the latest dev branch with your change to this parameter, and have flashed two of my basics which previously wouldn't flash above 1.6 with no issues. If I'm feeling brave tomorrow I'll flash the one in the ceiling too! Edit: And can confirm the ceiling one flashed perfectly as well - you might well have cracked it! :) Cheers Andy |
Original comment by Axel Roest (Bitbucket: axello, GitHub: axello): Same problem here. Today flashed 4 Sonoffs with ESPEasy (after trying again with Espurna) and no go. I flashed a POW with Espurna 1.7.1 and I can connect without any problem to the built-in AP, but it refuses to connect to my (Unifi) access point. I set the setConnectTimeout to 30000, which did not make much difference. The output of the serial log is simple, but it simply does not seem to accept the DHCP values. I can check with wireshark if anything special is happening, but all my other devices, and ESPEasy don't seem to have this problem. Should I test with the dev branch instead of master?
|
Original comment by Axel Roest (Bitbucket: axello, GitHub: axello): Update: Sonoff S20 works flawlessly first time:
|
Original comment by Andrew Chappell (Bitbucket: andrewchappell, GitHub: Unknown): Yeah, thinking about it I have changed my router since they previously wouldn't connect, so perhaps this is a WIFI AP specific thing? Cheers Andy |
The Sonoff Basic looks like a tricky fellow. From Arduino IDE you can select the "Flash Size" to 512Kb (0K SPIFFS)" or using PlatformIO you can change environment for the sonoff-debug in the platformio.ini file to use these build flags:
|
Original comment by dadja.sam (Bitbucket: dadja_sam, GitHub: Unknown): Tried to set 512Kb (0K SPIFFS), reflash and factory reset. My attempt was unsuccessful. |
Original comment by Axel Roest (Bitbucket: axello, GitHub: axello): I tried your suggestions above. One extra mention: the flash on this Sonoff is a different manufacturer:
But the same problem occurs on Sonoffs with different flash ids. One other interesting thing I noticed. Sometimes, the AP network does not default to What I did
switched to latest dev commit 1346477
|
Version 1.9.0 adds some improvements and tweaks to the wifi connection manager. |
Original comment by Patrizio Bekerle (Bitbucket: patbek, GitHub: patbek): @xoseperez, thank you for this wonderful firmware! I was hit by the same problem with my Sonoff Basic devices (using https://github.com/SensorsIot/Espurna-Framework, which is at version 1.6.9). |
Original comment by Patrizio Bekerle (Bitbucket: patbek, GitHub: patbek): Just a notice: Yesterday I tested with the |
Original comment by gimi87 (Bitbucket: gimi87, GitHub: gimi87): Hello :) I have a weird issue with mine Sonoff-Basic device. Until 1.9.5 everything was ok. Currently (after upgrade from compiled latest dev) i am experiencing that one of two of mine devices is not connecting to the WiFi and turns into AP mode. While the second is working great. The router is between two devices away for about half meter. What i noticed on the working (connected to WiFi) device:
What i noticed on the not working (as AP) device:
Currently i changed the (AP mode) device to 1.9.5 version and is working very well. Any clues? |
Really, some sonoff basic have ghost-like problems with the wifi that are hard to reproduce... |
Originally reported by: Tim K (Bitbucket: clueo8, GitHub: clueo8)
I flashed sonoff basic with tty to 1.6.6; after flashing both firmware and filesys, I left it powered over the usb. It appeared to be in AP mode for maybe 3-5 minutes before connecting to wifi. I tried disconnecting the usb and powering off the mains and it would never connect. Installed 1.6.5 and all appears well with connecting to wifi after just a few seconds of being plugged in. I know there is an issue for tracking OTA updates and wifi issues, but this wasn't an OTA update.
The text was updated successfully, but these errors were encountered: