nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.65k stars 3.12k forks source link

HTTP request failed when trying to make a GET #1545

Closed bistory closed 7 years ago

bistory commented 7 years ago

Expected behavior

GET requests from HTTP module worked.

Actual behavior

Before v1.5.4, GET requests were working as expected. I downloaded a new firmware and HTTP is not working anymore.

Test code

-- Your Wifi connection data
local SSID = "TEST"
local SSID_PASSWORD = "PASSWORD"

-- If connection is successful, read DHT and post
wifi.eventmon.register(wifi.eventmon.STA_GOT_IP, function(T)
    print("Config done, IP is " .. T.IP)

    http.get(string.format("http://www.google.com"), nil, function(code, data)
        if (code < 0) then
            print("HTTP request failed")
        else
            print(code, data)
        end
    end)
end)

NodeMCU version

1.5.4.1-master_20161001 -> Not working 1.5.1-master_20160603 -> Working

Hardware

Tested with ESP12F on a dev board and on the NodeMCU v2

marcelstoer commented 7 years ago

Tracked with #1546, thanks.