Current Lua downloadable firmware will be posted here

User avatar
By picstart1
#2876 I hope I read everything but I'm missing details on how to send "hello esp8266" from a pc server on a specific port ex 9999. the esp8266 is the client via a wifi AP

The esp lua script would via a lua init file connect to the server using TCP knowing its IP and port.
The Server would send to the esp8266 IP a tcp/IP packet containing "hello esp8266".
The esp lua either the init script of another script file script would receive and unwrap the tcp packet it received and print the payload of "hello esp8266" via a PC terminal app (ex Coolterm)

With AT commands and an attached PIC MCU ... SEND gets payloads into packets and sent to the server and +IPD gets the packet payload form the server..I looking for a lua script that is the equivalent without the PIC MCU. I have the pc server code.

lua scripts stored in files within the esp8266 are a great way to 1) free the esp8266 from AT commands and 2) avoid having to write code and merge it into a firmware update.
NodeMcu's addition of a synchronous I2c interface to an external MCU or sensors (ex accelerometers ) initiated with lua scripts is a great step forward.
User avatar
By zeroday
#2879
picstart1 wrote:I hope I read everything but I'm missing details on how to send "hello esp8266" from a pc server on a specific port ex 9999. the esp8266 is the client via a wifi AP

The esp lua script would via a lua init file connect to the server using TCP knowing its IP and port.
The Server would send to the esp8266 IP a tcp/IP packet containing "hello esp8266".
The esp lua either the init script of another script file script would receive and unwrap the tcp packet it received and print the payload of "hello esp8266" via a PC terminal app (ex Coolterm)

With AT commands and an attached PIC MCU ... SEND gets payloads into packets and sent to the server and +IPD gets the packet payload form the server..I looking for a lua script that is the equivalent without the PIC MCU. I have the pc server code.

lua scripts stored in files within the esp8266 are a great way to 1) free the esp8266 from AT commands and 2) avoid having to write code and merge it into a firmware update.
NodeMcu's addition of a synchronous I2c interface to an external MCU or sensors (ex accelerometers ) initiated with lua scripts is a great step forward.


try
Code: Select allport = 9999
hostip = "192.168.1.99"   -- your pc server ip
sk=net.createConnection(net.TCP, false)
sk:on("receive", function(conn, pl) print(pl) end )
sk:connect(port, hostip)