Chat freely about anything...

User avatar
By Toshi Bass
#10524 OK I did some test on my 2 esp-12, which loose connection on a regular basis and your right if I choose mode3 SOFTAP I can see 2 new AP,s (not what I want) but I don't see AP's for the 2 esp01's that have a stable connection, that got me thinking .. then I remembered what I did when I set up the 2 esp01's I set them up (without knowing exactly what I was doing) as follows :

wifi.setmode(3)
wifi.setmode(wifi.STATION)
wifi.sta.config("myssid","mypassword")

So for some reason initially including the line wifi.setmode(3) then I guess over-writing with wifi.setmode(wifi.STATION) does not make a AP but achieves wifi disconnection stability, so I tried this on my 2 esp-12's this morning at 9am its now 4.30pm and I just logged in and there still connected, believe me that's the first time they have stayed connected longer than 10 minutes, now I cannot see any AP's other than my wifi so I assume there connected in STATION mode but with no disconnection issues, so let me know if i'am still creating some security problem, thanks. OBTW still using 0.9.2 firmware.
User avatar
By tomte76
#10550 Thanks for the feedback. I can confirm that :? I re-flashed my nodeMCU firmware (NodeMCU 0.9.5 build 20150213) and did the same configuration you suggested. The module is still connected and it did not span up an own WLAN network :D Unfortunately I couldn't find a way to achive that also on any AT firmware by now. I'll take a look the next days.
User avatar
By tomte76
#10559 But it is still strange :| It worked fine until I reset the module with node.restart(). Afterwards it was broken again. So I tried to put the commands into init.lua. But this also didn't work right away, because there needs to be a delay between setting the mode to 3 and overwrite it with wifi.STATION. A tmr.delay() won't do it, because this delay seems to be blocking. So setting the mode to 3 can't to its magic. Finaly I wrote the following init.lua and it works now with node.restart() and also a powercycle or hw-reset (pulling reset low)

file.open("init.lua","w")
file.writeline([[wifi.setmode(3)]])
file.writeline([[tmr.alarm(0,2000,0,function() wifi.setmode(wifi.STATION) end )]])
file.writeline([[tmr.alarm(1,4000,0,function() wifi.sta.config("SSID","PSK") end)]])
file.writeline([[tmr.alarm(2,11000,0,function() print(wifi.sta.getip()) end)]])
file.close()
User avatar
By tommybee
#10681
tomte76 wrote: Unfortunately I couldn't get the espressif firmware to work, neither 0.9.5 nor 0.9.6. I was able to flash the images, the module starts up an shows ready but it does not accept any AT-command. I was not able to figure out the problem by now.


About to flash the original espressif firmware, it took me long time to figure that out.
You have to flash all files together at once with esp-flasher or nodemcu flasher in exactly that order:
blank.bin 0x3E000
boot_v1.2.bin 0x00000
user1.bin 0x01000
blank.bin 0x7E000

If you start to flash at offset 0x00000 as i always did, it won't work. Why? I don't know :roll: :roll: :roll:

Baudrate after flash is 115200, AT must end with \r\n