WebSocket not work after code burn into NodeMcu using espruino IDE #7082
Unanswered
espruino-discuss3
asked this question in
ESP32
Replies: 1 comment
-
Posted at 2018-04-09 by @gfwilliams Check out http://www.espruino.com/Saving you need to put your code in an Posted at 2018-04-10 by Saurabh Thanks i use onInt with settimeout now its working Posted at 2018-04-10 by @allObjects @user88627, using a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-04-09 by Saurabh
user88627
Hi
I am using NodeMcu with espruino_1v96 .
I write a program in debugging mode its working fine . when same program write in NodeMcu using save();
program is not working .
here is my Code
var led = new Pin(D4);
var host = "192.168.0.103";
var WebSocket = require("ws");
var ws = new WebSocket(host,{
path: '/',
port: 8000, // default is 80
protocol : "echo-protocol", // websocket protocol name (default is none)
protocolVersion: 13, // websocket protocol version, default is 13
origin: 'Espruino',
keepAlive: 60,
headers:{ some:'header', 'ultimate-question':42 } // websocket headers to be used e.g. for auth (default is none)
});
ws.on('open', function() {
console.log("Connected to server");
});
ws.on('message', function(msg) {
var data = JSON.parse(msg);
digitalWrite(led, data.bulb?1:0);
});
save();
Beta Was this translation helpful? Give feedback.
All reactions