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

User avatar
By picstart1
#4084 Lua is a big improvement for testing the esp8266.
Concept:
an esp8266 controls some sensors or switches and another web connected device ( ex cell phone) needs to get and set the state of the sensors or switches.
Option 1:
esp8266 is a client and gets a dynamic IP address via an AP. The server gets the esp IP address.
The cell phone also gets a dynamic address and becomes a client of the central server the esp8266 is a client of.
Both the cell phone and the esp8266 know the central server IP either directly or via dsn.
The central server maintains a list of currently connected esp devices and transfers to the cell phone the list of IP's and relays sensor data and switch settings and allows the cell phone to set switch states of a selected esp8266 IP
Option 1 is working but needs a central server.

Option 2: ( not sure how to make this work)
esp8266 devices act as servers after obtaining a dynamic IP from an AP
cell phone via a browser receives a form from the esp8266 and via action GET sets switches.
( the issue is the esp8266 IP is dynamic and the esp8266 IP is not known ( I can make it work if the esp8266 IP is known))
Now a static IP would be better but I don't know how to set a static IP for the esp8266.
If the cell phone could address any of several esp8266 servers by name by dsn the dynamic IP would be discoverable by the cell phone.
Need ideas for Option 2
User avatar
By villTech
#4088 ip of esp module can now be set in the latest AT sample from espressif. so the work around i did to have a static ip is to set the ip on power up after it get connected to an AP.

sorry guys. im outta here… :D :D :D
Last edited by villTech on Fri Dec 05, 2014 10:02 pm, edited 1 time in total.
User avatar
By picstart1
#4097 I know every esp8266 has this static IP 192.168.4.1. What lua would have to do since there often might be several esp8266's configured as servers is change the static IP so each device would have a unique static IP. I don't think lua can do this as of now.
Now an esp8266 could act as the central server and maintain a list of other esp8266's connected as clients, but I believe the number of connections is very very limited and probably not much use.
It seems to me that many applications ( Ex home sensor network) would have multiple esp8266's so the inability to discover any of many esp8266's acting as servers especially if each server gets a dynamic address does violence to the practical use of the esp8266 and that only connecting as clients has possibilities.
I am wrong in concluding that a network of multiple esp8266's configured as servers is a fools errand?