These are chat archives for esp8266/Arduino

25th
May 2016
picstart
@picstart
May 25 2016 15:28

The transmitter reads a GPS and puts a muticast packet into the air with the lat and long
after the receiver get several packets ( it varies ) it will crash and reset
I have the latest core 2.2.0 I suspect the core may have an issue.

Win10 64 pro error occurs with Arduino 1.6.8 core 2.2 ( It also occurs with 1.6.5
At times it will crash after the first packet is received most often it is after 20 or more packets are received

[code]#include <ESP8266WiFi.h>

include <WiFiUdp.h>

int status = WL_IDLE_STATUS;
const char ssid = "ssid"; // your network SSID (name)
const char
pass = "password"; // your network password

unsigned int localPort = 5001; // local port to listen for UDP packets

char packetBuffer[64]; //buffer to hold incoming and outgoing packets

WiFiUDP Udp;

// Multicast declarations
IPAddress ipMulti(239, 0, 0, 57);

unsigned int portMulti =5001; // local port to listen on
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);

// setting up Station AP
WiFi.begin(ssid, pass);

// Wait for connect to AP
Serial.print("[Connecting]");
Serial.print(ssid);
int tries=0;
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
tries++;
if (tries > 30){
break;
}
}
Serial.println();

printWifiStatus();

Serial.println("Connected to wifi");
Serial.print("Udp Multicast listener started at : ");
Serial.print(ipMulti);
Serial.print(":");
Serial.println(portMulti);
Udp.beginMulticast(WiFi.localIP(), ipMulti, portMulti);
}

void loop()
{
int noBytes ,message_size;

noBytes=0;
message_size=0;
noBytes= Udp.parsePacket(); //// returns the size of the packet
if ( noBytes>0 && noBytes<64)
{

Serial.print(millis() / 1000);
Serial.print(":Packet of ");
Serial.print(noBytes);
Serial.print(" received from ");
Serial.print(Udp.remoteIP());
Serial.print(":");
Serial.println(Udp.remotePort());
//////////////////////////////////////////////////////////////////////
// We've received a packet, read the data from it
//////////////////////////////////////////////////////////////////////
message_size=Udp.read(packetBuffer,64); // read the packet into the buffer

if (message_size>0)
{
packetBuffer[message_size]=0; //// null terminate
Serial.println(packetBuffer);
}

} // end if

delay(20);

}[/code]

Serial Monitor output

30:Packet of 44 received from xx.xx.0.105:4097
From: xx.xx.0.105:lat= 29.9051:lon= -92.0781

Crashes here with this error
Exception (0):
epc1=0x40106752 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys
sp: 3ffffd80 end: 3fffffb0 offset: 01a0

stack>>>
3fffff20: 40221c53 005e0001 4020ba44 3ffec4c0
3fffff30: 3ffefcbc 00000001 40221c92 4020ba5d
3fffff40: 40221aa1 3fff023c 3ffec4c0 3ffe9950
3fffff50: 3ffe0000 3ffefcbc 3ffee810 40222490
3fffff60: 3fff023c 3fff00bc 3ffe9978 3ffec4c0
3fffff70: 3fff00bc 00000014 4022179e 3fff023c
3fffff80: 3fff00bc 3fffdc80 3fff012c 3fffdcb0
3fffff90: 40219133 3fff023c 00000000 40202983
3fffffa0: 40000f49 3fffdab0 3fffdab0 40000f49
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(1,6)

Decoding 11 results
0x40221c4b: igmp_tmr at ?? line ?
0x4020ba3c: ieee80211_deliver_data at ?? line ?
0x40221c8a: igmp_tmr at ?? line ?
0x4020ba55: ieee80211_deliver_data at ?? line ?
0x40221a99: igmp_input at ?? line ?
0x40222488: ip_input at ?? line ?
0x40221796: ethernet_input at ?? line ?
0x4021912b: ets_snprintf at ?? line ?
0x4020300f: loop_task at C:\Arduino\arduino-1.6.8\portable\packages\esp8266\hardware\esp8266\2.2.0\cores\esp8266/core_esp8266_main.cpp line 43 @liangzelang @liangzelang

I can confirm that with win10 pro Arduino IDE 1.6.9 and staging 2.3 rc1 the issue with receiving multicast UDP packets is resolved.
Thanks to all who assisted
Martin Ayotte
@martinayotte
May 25 2016 15:41
Yes, the fix was esp8266/Arduino@0b7f8f9