BG95-M3 UDP answers

Hello

I am sending udp packet to a server using “UDP” mode. It works but when I receive the packet I can see on the server side that the “origin” port of the packet is not set using “local_port” parameter I set. As a result, network firewalls does not let the answer goes back. (I am using an old version of BG95 firmware).

I am using
AT+QIOPEN=0,0,“UDP”,mydomainname,10101,10101,0
It works but,
received udp packet has (source_ip: device_ip, source_port: RANDOM, dest_ip: domain_ip, dest_port: 10101)

What is the best way to get udp answers goes back to the BG95 ? do I need to have source_port = dest_port so both devices uses the same port and then telecom network let packets goes around ?

Thank you

Hi @bobspam

Why are you using same local port and remote port? Please try with different port to create UDP socket.

Hello. My server is based on xinetd that does not provide REMOTE_PORT to underlying script. I try to find some turnaround before having to rewrite the server to have proper socket handling udp. I could send properly some answer payload using “socat” but I miss the actual port used by the device. Since source port “REMOTE_PORT” is random i need to find some tricks. That is why I am trying to have the device use some fixed source port.

Problem solved by rewriting server. now using regular socket and not using anymore xinetd.