Receiving Multicast Packets With RN-XV WiFly Sheild


I am currently working on a project and am trying to receive multicast packets on an Arduino Uno with a roving networks RN-XV WiFly module.

I have posted a question in full, with examples of the code I am using, over at StackOverflow. If it better suits, I can copy the examples etc. here.

In short - though - I am wondering if anyone knows the C/Arduino command to join a group (similar to Java's MulticastSocket.joinGroup(IP_Address) method) as I am unable to have the Arduino/WiFly module receive packets on the broadcast address.
I can, however, receive these packets with Java clients and am able to have the Arduino receive other UDP packets when they are sent across the local subnet broadcast ( which leads me to believe the WiFly module just hasn't been told to listen for packets on

Thank you very much! Any advice/help is greatly appreciated.

Edit: Will include code here too, for simplicity.

Below is the C code with which I am attempting to receive the data:

void loop()
    if(wifly.available() > 0)
        int EoL = 0;
        String s;
        while(EoL == 0)
          if(wifly.available() > 0)
              char rec =;
              if(rec != '\n')
                s += rec;
                EoL = 1;
        EoL = 0;  

And the code with which I am sending the multicast packet:

MulticastSocket theOut = new MulticastSocket(55001);
String message = userInput;
byte[] buf = message.getBytes();
DatagramPacket packet = new DatagramPacket(buf, buf.length, InetAddress.getByName(""), 2000);
DatagramPacket packetJ = new DatagramPacket(buf, buf.length, InetAddress.getByName(""), 55000);
theOut.send(packet);//Send to Arduino port 2000
theOut.send(packetJ);//Send to Java port 55000

The Java Client code:

MulticastSocket theIn = new MulticastSocket(55000);         
while ( true )                           // Loop
    byte[] buf = new byte[1024];                
    DatagramPacket packet = new DatagramPacket(buf, buf.length);
    String mes = new String( packet.getData(),0,packet.getLength() );