Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18146

Re: udp.parsePacket issues

$
0
0

Agreed for some reason nothing in my setup made it to the post.  Here is what I have running now.  I added some debugging. I can duplicate the issue 100% of the time.  This exact sketch minus the 2 lines that are setting the ip address work fine on uno or mega.  When this locks up it locks up really good, it never comes out of it.  The blinking I added stops.    Also, see the output log after the code.  After the log, look at the image capture from the top command in clanton after the lockup.

 

#include #include          // needed for Arduino versions later than 0018
#include #include
EthernetUDP Udp;

long timeout=0;
bool onoff = false;

void setup() {
  Udp.begin(12345);  Serial.begin(115200);  pinMode(13, OUTPUT);   system("ifconfig eth0 10.232.1.251 netmask 255.255.255.0 up");  system("route add default gw 10.232.1.1");
}

void loop() {
  uint16_t packetSize = 0;   if (millis() >= timeout)  {    if (onoff) {      digitalWrite(13, LOW);      onoff = false;    } else {      digitalWrite(13, HIGH);      onoff = true;    }         timeout = millis() + 1000;  }   while(true) {         Serial.println("A2");    packetSize = Udp.parsePacket();                                       Serial.println(packetSize);              if (Udp.available() && packetSize !=0)   {       Serial.println("A22");    } else {      Serial.println("A31");      break;         }            }  Serial.println("A3");     
}

 

Output:

A2
0
A31
A3
A2
21
A22
A2

 

This is just the last time it passed by ok then the failure.  The A2 is before the UDP read, 0 bytes to read everything goes ok.  next A2 there are 21 bytes to read.  A22 passes by then back to A2 and then the udp read and that is where it freezes up.

 

Checkout the top command:

 

galileolockup.png

 

I am stumped and really need to get this to work.  You can take my ketch upload it then just send any number of bytes to the UDP port and it locks up.

 

Mike


Viewing all articles
Browse latest Browse all 18146

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>