When I try to connect to my Arduino project, I'm getting this message:
client.connect(6123, '192.168.1.177', (err) => {
^
TypeError: client.connect is not a function
at Timeout.udpconnect [as _onTimeout] (/root/Bela/webgui/lib/node/arduino-communication.js:38:8)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
The code is:
function udpconnect() {
const message = Buffer.from('web gui IP:');
const client = datagram.createSocket('udp4');
client.connect(6123, '192.168.1.177', (err) => {
client.send(message, (err) => {
client.close();
});
});
}
The code works fine under Windows 10.