pubnub / arduino

The Official PubNub Arduino-based API!
Other
103 stars 49 forks source link

On publish using ESP86, board crashes #16

Closed jshaw closed 7 years ago

jshaw commented 7 years ago

As I mentioned in the ticket #15 the addition of the provided code to PubNubDefs.h and I see my messages get published once. Thanks! However, upon publishing, the Adafruit Feather ESP8266 seems to be crashing. As soon as it publishes, i see the message come in on the pubnub dashboard I see an Exception(3) in the serial port of the Arduino IDE. The full error output from the serial is below. Any ideas as to what might be causing the issue? Or a potential area that might be causing the problem?

The code I added to PubNubDefs.h was placed at the end of the script after the #endif on line # 692

The message I'm posting is: "{num:1, txt:'Yo!'}"

Beginning of loop...
Exception (3):
epc1=0x40201e66 epc2=0x00000000 epc3=0x00000000 excvaddr=0x4023004c depc=0x00000000

ctx: cont 
sp: 3ffef3c0 end: 3ffef720 offset: 01a0

\>>>stack>>>
3ffef560:  40105244 0055ec10 00005419 40201e29  
3ffef570:  65746144 6f4d203a 33202c6e 614a2030  
3ffef580:  3032206e 30203731 36333a32 3ffee700  
3ffef590:  00000000 00001388 00000044 00000036  
3ffef5a0:  0000001c 00000004 3fff0bfc 40202e7a  
3ffef5b0:  00000000 3ffee554 3ffee568 3ffef634  
3ffef5c0:  00000000 3ffee554 3ffee568 402024a8  
3ffef5d0:  00463625 00000006 3ffef6e8 40203671  
3ffef5e0:  00005419 3ffe85af 3ffef620 0000001e  
3ffef5f0:  3ffef634 3ffee550 3ffef6e8 402036bc  
3ffef600:  3ffe8565 000001f4 3ffee6c0 3ffee6ec  
3ffef610:  000000c8 3ffee550 3ffee6c0 4020257b  
3ffef620:  756e7b22 2c313a6d 74787420 6f59273a  
3ffef630:  227d2721 fee4f000 fe83543f 3430313f  
3ffef640:  fee4c400 202b2d3f fe84c540 0000003f  
3ffef650:  00000009 4affffff 77616853 00302e32  
3ffef660:  feefeffe feefeffe feefeffe 3ffef6f0  
3ffef670:  3ffee6c0 00000009 00000003 40203456  
3ffef680:  00216b72 00000001 3ffe8489 40203ba0  
3ffef690:  00000000 0000000c 3ffe84d4 3ffee6ec  
3ffef6a0:  3ffe86df 0000000d 3ffee6c0 40203339  
3ffef6b0:  3ffe8488 3ffee5d0 3ffee6c0 40203339  
3ffef6c0:  3ffe84c8 3ffee5d0 3ffee6c0 40203364  
3ffef6d0:  680010ac 00ffffff 3ffee6c0 40203388  
3ffef6e0:  3ffe8350 3ffee5d0 3fff0d2c 0000001f  
3ffef6f0:  00000014 680010ac feefeffe feefeffe  
3ffef700:  3fffdad0 00000000 3ffee6e4 4020385c  
3ffef710:  feefeffe feefeffe 3ffee700 40100718  
<<<stack<<<

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

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

wdt reset

Thanks,

justind000 commented 7 years ago

Getting this as well on an ESP12 board, after fixing the 'n' case issue and adding the string functions. #15

vveljko commented 7 years ago

Well, that exception report is way to cryptic to give much insight on what is the problem. You can try several things to see if some of them help:

  1. Publish a very simple message, like 1 - the number one. It's a valid JSON message, if not very interesting.
  2. If you also have a subscribe, remove the subscribe, leave only the publish
  3. If you also have a subscribe, remove the publish, leave only the subscribe

Let us know if any of these help.

rspock commented 7 years ago

I have a similar exception. After a bit of debugging the problem comes from this while loop: https://github.com/pubnub/arduino/blob/master/PubNubDefs.h#L640

daergoth commented 7 years ago

I had the exact same problem, but after hours of debugging, I found a possible workaround. If I deleted PROGMEM from this line, everything started working. const static char PROGMEM chunked_str[] = "Transfer-Encoding: chunked\r\n"; https://github.com/pubnub/arduino/blob/master/PubNubDefs.h#L652
I have to say I don't understand right now, why does this work, but I thought this information could provide some help to some people!

vveljko commented 7 years ago

Thank you very much @daergoth .