Hello,
based on the example found in the forum (https://www.campbellsci.com/forum?forum=1&l=thread&tid=691), we created a similar program on a CR1000.
The first transmission from the PC is successfully received by the CR1000 on the socket and the corresponding response ("OK") is sent, but from the second transmission onward, we always get the "Destination Port Unreachable" error, and the CR1000 doesn't receive the message.
We captured the packets with Wireshark, and indeed, this error is displayed.
We tried with both an NL121 and an NL201. We updated the firmware of both the CR1000 and the NL201 to the latest version found on your site. We couldn't find any firmware for the NL121.
Do you have any suggestions?
This is the program:
Public RX As String * 63
Public TX As String * 63 = "OK"
Public Sock As Long
Public nBytesRX As Long
Public nBytesTX As Long
Public ipInfoVar As String
BeginProg
Scan (5,Sec,0,0)
Sock = UDPOpen ("",5683,100)
RX = ""
TX = ""
SerialIn (RX,Sock,100,"",100)
nBytesRX = len(RX)
ipInfoVar = IPInfo(Sock,0)
If nBytesRX > 0 Then
TX = "OK"
nBytesTX=SerialOut(Sock,TX,"",0,0)
EndIf
NextScan
EndProg