Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/home/pi/github/MPPT/version3_0/raspberryPi/MPPT/node_modules/ws/lib/websocket.js:314:19)
at each (/home/pi/github/MPPT/version3_0/raspberryPi/MPPT/server.js:184:16)
at Set.forEach ()
at broadcast (/home/pi/github/MPPT/version3_0/raspberryPi/MPPT/server.js:182:17)
at Timeout.mainLoop [as _onTimeout] (/home/pi/github/MPPT/version3_0/raspberryPi/MPPT/server.js:310:9)
at listOnTimeout (timers.js:324:15)
at processTimers (timers.js:268:5)
function broadcast(data) {
//debugMsgln("broadcast - number of clients " + wss.clients.size);
wss.clients.forEach(function each(client) { //182
//debugMsgln('sending to client');
client.send(data);
});
App should not quit. Add try-catch clause.
/home/pi/github/MPPT/version3_0/raspberryPi/MPPT/node_modules/ws/lib/websocket.js:320 throw err; ^
Error: WebSocket is not open: readyState 2 (CLOSING) at WebSocket.send (/home/pi/github/MPPT/version3_0/raspberryPi/MPPT/node_modules/ws/lib/websocket.js:314:19) at each (/home/pi/github/MPPT/version3_0/raspberryPi/MPPT/server.js:184:16) at Set.forEach ()
at broadcast (/home/pi/github/MPPT/version3_0/raspberryPi/MPPT/server.js:182:17)
at Timeout.mainLoop [as _onTimeout] (/home/pi/github/MPPT/version3_0/raspberryPi/MPPT/server.js:310:9)
at listOnTimeout (timers.js:324:15)
at processTimers (timers.js:268:5)
function broadcast(data) { //debugMsgln("broadcast - number of clients " + wss.clients.size);
}