Teensy 3.2 with Wiz820IO cannot receive multicast messages

Status
Not open for further replies.
I'm using Teensy 3.2 with an Wiz820IO and cannot receive UDP multicast messages.

I am trying to receive UDP multicasts from 239.192.0.1 on port 853, but get no packets.

During setup():
Code:
  EthernetUDP udp;
  IPAddress multicast_ip(239,192,0,1);
  Ethernet.begin( my_mac, my_ip, my_gateway, my_subnet );
  int success = udp.beginMulticast( multicast_ip, 853 );  // returns 1 = success

During loop():

Code:
int rxSize = udp.parsePacket();  // always returns 0 = no packet to read

I've watched with WireShark on an independent computer connected to the LAN segment, and Wireshark is able to capture the multicast messages, so I know they are there to be grabbed. Why isn't parsePacket() seeing any of them? Am I missing something in my code?
 
you could "git clone" Pauls latest Ether library into you libraries folder, or just upgrade your IDE's to 1.8.3/1.37 (and make sure you don't have older Ether library in your sketchbook libraries/)
 
As you suggested, I upgraded to Arduino 1.8.3 and TeensyDuino 1.37, but it still doesn't work. In fact, it is actually worse. When the Teensy starts up, the lights on the Wiz820IO ethernet jack will blink 5 or 6 times, then go out and never blink again.

I stripped down the sketch to the basics, as shown below. Any ideas what's wrong?
Code:
#include "Arduino.h"
#include "Ethernet.h"

uint8_t mac[] = { 0xDE, 0xAD, 0xBE, 0xEE, 0xEF, 0xED };
IPAddress our_ip(192,168,6,63);
IPAddress multicast_ip(239,192,0,1);
IPAddress dns(192,168,6,254);
IPAddress gateway(192,168,6,254);
IPAddress subnet(255, 255, 255, 0);
EthernetUDP udp;

void setup() {
  Serial.begin(9600);
  // startup procedure recommended by PJRC 
  // See: http://www.pjrc.com/store/wiz820_sd_adaptor.html
  pinMode(9, OUTPUT);
  digitalWrite(9, LOW);   // reset the WIZ820io
  pinMode(10, OUTPUT);
  digitalWrite(10, LOW);  // de-select WIZ820io
  pinMode(4, OUTPUT);
  digitalWrite(4, LOW);   // de-select the SD Card

  Ethernet.begin(mac,our_ip,dns,gateway,subnet);

  Serial.print("Our IP: ");
  Serial.println(our_ip);
  Serial.print(", subnet: ");
  Serial.println(Ethernet.subnetMask());
 
  int success = udp.beginMulticast( multicast_ip, 853 );
  Serial.print( "begin, success: " );
  Serial.println( success );
}

void loop() {
  int rxSize = udp.parsePacket();
  Serial.print( rxSize );
  Serial.print( " " );
  if(rxSize)
  {
    Serial.print( " from IP: " );
    Serial.println( udp.remoteIP() );  
  }
  Serial.print( "*" );
  delay( 250 );
}
 
Updating the reset sequence fixed the problem! I looked at Paul's instructions in the wayback machine, and found the code fragment that I was using. I didn't catch that it had changed. Thank you!
 
Status
Not open for further replies.
Back
Top