Udp out error EACCESS

I am running Ubuntu Budgie 22.04.3 on a Raspberry Pi 4B. I am running Node-RED and I am trying to use a flow that has a UDP out node. I am trying to use that node to broadcast a UDP message to port 12020 on my local network broadcast IP address (xxx.xxx.xxx.255). I am trying to broadcast from a Raspberry Pi which is controlling my Ham Radio rig. I need it to be received on a Windows 10 PC that needs the information being broadcast for a windows based program that will not run under Ubuntu. It is giving me an error EACCES. I understand that this related to permissions, but I have no idea on how to fix it. Can someone please give me a hand?

Thanks,
Mike, AE8U

Please share the actual error so that people can take a look. Thanks.

image

This is the error in the debug window in the browser window of Node-Red. If you want the error from a different place, please let me know.

if you do a google search using "udp" : Error : send EACCES you will find many threads you should check out. EACCES is a permissions issue so looking at the various threads may lead you to a solution,

Not being a Windows user, this is the best I can offer to you (maybe someone else will have more knowledge than me about this).

Windows systems come in 2 forms, server and desktop. Desktop in particular has very tight inbound local firewall rules. So if you are trying to connect over UDP to a windows desktop, you will need to open a firewall rule accordingly.

Try checking out the connection from a command line - from Linux, this might help: How to connect to a udp port command line? - Server Fault

You may get a clearer indication. But almost certainly you need to change the firewall to allow the connection.

Also note that UDP is not a secure connection and this should NEVER be done (even if possible) over an untrusted network connection. Indeed, in an production environment, UDP connections would not be advisable except in tightly controlled physically local networks. In other words, there is a good reason you are getting that error and you should think about the approach and not just the error.

I think some of you might be misreading my original post. Node-Red is running on Ubuntu Budgie, and that is where the udp error is occurring. I may have confused everyone by even mentioning Windows.

For the record, I am running two amazing apps written by W1TR, which control my Palstar HF-AUTO and my Ameritron ALS-1306. In order for the programs to function, they need to receive the frequency in a udp message. The programs run in Windows, however. They will not run on a Raspberry Pi. So i need to have the Pi broadcast the frequency when FLRig changes it.

I hope that clarifies everything.

So I don't think I was misled? The apps run on Windows and Node-RED on a Pi. So the Pi needs to connect to Windows where the apps are running?

In that case, you absolutely need to open the Windows firewall to allow the inbound connection. The error appears on the Pi because it is the Pi that has been refused access but it is the Windows firewall that is doing the rejection.

1 Like

Hi Julian,

Thanks so much for taking your time to help me out.

The Pi does not connect directly to the Windows PC. It is not trying to broadcast the udp message to the Windows PC, but rather to the broadcast IP address, which is 192.168.201.255.

I have already checked the firewall, and have a rule to allow that port in and out. Also I have Samba instants on the Pi, and I can read the entire Pi file directory from Windows explorer, and can even open, edit and save Ubuntu config files from Windows.

Also, isn't the EACCES error a Node-Red error?

Thanks and 73,
Mike, AE8U

So I've never done this and it is a bit of educated guesswork. But it seems like UDP to a broadcast address may need you to declare the the address as accepting broadcasts. My guess is that the UDP node does not have this.

When using Node.JS UDP library to serve data, you need to add udpserver.setBroadcast(true).

Julian,

I am currently running my rig connected to the Windows PC. It is being controlled by DX Commander for frequency changes. I am also currently running WSJTX on the PC. I have both of them broadcasting to that IP address (192.168.201.255). DX Commander is broadcasting udp on port 12065. WSJTX uses port 12060. Both programs are working fine with that setup. And I can receive those udp messages with Node-Red on my Raspberry Pi with udp in nodes.

But if I try to receive udp in on 12065, and then send it right back out with a udp out node on 12020, I get the EACCES error.

So if I try your suggestion, where do I add your suggested command? Do I send it using a telnet window, like putty? Or is there a Node-Red config file somewhere that I add it to

Thanks and 73,
Mike, AE8U

No, telnet clients cannot send UDP. You need netcat or some similar tool.

No, it would have to be part of the code in the node.

I think that realistically, you will need to do it from a command line. If you can get it working manually from the command line, you can run that from an exec node.

Julian - in the the node we do

 if (node.multicast != "false") {
                    sock.bind(node.outport, function() {    // have to bind before you can enable broadcast...
                        sock.setBroadcast(true);            // turn on broadcast
                        sock.setMulticastLoopback(false);   // turn off loopback

so we do attempt to set the flags correctly for broadcast.
And port 12020 is not low numbered so should be accessible.
But we do try to bind to either the local or remote port - so @AE8U - how are both the udp nodes actually configured ?

EG on my MAC Wireshark looks like this


with the Broadcast

1 Like

Dceejay,

Thanks for your help. I am not sure I know how to get the information that you are asking for. As far as I know the udp nodes are not configured in any way, at least intentionally by me. I simply went into DXLabs control program DXCommander, selected config, then the General tab, then midway down I selected Net Serv. On that window I enabled UDP Network Service, and then on the first line I entered 192.168.201.255 for the IP Address and 12065 for the port. It immediately started sending and if I look at udp in on my Raspberry Pi Node-Red I get the following:

<?xml version="1.0" encoding="utf-8"?> DXLab 1 2107401 2107401 USB false

And from what I am learning, there are several programs (N1MM, FLDigi, DXCommander, and Logger 32 - maybe others) that send this exact same formatted report via udp. But If I try to do basically the same thing in Node-Red with the udp out port, I get the EACCES error. I am not a node.js programmer, and I am just beginning to learn Node-Red. I know that I am able to issue node.js command inside of a node, but I would need someone to give me the exact line by line format of what I should enter.

Sorry the udp message format got changed.

<?xml version="1.0" encoding="utf-8"?>
<RadioInfo>
<app>DXLab</app>
<RadioNr>1</RadioNr>
<Freq>2107401</Freq>
<TXFreq>2107401</TXFreq>
<Mode>USB</Mode>
<IsSplit>false</IsSplit>
</RadioInfo>

Ok - what I want to know is how you have configured the Node-RED nodes... the udp in one that is receiving OK... and the udp out one you are trying to set to broadcast...
eg if I set my out node like this


and in node like this

Then if I send something to the out node - I will receive it back on the in node.
(I know that is not exactly what you are trying to do but ...)