Created
June 18, 2019 16:19
-
-
Save abobija/3d89eedc2c3d9712ed0c699c6a0f9ad7 to your computer and use it in GitHub Desktop.
Code written in YouTube video https://youtu.be/Tb3L4UcjlI4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function init_ws() | |
require('ws32_client') | |
.on('receive', function(data, ws) | |
print('WS received: ', data) | |
end) | |
.on('connection', function(ws) | |
print('WS connected') | |
local timer = tmr.create() | |
timer:register(2000, tmr.ALARM_AUTO, function(t) | |
ws.send('Hello!') | |
end) | |
timer:start() | |
end) | |
.connect('ws://demos.kaazing.com:80/echo') | |
end | |
wifi.mode(wifi.STATION) | |
wifi.sta.config({ | |
ssid = "Renault 1.9D", | |
pwd = "renault19", | |
auto = false | |
}) | |
wifi.sta.on('got_ip', init_ws) | |
wifi.start() | |
wifi.sta.connect() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment