As the title says... Chat on...

User avatar
By silver18
#75386 Good morning to all!!
First of all I would like to thank you for all the info I found on this forum.

Recently, I decided to build a firmware with the online builder adding also SSL support as I plan to use it with MQTT.

Here is the problem: the very same script working on the previous firmware without SSL does not work on the new firmware with SSL.
The ESP8266 keeps waiting to get an IP!

Here are all the info from the working firmware:

Code: Select allNodeMCU custom build by frightanic.com
   branch: master
   commit: 5073c199c01d4d7bbbcd0ae1f761ecc4687f7217
   SSL: false
   modules: adc,bme280,dht,file,gpio,http,i2c,mqtt,net,node,tmr,uart,wifi
 build    built on: 2018-03-29 20:22
 powered by Lua 5.1.4 on SDK 2.1.0(116b762)



And here are all the info from the not-working firmware (with SSL):
Code: Select allNodeMCU custom build by frightanic.com
   branch: master
   commit: 67027c0d05f7e8d1b97104e05a3715f6ebc8d07f
   SSL: true
   modules: adc,bme280,dht,file,gpio,http,i2c,mqtt,net,node,tmr,uart,wifi,tls
 build created on 2018-04-14 19:37
 powered by Lua 5.1.4 on SDK 2.2.1(cfd48f3)


Finally here is the script:

Code: Select all-- Set WiFi
station_cfg={}
station_cfg.ssid = "MyWiFiSSID"
station_cfg.pwd = "MyWiFiPASSWORD"
wifi.setmode (wifi.STATION)
wifi.setphymode (wifi.PHYMODE_N)
wifi.sta.config (station_cfg)
wifi.sta.connect()

tmr.alarm(1, 1000, 1, function()
    if wifi.sta.getip() == nil then
        print ("Waiting IP")
    else
        tmr.stop(1)
        print ("Config done, IP is "..wifi.sta.getip())
      main_loop()
    end
end)


Using the same script, the first firmware gets IP after 3 iteration of the timer...Using the second firmware, ESP8266 keeps waiting...


Any clue?

Thanks to all!
User avatar
By marcelstoer
#75402
silver18 wrote:Any clue?


The clue is "powered by Lua 5.1.4 on SDK 2.1.0(116b762)" vs. "powered by Lua 5.1.4 on SDK 2.2.1". We promoted the version based on Espressif SDK 2.2.x from `dev` to `master` on April 2nd: https://github.com/nodemcu/nodemcu-firm ... r_20180402

So, your issue has most likely nothing to do with SSL vs. non-SSL. Could it be this issue: https://github.com/nodemcu/nodemcu-firmware/issues/2335 ?
User avatar
By silver18
#75419 Thanks a lot for your fast reply.
It was exactly the SDK version.
I managed to solve the issue using the workaround provided in the link.

As the whole thing now works, may I know why this happened?

Thanks again!