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.

I assume you are running this from the command line with node ? The version of node on the board is pretty old (8.something), maybe the one you've used on Windows is newer?

    giuliomoro Exactly!Is there a way to upgrade node on the Bela? And if not, what way can I use to connect to an UDP server from Bela? I founds this:
    socket.connect(port[, address][, callback])
    #
    Added in: v12.0.0
    So Bela's node.js is lower than v12? (Latest is v17)