- Mon Oct 19, 2015 1:00 pm
#31755
danbicks wrote:Use something like this: WiFi.config(Staticip, gateway, subnet);
Hi Dans,
Thanks, but that doesn't set the DNS server address...?
I've just done a little experiment, using Wireshark to monitor traffic, with steps equivalent to this:
node.dsleep(1000,4)
then after it wakes:
=wifi.sta.status() is 0
wifi.sta.setip({ip="192.168.1.10", netmask="255.255.255.0", gateway="192.168.1.1"})
=wifi.sta.status() is still 0
wifi.sta.connect()
The esp sends a IGMPv2 membership report for group 224.0.0.1 (what's that for?)
=wifi.sta.status() is now 5
conn=net.createConnection(net.TCP, false)
conn:on("receive", function(conn, pl) print(pl) end)
conn:connect(80,"www.nodemcu.com")
conn:send("GET / HTTP/1.1\r\nHost:
www.nodemcu.com\r\n"
.."Connection: keep-alive\r\nAccept: */*\r\n\r\n")
The esp sends a DNS request to 208.67.222.222 to query
www.nodemcu.com (twice in quick succession, actually).
That's not the usual DNS server for my network, so it looks like the esp has this DNS server address baked into it...? Maybe this is good enough for my requirements, but is there any way to override this address?
Rob.