Hi Guys,
I am trying to write a tcp server and set it up with a static ip.
Ultimately I would like to have a couple of esp8266 modules as server and client trade info.
I configured it the same way the above post does, but cannot get the client to connect.
I am just using netcat or my phone to try and connect now.
I can get the client to connect every time if I use the router issued ip address.
I have a couple of questions and I'm sure the answers are simple.
1st question is for the ifconfig() tuple.
What is a valid static IP address? Could I use something like '217.0.0.1'?
What should the DNS address be? When I use the router issued ip and use ifconfig() to get info about it
the DNS address is always the same as my internal ip address. Does this matter for this application.
The example in the docs shows '8.8.8.8'.
If I understand correctly I should set it up like this example:
Code: Select all
n = network.WLAN(network.STA_IF)
n.active(False)
n.active(True)
n.ifconfig(('217.0.0.1','255.255.255.0','INTERNAL_IP','DNS_ADDRESS'))
n.connect('SSID', 'PASSWORD')
Which is what I've done to no avail.
Thanks any help is much appreciated.
Tim