This may be user error, as the espruino websocket server example works when the client is a web browser. when trying to get the client to be a node.js app, i'm having issues.
this gives the same error from node.js. i can see the blue light flash on the espruino when i run the client, but there is no output in the espruino repl.
is there an example for espruino websocket server, and node.js client?
const WebSocket = require('ws');
const ws = new WebSocket('ws://192.168.1.203:8000/');
ws.on('open', function open() {
ws.send('something');
});
ws.on('error', function(err) {
console.log(err);
})
ws.on('message', function incoming(data) {
console.log(data);
});
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This may be user error, as the espruino websocket server example works when the client is a web browser. when trying to get the client to be a node.js app, i'm having issues.
this gives the same error from node.js. i can see the blue light flash on the espruino when i run the client, but there is no output in the espruino repl.
is there an example for espruino websocket server, and node.js client?