You must be logged in to reply.
Page 2 of 2 out of 17 messages.
TOPIC
[Solved]EMX with 4.2.9.0 UDP Broadcast Issue
Legend with 53,298 exp
1 year ago
Exp:   None hardware / None software   |   Own:   Spider
dont know but try your code in emulator Wink
if it works its ghi and not netmf related
Senior with 1,456 exp
1 year ago
Exp:   Excellent hardware / Excellent software   |   Own:   CANxtra, EMX, G120, Cerb40, Cobra, Panda
@andre.m - You must have read my mind. I just gave the emulator a try and it's working fine in there :/ Just had to remove some of the GHI specific lines and change the local endpoint. Below is what I ran in the emulator.

Code Language: C#
public class Program
    {
        public static void Main()
        {
            //string broadcastIP = "255.255.255.255";
            string broadcastIP = "100.100.255.255";
             
            // Set up UDP endpoint
            EndPoint localEndPoint = new IPEndPoint(IPAddress.Parse("100.100.100.254"), 28598);
            EndPoint remoteEndPoint = new IPEndPoint(IPAddress.Parse(broadcastIP), 28599);
            Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            serverSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
            serverSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
            serverSocket.Bind(localEndPoint);
           
            byte[] sendData = new byte[] { 0x1E, 0x10, 0xFF, 0xFF };

            for (; ; )
            {
                serverSocket.SendTo(sendData, remoteEndPoint);
                Thread.Sleep(1000);
            }
        }
    }

Legend with 53,298 exp
1 year ago
Exp:   None hardware / None software   |   Own:   Spider
now we know its definitively up to ghi to solve the broadcast issue
is not bad because we have our fix a bit earlier
Senior with 1,456 exp
1 year ago
Exp:   Excellent hardware / Excellent software   |   Own:   CANxtra, EMX, G120, Cerb40, Cobra, Panda
Using ostinato, I injected an ARP reply for 100.100.255.255 to resolve to FF:FF:FF:FF:FF:FF and it started working properly. Obviously once this ARP record expires or the device is rebooted, it will stop working.

-Dan Powers
Employee
1 year ago
Exp:   Excellent hardware / Excellent software   |   Own:   Spider
This is the chosen answer.
andre.m
now we know its definitively up to ghi to solve the broadcast issue
is not bad because we have our fix a bit earlier

Not exactly in this case as the TCP/IP stack used in NETMF is not used by the emulator. We will run few test on multiple devices to see if it is related to a single device or it is on all devices. My guess it will be on all devices and will report to Microsoft if that is the case.
Senior with 1,456 exp
1 year ago
Exp:   Excellent hardware / Excellent software   |   Own:   CANxtra, EMX, G120, Cerb40, Cobra, Panda
@Gus - Thanks Gus! I'll just work around the issue for now by using 255.255.255.255. It should work for my application for the time being.

Thanks guys,
Dan Powers
Senior with 1,456 exp
10 months ago
Exp:   Excellent hardware / Excellent software   |   Own:   CANxtra, EMX, G120, Cerb40, Cobra, Panda
@Gus - looks like the issue is resolved in 4.2.10.0. Marking it as answered.

Page 2 of 2 out of 17 messages.
You must be logged in to reply.