Electron flashing cyan after particle.publish

I have an issue here with my electrons.
They connect to cell and to the cloud (breathing cyan).
Then, after the first particle.publish, they switch to blinking cyan, and have no cloud connection.
Cellular.localIP still shows an IP address.
This goes on forever.
I tried firmware 0.7.0rc7 and 0.8.0.rc2
Particle SIM and third party SIM.

Any ideas how to fix this?
Thanks
Arne

Seeing some code would help.

If you are using the standard publish or using the WITH_ACK flag, you may see the disconnect if the server-to-device path has timed out, because the acknowledge from the server is never received. This is a common occurrence with 3rd party SIMs when you don’t use a faster keep alive interval.

You can try using the NO_ACK flag to see if that keeps it from disconnecting, but you will still have function call and OTA issues if the server-to-device path has timed out.
Particle.publish("name","data", PRIVATE, NO_ACK);

Here’s a suggestion for the keep alive code, make sure to call the keep alive after you are connected.

Particle.connect();
waitUntil(Particle.connected);
Particle.keepAlive(30);
2 Likes

I was setting the keepAlive(30) during setup().
Changed that to “after connected” but this did not help.
After startup it takes about 30 seconds to connect to the cloud (breathing cyan) and then about 1 minute after startup it goes to flashing cyan with particle.connected=false. Issuing a particle.connect() does not help either.

Here’s part of the code ( I ommited all the variable declarations):

    #include "Serial4/Serial4.h"
    #include "Serial5/Serial5.h"
    #include "math.h"
    #include "cellular_hal.h"
    //STARTUP(cellular_credentials_set("internet.t-mobile", "t-mobile", "tm", NULL));
    //STARTUP(cellular_credentials_set("mobiledata", "user", "md", NULL));
    //STARTUP(cellular_credentials_set("iotde.telefonica.com", "", "", NULL));
    SYSTEM_THREAD(ENABLED);
    SYSTEM_MODE(SEMI_AUTOMATIC);
    byte cellAPNID = 0;
    String cellAPN = "DEFAULT";
    void setup() {
    	pinMode(D7, OUTPUT);
    	digitalWrite(D7, LOW);
    	OUTD7 = LOW;
    	pinMode(D2, INPUT_PULLUP);
    	pinMode(D3, INPUT_PULLDOWN);
    	int lbaud = 38400;
    	int ebaud = EEPROM.read(0);
    	if(ebaud >= 0 && ebaud < 4) lbaud = baud_rate[ebaud];
    	Serial4.begin(lbaud);
    	Serial5.begin(lbaud);
    	InitEEPROM();
    	switch(cellAPNID)
    	{
    		case 0:
                cellular_credentials_set("iotde.telefonica.com", "", "", NULL);
                cellAPN = "iotde.telefonica.com";
                break;
    		case 1:
                cellular_credentials_set("internet.t-mobile", "t-mobile", "tm", NULL);
                cellAPN = "internet.t-mobile";
                break;
    		case 2:
                cellular_credentials_set("mobiledata", "user", "md", NULL);
                cellAPN = "mobiledata";
                break;
    		case 3:
                cellular_credentials_set("internet.t-mobile", "tm", "tm", NULL);
                cellAPN = "internet.t-mobile tm";
                break;
    		case 5:
                cellular_credentials_set("spark.telefonica.com", "", "", NULL);
                cellAPN = "spark.telefonica";
                break;
    		default:
    		    cellAPN = "default";
    	}
    	time5 = millis();
    	Serial5.println("Get Cloud Ready...");
        if (EEPROM.read(2) == 1)
    		{
            	Serial5.println("Start Connect...");
    			Particle.connect();
    		}
    	Serial5.println("Setup Completed...");
    	CELLstate = LOW;
    }
    void loop()
    {
    	while(Serial5.available())
    	{
    		int inSer5 = Serial5.read();
    	    if (inSer5 == 49) {
    	        Particle.disconnect();
                Serial5.println("Particle Disconnect");  
            }
    	    if (inSer5 == 50) {
    	        Particle.connect();
                Serial5.println("Particle Connect");
                DoPublishInput = true;
            }
    	    if (inSer5 == 51) {
    	        Cellular.disconnect();
                Serial5.println("Cellular Disconnect");  
            }
    	    if (inSer5 == 52) {
    	        Cellular.connect();
                Serial5.println("Cellular Connect");  
            }
    	    if (inSer5 == 53) {
    	        Cellular.off();
                Serial5.println("Cellular OFF");  
            }
    	    if (inSer5 == 54) {
    	        Cellular.on();
                Serial5.println("Cellular ON");
                DoPublishInput = true;
            }
    	    if (inSer5 == 55) {
                cellular_credentials_set("iotde.telefonica.com", "", "", NULL);
                Serial5.println("SET CREDENTIALS");  
            }
    	    if (inSer5 == 56) {
                Serial5.print("CFUN=15");  
            		Cellular.command(30000, "AT+CFUN=15\r\n");
                Serial5.println(" DONE");  
            }
    	    if (inSer5 == 57) {
                Serial5.print("CFUN=16");  
            		Cellular.command(30000, "AT+CFUN=16\r\n");
                Serial5.println(" DONE");  
            }
            	    if (inSer5 == 48) {
                Serial5.println("CellConnecting:" + String(Cellular.connecting()));
                Serial5.println("CellReady:" + String(Cellular.ready()));
                Serial5.println("Particle:" + String(Particle.connected()));
                CellularSignal sig = Cellular.RSSI();
    			Serial5.println("RSSI: " + String(sig.rssi) + "/" + String((sig.qual + 1) * 2) + "%");
    		}
    	}
    	if (millis() - time5 > 5000 || millis() < time5) {
    		timer5s++;
    		Din2 = digitalRead(D2);
    		Din3 = digitalRead(D3);
    		Vin0 = analogRead(A0);
    		Vin1 = analogRead(A1);
    		Vin2 = analogRead(A2);
    		Vin3 = analogRead(A3);
    		EINGANGstr = String(Vin0*VINCal, 2) + ";" + String(Vin1*VINCal, 2) + ";" + String(Vin2*VINCal, 2) + ";" + String(Vin3*VINCal, 2)  + ";" + String(Din2) + ";" + String(Din3) + ";=>" + String(OUTD7) ; 
    		if (Din2 != Din2pub || Din3 != Din3pub) DoPublishInput = true;
            if (StartUpInfoSent == 0 && Particle.connected()) {
                Particle.keepAlive(10);
    	        bool result;
    	        INFOstr = "Startup: " + System.deviceID() + ";" + String(FWVERSION) + ";" + System.version() + ";" + String(millis());
    	        result = Particle.publish("Info", INFOstr, 300, PRIVATE, NO_ACK);
    	        if (result) StartUpInfoSent = 1; else Serial5.println("Startup Publish Fail");
                Serial5.println(String(timer5s) + " Published: " + INFOstr);
                DoPublishInput = true;
    	        //Cellular.command(2000, "AT+CSCS=\"8859-1\"\r\n");
    		}
    		if (timer5s % 12 == 0) {
    		    //ALLE 1 Minute:
    		    if (abs(Vin1-Vin1pub) > 40) DoPublishInput = true;
    		    if (abs(Vin2-Vin2pub) > 40) DoPublishInput = true;
    		    if (abs(Vin3-Vin3pub) > 40) DoPublishInput = true;
    		    if (OUTD7 != Dout7pub) DoPublishInput = true;
    		}
    		if (timer5s % 60 == 0) {
    		    //ALLE 5 Minuten:
    		    if (OUTD7 == HIGH) DoPublishInput = true;
    		}
    	    if (timer5s % 720 == 0) {
    		    //Jede Stunde ausfuehren:
                bool result;
                INFOstr = "V: " + String(FWVERSION) + " FW: " + System.version() + " FreeMem: " + String(System.freeMemory()) + " Up:" + String(millis() / 1000, DEC) + "s";
                //if (Particle.connected()) result = Particle.publish("Input", EINGANGstr, 300, PRIVATE);
                if (Particle.connected()) {
                    result = Particle.publish("Info", INFOstr, 60, PRIVATE, NO_ACK);
                        if (result) Serial5.println("Publish OK"); else Serial5.println(" Publish Fail");
                    }
            }
            if (DoPublishInput && Particle.connected()) {
                DoPublishInput = false;
                Serial5.println(String(timer5s) + " Publishing: " + EINGANGstr);
                bool result;
                result = Particle.publish("Input", EINGANGstr, 60, PRIVATE, NO_ACK);
                if (result) Serial5.println("Publish OK"); else Serial5.println(" Publish Fail");
                Vin0pub = Vin0;
                Vin1pub = Vin1;
                Vin2pub = Vin2;
                Vin3pub = Vin3;
                Din2pub = Din2;
                Din3pub = Din3;
                Dout7pub = OUTD7;
            }
        if (Particle.connected()) {
            CloudConnOK = timer5s;
            if (StartUpInfoSent > 1 ) {
                StartUpInfoSent = 1;
              }
        }
        if (CCLD == 1) {
            Serial5.println("PCon: " + String(CloudConnOK) + "/" + String(timer5s) + "/MO:" + String(MAXOFFLINE) + "/m:" + String(millis()) + "/CellReady:" + String(Cellular.ready()));
            if (((timer5s - CloudConnOK) > MAXOFFLINE) && (timer5s > CloudConnOK)) {
                Serial5.println("Full Reboot!!!!");
                fullReboot();
            }
        }
    	time5 = millis( );
    	}
    }

Can you try Cellular.on() before setting the APNs?

Also, where in your code are you setting Particle.keepAlive() for the other cases where Particle.connect() is called?
The way how your conditionals play together may (theoretically) prevent it to be called for all cases.

It looks like you have a lot going on there, and it can get quite confusing when you are running THREADED with Cellular.command() because the system doesn’t wait for the command to complete. Also if you are not using 0.8.0-rc.2 you may be running into issues with Cellular.command() where the AT commands collide with system calls to to the modem, fixed here

Could you also please try this code with your APN and see if it stays connected? There’s also logging over USB enabled if you want to take a peak with particle serial monitor --follow if you have issues.

SerialLogHandler logHandler(LOG_LEVEL_ALL);

SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);

STARTUP(cellular_credentials_set("your_apn_here", "", "", NULL);)

void setup() {
    Particle.connect();    
}

void loop() {
    static bool once = false;
    if (!once && Particle.connected()) {
        Log.info("SETTING THE KEEP ALIVE");
        Particle.keepAlive(10); // send a ping every 10 seconds
        
        // wait a bit to let the system settle and send final messages to the cloud
        static unsigned long ping_delay = millis();
        while (millis() - ping_delay < 20000) { Particle.process(); }
        once = true;
        Log.info("DONE SETTLING BY NOW I HOPE...");
    }
    
    // delay after the system settles so we can see it pinging every 10 seconds before the publish
    static unsigned long start_time;
    if (once) { start_time = millis(); }

    if (millis() - start_time > 30000UL) {
        start_time = millis();
        if (once && Particle.connected()) {
            Log.info("PUBLISHING UP TIME");
            Particle.publish("up-time", String(millis()), PRIVATE, WITH_ACK);
        }
    }
}
2 Likes

You can force Cellular.command() to block until complete in multi-threaded code with direct access to the HAL. This is totally a workaround, but an effective one. You may want to (or have to) change your code in the future when we update the Cellular Wiring API to support Futures/Promises.

// turning on the modem
if (cellular_on(NULL) != 0) {
  Log.error("Could not turn cellular modem on!");
}

// commands
cellular_command(NULL, NULL, 10000, "AT\r\n");

// turning off the modem
if (cellular_off(NULL) != 0) {
  Log.error("Could not turn cellular modem off!");
}

I tried the test code and will attach the log below…
You can tell at about “0000100099” where it tried the particle.publish and immediately started flashing cyan…
Full log here

    16.218 AT send      10 "AT+CREG?\r\n"
    18.018 AT read  +   14 "\r\n+CREG: 2,0\r\n"
    18.028 AT read OK    6 "\r\nOK\r\n"
    18.028 AT send      11 "AT+CGREG?\r\n"
    18.038 AT read  +   15 "\r\n+CGREG: 2,0\r\n"
    18.048 AT read OK    6 "\r\nOK\r\n"
    33.048 AT send      10 "AT+CREG?\r\n"
    34.848 AT read  +   14 "\r\n+CREG: 2,0\r\n"
    34.858 AT read OK    6 "\r\nOK\r\n"
    34.858 AT send      11 "AT+CGREG?\r\n"
    34.868 AT read  +   15 "\r\n+CGREG: 2,0\r\n"
    34.878 AT read OK    6 "\r\nOK\r\n"

    49.878 AT send      10 "AT+CREG?\r\n"
    51.678 AT read  +   14 "\r\n+CREG: 2,0\r\n"
    51.688 AT read OK    6 "\r\nOK\r\n"
    51.688 AT send      11 "AT+CGREG?\r\n"
    51.698 AT read  +   15 "\r\n+CGREG: 2,0\r\n"
    51.708 AT read OK    6 "\r\nOK\r\n"
    66.708 AT send      10 "AT+CREG?\r\n"
    66.708 AT read  +   14 "\r\n+CIEV: 2,2\r\n"
    66.720 AT read  +   30 "\r\n+CREG: 1,\"10CC\",\"1AC3EC\",2\r\n"
    66.732 AT read  +   36 "\r\n+CGREG: 1,\"10CC\",\"1AC3EC\",2,\"01\"\r\n"
    66.744 AT read  +   14 "\r\n+CIEV: 3,1\r\n"
    66.754 AT read  +   14 "\r\n+CIEV: 7,0\r\n"
    66.764 AT read  +   14 "\r\n+CIEV: 9,2\r\n"
CIEV matched: 9,2
    68.264 AT read  +   32 "\r\n+CREG: 2,1,\"10CC\",\"1AC3EC\",2\r\n"
    68.276 AT read OK    6 "\r\nOK\r\n"
    68.276 AT send      11 "AT+CGREG?\r\n"
    68.286 AT read  +   38 "\r\n+CGREG: 2,1,\"10CC\",\"1AC3EC\",2,\"01\"\r\n"
    68.298 AT read OK    6 "\r\nOK\r\n"
    68.298 AT send      10 "AT+COPS?\r\n"
    68.348 AT read  +   20 "\r\n+COPS: 0,0,\" \",2\r\n"
    68.358 AT read OK    6 "\r\nOK\r\n"
    68.358 AT send       9 "AT+CNUM\r\n"
    68.388 AT read  +   50 "\r\n+CNUM: \"***","***",145\r\n"
    68.410 AT read OK    6 "\r\nOK\r\n"
    68.410 AT send       8 "AT+CSQ\r\n"
    68.420 AT read  +   14 "\r\n+CSQ: 12,2\r\n"
    68.430 AT read OK    6 "\r\nOK\r\n"

[ Modem::join ] = = = = = = = = = = = = = = = =
    68.430 AT send      12 "AT+CGATT=1\r\n"
    68.432 AT read  +   30 "\r\n+CREG: 1,\"10CC\",\"1AC3EB\",2\r\n"
    68.444 AT read  +   36 "\r\n+CGREG: 1,\"10CC\",\"1AC3EB\",2,\"01\"\r\n"
    68.456 AT read OK    6 "\r\nOK\r\n"
    68.456 AT send      14 "AT+UPSND=0,8\r\n"
    68.466 AT read  +   17 "\r\n+UPSND: 0,8,0\r\n"
    68.476 AT read OK    6 "\r\nOK\r\n"
    68.476 AT send      23 "AT+UPSD=0,7,\"0.0.0.0\"\r\n"
    68.488 AT read OK    6 "\r\nOK\r\n"
    68.488 AT send      33 "AT+UPSD=0,1,\"internet.t-mobile\"\r\n"
    68.500 AT read OK    6 "\r\nOK\r\n"
    68.500 AT send      24 "AT+UPSD=0,2,\"t-mobile\"\r\n"
    68.512 AT read OK    6 "\r\nOK\r\n"
    68.512 AT send      18 "AT+UPSD=0,3,\"tm\"\r\n"
    68.524 AT read OK    6 "\r\nOK\r\n"
    68.524 AT send      15 "AT+UPSD=0,6,0\r\n"
    68.534 AT read OK    6 "\r\nOK\r\n"
    68.534 AT send      14 "AT+UPSDA=0,3\r\n"
    70.484 AT read OK    6 "\r\nOK\r\n"
    70.484 AT send      14 "AT+UPSND=0,0\r\n"
    70.494 AT read  +   31 "\r\n+UPSND: 0,0,\"10.201.183.62\"\r\n"
    70.506 AT read OK    6 "\r\nOK\r\n"
0000070506 [system] INFO: ARM_WLAN_WD 2
0000070506 [system] INFO: CLR_WLAN_WD 1, DHCP success
0000070506 [system] INFO: Cloud: connecting
0000070508 [system] TRACE: sparkSocket Now =-1
0000070512 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
    70.514 AT send      56 "AT+UDNSRN=0,\"49004c000c51343334363138.udp.particle.io\"\r\n"
    72.068 AT read  +   29 "\r\n+UDNSRN: \"34.203.200.250\"\r\n"
    72.080 AT read OK    6 "\r\nOK\r\n"
0000072081 [system] INFO: Resolved host 49004c000c51343334363138.udp.particle.io to 34.203.200.250
On first socketSocket use, free all open sockets
    72.081 AT send      15 "AT+USOCTL=0,1\r\n"
    72.093 AT read ERR  37 "\r\n+CME ERROR: operation not allowed\r\n"
    72.095 AT send      15 "AT+USOCTL=1,1\r\n"
    72.105 AT read ERR  37 "\r\n+CME ERROR: operation not allowed\r\n"
    72.107 AT send      15 "AT+USOCTL=2,1\r\n"
    72.117 AT read ERR  37 "\r\n+CME ERROR: operation not allowed\r\n"
    72.119 AT send      15 "AT+USOCTL=3,1\r\n"
    72.129 AT read ERR  37 "\r\n+CME ERROR: operation not allowed\r\n"
    72.131 AT send      15 "AT+USOCTL=4,1\r\n"
    72.141 AT read ERR  37 "\r\n+CME ERROR: operation not allowed\r\n"
    72.143 AT send      15 "AT+USOCTL=5,1\r\n"
    72.153 AT read ERR  37 "\r\n+CME ERROR: operation not allowed\r\n"
    72.155 AT send      15 "AT+USOCTL=6,1\r\n"
    72.165 AT read ERR  37 "\r\n+CME ERROR: operation not allowed\r\n"
socketSocket(UDP)
    72.167 AT send      18 "AT+USOCR=17,5684\r\n"
    72.177 AT read  +   13 "\r\n+USOCR: 0\r\n"
    72.187 AT read OK    6 "\r\nOK\r\n"
Socket 0: handle 0 was created
0000072187 [system] TRACE: socketed udp=1, sparkSocket=0, 1
0000072187 [system] TRACE: connection attempt to 34.203.200.250:5684
0000072189 [system] INFO: Cloud socket connected
0000072191 [system] INFO: Starting handshake: presense_announce=0
0000072191 [comm.protocol.handshake] INFO: Establish secure connection
0000072209 [comm.dtls] TRACE: restore size mismatch 1: 0/220
0000072211 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2
0000072213 [system] TRACE: send 115
socketSendTo(0,34.203.200.250,5684,,115)
    72.215 AT send      38 "AT+USOST=0,\"34.203.200.250\",5684,115\r\n"
    72.227 AT read  >    3 "\r\n@"
    72.277 AT send     115 "\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x00f\x01\x00\x00Z\x00\x00\x00\x00\x00\x00\x00Z\xfe\xfd\xa4W\x87\xb7UT,\xcbv\xfc9Gq+l+\xb2\xe3\xdf\x05\xc7-\xbf\x139\xd3\x14\x9c\xf5tN\f\x00\x00\x00\x04\xc0\xae\x00\xff\x01\x00\x00,\x00\r\x00\x0e\x00\f\x04\x03\x04\x01\x03\x03\x03\x01\x02\x03\x02\x01\x00\n\x00\x04\x00\x02\x00\x17\x00\v\x00\x02\x01\x00\x00\x13\x00\x02\x01\x02\x00\x14\x00\x02\x01\x02"
    72.425 AT read  +   17 "\r\n+USOST: 0,115\r\n"
    72.435 AT read OK    6 "\r\nOK\r\n"
    72.475 AT read  +   17 "\r\n+UUSORD: 0,60\r\n"
Socket 0: handle 0 has 60 bytes pending
    72.485 AT send      17 "AT+USORF=0,1024\r\n"
    72.505 AT read  +   99 "\r\n+USORF: 0,\"34.203.200.250\",5684,60,\"\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x00/\x03\x00\x00#\x00\x00\x00\x00\x00\x00\x00#\xfe\xfd Z\x8atVYiU\xc3\xc5\x83T4\xa7~\x06(-\xb4\xf5d\x81\xba\xab\xdcj\xed<3\x84\x99U4\""
    72.521 AT read OK    6 "\r\nOK\r\n"
0000072521 [system] TRACE: received 60
0000072521 [system] TRACE: send 147
socketSendTo(0,34.203.200.250,5684,,147)
    72.523 AT send      38 "AT+USOST=0,\"34.203.200.250\",5684,147\r\n"
    72.535 AT read  >    3 "\r\n@"
    72.585 AT send     147 "\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x01\x00\x86\x01\x00\x00z\x00\x01\x00\x00\x00\x00\x00z\xfe\xfd\xa4W\x87\xb7UT,\xcbv\xfc9Gq+l+\xb2\xe3\xdf\x05\xc7-\xbf\x139\xd3\x14\x9c\xf5tN\f\x00 Z\x8atVYiU\xc3\xc5\x83T4\xa7~\x06(-\xb4\xf5d\x81\xba\xab\xdcj\xed<3\x84\x99U4\x00\x04\xc0\xae\x00\xff\x01\x00\x00,\x00\r\x00\x0e\x00\f\x04\x03\x04\x01\x03\x03\x03\x01\x02\x03\x02\x01\x00\n\x00\x04\x00\x02\x00\x17\x00\v\x00\x02\x01\x00\x00\x13\x00\x02\x01\x02\x00\x14\x00\x02\x01\x02"
    72.745 AT read  +   17 "\r\n+USOST: 0,147\r\n"
    72.755 AT read OK    6 "\r\nOK\r\n"
    72.805 AT read  +   18 "\r\n+UUSORD: 0,345\r\n"
Socket 0: handle 0 has 345 bytes pending
    72.817 AT send      17 "AT+USORF=0,1024\r\n"
    72.837 AT read  +  158 "\r\n+USORF: 0,\"34.203.200.250\",5684,118,\"\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x01\x00i\x02\x00\x00]\x00\x01\x00\x00\x00\x00\x00]\xfe\xfdZ\x8atWh\x87y.r\x89M\xd1<\x9c\xc1\x8a\xaf\xc3?\xbe4\xda'M\xda\x9b\xfc\x9b\\\xf2\x0e\x9a '\x86rIPA\xa6\xa8b\xacNz\xc4\x1a\x11\x9f@EN(M\xdc~\xa0R\xce\x89\x14\xb3\xcd\xa0\x94\xc0\xae\x00\x00\x15\xff\x01\x00\x01\x00\x00\v\x00\x02\x01\x00\x00\x13\x00\x01\x02\x00\x14\x00\x01\x02\""
    72.857 AT read OK    6 "\r\nOK\r\n"
0000072857 [system] TRACE: received 118
    72.857 AT read  +   18 "\r\n+UUSORF: 0,227\r\n"
Socket 0: handle 0 has 227 bytes pending
    72.869 AT send      17 "AT+USORF=0,1024\r\n"
    72.899 AT read  +  209 "\r\n+USORF: 0,\"34.203.200.250\",5684,169,\"\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x02\x00\x9c\f\x00\x00\x90\x00\x02\x00\x00\x00\x00\x00\x90\x03\x00\x17A\x04\xb8\x93\xe8-\xa0^\xe2D\x92\x97\x82\xb3\xd5E\x8c\xc2P\x06\x1dU\x89\x15\x19\xdb\xd9\xb5\xadX\xaa\xc2\x8f!\"\x98\x84\x00\xd1B\xa6\x11\xdaxj\x97\xca\x02\xb98\x05@\x19\xb9!\x93'N^e\x8e\xc2]\xdc\xb9\x89\x04\x03\x00G0E\x02 \\\xfcS\x87\xa5\n\xe4\x89<\xb2\xc4\xee\xcfz\xeb@\x19\xe2F(\x1c\x7fA\xa0\x1b\x8dt\xb4\xe8^/\xb7\x02!\x00\xe3\xa4\x97u\xd3+:\xeaj\xca\x7f\x93\xf0\xaa \n\v\xb2\x91 P\xd8\x10\x9d\xcc\x12\x01\xe7\xa8\xe1u\xab\""
    72.921 AT read OK    6 "\r\nOK\r\n"
0000072921 [system] TRACE: received 169
    74.641 AT read  +   17 "\r\n+UUSORF: 0,58\r\n"
Socket 0: handle 0 has 58 bytes pending
    74.651 AT send      17 "AT+USORF=0,1024\r\n"
    74.671 AT read  +   72 "\r\n+USORF: 0,\"34.203.200.250\",5684,33,\"\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x03\x00\x14\r\x00\x00\b\x00\x03\x00\x00\x00\x00\x00\b\x01@\x00\x02\x04\x03\x00\x00\""
    74.685 AT read OK    6 "\r\nOK\r\n"
0000074685 [system] TRACE: received 33
    74.685 AT read  +   17 "\r\n+UUSORF: 0,25\r\n"
Socket 0: handle 0 has 25 bytes pending
    74.697 AT send      17 "AT+USORF=0,1024\r\n"
    74.707 AT read  +   64 "\r\n+USORF: 0,\"34.203.200.250\",5684,25,\"\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x04\x00\f\x0e\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\""
    74.721 AT read OK    6 "\r\nOK\r\n"
0000074721 [system] TRACE: received 25
0000074721 [system] TRACE: send 119
socketSendTo(0,34.203.200.250,5684,,119)
    74.723 AT send      38 "AT+USOST=0,\"34.203.200.250\",5684,119\r\n"
    74.735 AT read  >    3 "\r\n@"
    74.785 AT send     119 "\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x02\x00j\v\x00\x00^\x00\x02\x00\x00\x00\x00\x00^\x00\x00[0Y0\x13\x06\a*\x86H\xce=\x02\x01\x06\b*\x86H\xce=\x03\x01\a\x03B\x00\x04\xf6\xa1\x01X\x1c7\xe4\x89\xff\fS\x9d\xb7\xf9\xa2\xc5\xb6\xe1?\xde\xea@\x8fC\xde/\x91\xf0\x17\xd7\xc2Y\xd9\xa6{6\xea\xd5\xdb\xcd\x89F\x83\xc3\x9blX\x01\xf5+\xe6V\xec\x80^N^\x807\xf9\xe4\xa5q\xf4"
    74.931 AT read  +   17 "\r\n+USOST: 0,119\r\n"
    74.941 AT read OK    6 "\r\nOK\r\n"
0000076585 [system] TRACE: send 91
socketSendTo(0,34.203.200.250,5684,,91)
    76.585 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,91\r\n"
    76.597 AT read  >    3 "\r\n@"
    76.647 AT send      91 "\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x03\x00N\x10\x00\x00B\x00\x03\x00\x00\x00\x00\x00BA\x04\xeb\x88\xfeX\xad~f\xda\xbbK\xe2i\xf4\x13R\x96\xe1\xea\x06\xec\xf9AC=R\x8c\x11\x9e\xf3N\x8dh\x83\b\xfd\xfa\x86r;\x9b\xc5\xd4\xd0\xda\xef\x95\x82x\xcf\xe9\xc2`\x04\xaba\x10\xc5\xde\xfe\x910K)N"
    76.793 AT read  +   16 "\r\n+USOST: 0,91\r\n"
    76.803 AT read OK    6 "\r\nOK\r\n"
0000077681 [system] TRACE: send 99
socketSendTo(0,34.203.200.250,5684,,99)
    77.683 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,99\r\n"
    77.685 AT read  +   18 "\r\n+UUSORD: 0,345\r\n"
Socket 0: handle 0 has 345 bytes pending
    77.697 AT read  >    3 "\r\n@"
    77.747 AT send      99 "\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x04\x00V\x0f\x00\x00J\x00\x04\x00\x00\x00\x00\x00J\x04\x03\x00F0D\x02 <iEd\xb6\xb6\x17\xe4\xfb<\xf6x\xc3z\x10Y\xf5|\xf3\xe8\xc9D^\x8d)\xc6-\xc2\x8c\xa0>Z\x02 V\x11[\xa6G\xe0\xf9_x\xb5\xa2~\x0fa'\x85Jb\xc9\xc2\x9b\xbc\xca\x88\xee\x06\xbf\x9c2\x1f\x11\x15"
    77.893 AT read  +   16 "\r\n+USOST: 0,99\r\n"
    77.903 AT read OK    6 "\r\nOK\r\n"
0000077903 [system] TRACE: send 14
socketSendTo(0,34.203.200.250,5684,,14)
    77.903 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,14\r\n"
    77.915 AT read  >    3 "\r\n@"
    77.965 AT send      14 "\x14\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x05\x00\x01\x01"
    78.105 AT read  +   16 "\r\n+USOST: 0,14\r\n"
    78.115 AT read OK    6 "\r\nOK\r\n"
0000078117 [system] TRACE: send 53
socketSendTo(0,34.203.200.250,5684,,53)
    78.117 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,53\r\n"
    78.129 AT read  >    3 "\r\n@"
    78.179 AT send      53 "\x16\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x00\x00(\x00\x01\x00\x00\x00\x00\x00\x00\xe8c\xb2\xda\xcf\xdb\xa2\xee\xe3_[o\n\xde\xae\x00\xf2\x03\x9b\xf2\xbd|\xf4\xe7\x7f\xb5\x88I\xc9\x1c\a\x88"
    78.323 AT read  +   16 "\r\n+USOST: 0,53\r\n"
    78.333 AT read OK    6 "\r\nOK\r\n"
    78.343 AT send      17 "AT+USORF=0,1024\r\n"
    78.363 AT read  +  158 "\r\n+USORF: 0,\"34.203.200.250\",5684,118,\"\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x05\x00i\x02\x00\x00]\x00\x01\x00\x00\x00\x00\x00]\xfe\xfdZ\x8atWh\x87y.r\x89M\xd1<\x9c\xc1\x8a\xaf\xc3?\xbe4\xda'M\xda\x9b\xfc\x9b\\\xf2\x0e\x9a '\x86rIPA\xa6\xa8b\xacNz\xc4\x1a\x11\x9f@EN(M\xdc~\xa0R\xce\x89\x14\xb3\xcd\xa0\x94\xc0\xae\x00\x00\x15\xff\x01\x00\x01\x00\x00\v\x00\x02\x01\x00\x00\x13\x00\x01\x02\x00\x14\x00\x01\x02\""
    78.383 AT read OK    6 "\r\nOK\r\n"
0000078383 [system] TRACE: received 118
    78.383 AT read  +   18 "\r\n+UUSORF: 0,227\r\n"
Socket 0: handle 0 has 227 bytes pending
    78.395 AT send      17 "AT+USORF=0,1024\r\n"
    78.425 AT read  +  209 "\r\n+USORF: 0,\"34.203.200.250\",5684,169,\"\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x06\x00\x9c\f\x00\x00\x90\x00\x02\x00\x00\x00\x00\x00\x90\x03\x00\x17A\x04\xb8\x93\xe8-\xa0^\xe2D\x92\x97\x82\xb3\xd5E\x8c\xc2P\x06\x1dU\x89\x15\x19\xdb\xd9\xb5\xadX\xaa\xc2\x8f!\"\x98\x84\x00\xd1B\xa6\x11\xdaxj\x97\xca\x02\xb98\x05@\x19\xb9!\x93'N^e\x8e\xc2]\xdc\xb9\x89\x04\x03\x00G0E\x02 \\\xfcS\x87\xa5\n\xe4\x89<\xb2\xc4\xee\xcfz\xeb@\x19\xe2F(\x1c\x7fA\xa0\x1b\x8dt\xb4\xe8^/\xb7\x02!\x00\xe3\xa4\x97u\xd3+:\xeaj\xca\x7f\x93\xf0\xaa \n\v\xb2\x91 P\xd8\x10\x9d\xcc\x12\x01\xe7\xa8\xe1u\xab\""
    78.447 AT read OK    6 "\r\nOK\r\n"
0000078447 [system] TRACE: received 169
    78.447 AT read  +   17 "\r\n+UUSORF: 0,58\r\n"
Socket 0: handle 0 has 58 bytes pending
    78.459 AT send      17 "AT+USORF=0,1024\r\n"
    78.479 AT read  +   72 "\r\n+USORF: 0,\"34.203.200.250\",5684,33,\"\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\a\x00\x14\r\x00\x00\b\x00\x03\x00\x00\x00\x00\x00\b\x01@\x00\x02\x04\x03\x00\x00\""
    78.493 AT read OK    6 "\r\nOK\r\n"
0000078493 [system] TRACE: received 33
    78.493 AT read  +   17 "\r\n+UUSORF: 0,25\r\n"
Socket 0: handle 0 has 25 bytes pending
    78.505 AT send      17 "AT+USORF=0,1024\r\n"
    78.515 AT read  +   64 "\r\n+USORF: 0,\"34.203.200.250\",5684,25,\"\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\b\x00\f\x0e\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\""
    78.529 AT read OK    6 "\r\nOK\r\n"
0000078529 [system] TRACE: received 25
0000078529 [system] TRACE: send 119
socketSendTo(0,34.203.200.250,5684,,119)
    78.531 AT send      38 "AT+USOST=0,\"34.203.200.250\",5684,119\r\n"
    78.543 AT read  >    3 "\r\n@"
    78.593 AT send     119 "\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\x06\x00j\v\x00\x00^\x00\x02\x00\x00\x00\x00\x00^\x00\x00[0Y0\x13\x06\a*\x86H\xce=\x02\x01\x06\b*\x86H\xce=\x03\x01\a\x03B\x00\x04\xf6\xa1\x01X\x1c7\xe4\x89\xff\fS\x9d\xb7\xf9\xa2\xc5\xb6\xe1?\xde\xea@\x8fC\xde/\x91\xf0\x17\xd7\xc2Y\xd9\xa6{6\xea\xd5\xdb\xcd\x89F\x83\xc3\x9blX\x01\xf5+\xe6V\xec\x80^N^\x807\xf9\xe4\xa5q\xf4"
    78.739 AT read  +   17 "\r\n+USOST: 0,119\r\n"
    78.749 AT read OK    6 "\r\nOK\r\n"
0000078749 [system] TRACE: send 91
socketSendTo(0,34.203.200.250,5684,,91)
    78.749 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,91\r\n"
    78.751 AT read  +   17 "\r\n+UUSORD: 0,67\r\n"
Socket 0: handle 0 has 67 bytes pending
    78.763 AT read  >    3 "\r\n@"
    78.813 AT send      91 "\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\a\x00N\x10\x00\x00B\x00\x03\x00\x00\x00\x00\x00BA\x04\xeb\x88\xfeX\xad~f\xda\xbbK\xe2i\xf4\x13R\x96\xe1\xea\x06\xec\xf9AC=R\x8c\x11\x9e\xf3N\x8dh\x83\b\xfd\xfa\x86r;\x9b\xc5\xd4\xd0\xda\xef\x95\x82x\xcf\xe9\xc2`\x04\xaba\x10\xc5\xde\xfe\x910K)N"
    78.959 AT read  +   16 "\r\n+USOST: 0,91\r\n"
    78.969 AT read OK    6 "\r\nOK\r\n"
0000078969 [system] TRACE: send 99
socketSendTo(0,34.203.200.250,5684,,99)
    78.969 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,99\r\n"
    78.981 AT read  >    3 "\r\n@"
    79.031 AT send      99 "\x16\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\b\x00V\x0f\x00\x00J\x00\x04\x00\x00\x00\x00\x00J\x04\x03\x00F0D\x02 <iEd\xb6\xb6\x17\xe4\xfb<\xf6x\xc3z\x10Y\xf5|\xf3\xe8\xc9D^\x8d)\xc6-\xc2\x8c\xa0>Z\x02 V\x11[\xa6G\xe0\xf9_x\xb5\xa2~\x0fa'\x85Jb\xc9\xc2\x9b\xbc\xca\x88\xee\x06\xbf\x9c2\x1f\x11\x15"
    79.177 AT read  +   16 "\r\n+USOST: 0,99\r\n"
    79.187 AT read OK    6 "\r\nOK\r\n"
0000079187 [system] TRACE: send 14
socketSendTo(0,34.203.200.250,5684,,14)
    79.187 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,14\r\n"
    79.199 AT read  >    3 "\r\n@"
    79.249 AT send      14 "\x14\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\t\x00\x01\x01"
    79.389 AT read  +   16 "\r\n+USOST: 0,14\r\n"
    79.399 AT read OK    6 "\r\nOK\r\n"
0000079399 [system] TRACE: send 53
socketSendTo(0,34.203.200.250,5684,,53)
    79.401 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,53\r\n"
    79.413 AT read  >    3 "\r\n@"
    79.463 AT send      53 "..."
    79.605 AT read  +   16 "\r\n+USOST: 0,53\r\n"
    79.615 AT read OK    6 "\r\nOK\r\n"
    79.625 AT send      17 "AT+USORF=0,1024\r\n"
    79.635 AT read  +   53 "\r\n+USORF: 0,\"34.203.200.250\",5684,14,\"\x14\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\t\x00\x01\x01\""
    79.647 AT read OK    6 "\r\nOK\r\n"
0000079647 [system] TRACE: received 14
    79.649 AT read  +   17 "\r\n+UUSORF: 0,53\r\n"
Socket 0: handle 0 has 53 bytes pending
    79.661 AT send      17 "AT+USORF=0,1024\r\n"
    79.681 AT read  +   92 "\r\n+USORF: 0,\"34.203.200.250\",5684,53,\"\x16\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x00\x00(\x00\x01\x00\x00\x00\x00\x00\x00\xc2\x05k\x05\x8e\x94\x99\xde\x9bg\xa1\xcd>Y7\x93\x90h\xbaA\x13\xfeKqi\xdcFp\xa8\xca\x0fi\""
    79.697 AT read OK    6 "\r\nOK\r\n"
0000079697 [system] TRACE: received 53
0000079699 [comm.protocol.handshake] INFO: Sending HELLO message
0000079699 [comm.coap] TRACE: sending message id=1 synchronously
0000079701 [comm.coap] TRACE: sending message id=1
0000079701 [system] TRACE: send 58
socketSendTo(0,34.203.200.250,5684,,58)
    79.703 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,58\r\n"
    79.715 AT read  >    3 "\r\n@"
    79.765 AT send      58 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x02\x00-\x00\x01\x00\x00\x00\x00\x00\x02j\xadV\xd6\xff\x1c\xff\x1e\xd1\xe43h\x9b\xacZ\xe9-Zb\x0f\xb3\x8d:^\xcb\x88W\x14\x8d\xa9zk\xa3\xb9]\xb5\xff"
    79.909 AT read  +   16 "\r\n+USOST: 0,58\r\n"
    79.919 AT read OK    6 "\r\nOK\r\n"
    80.229 AT read  +   18 "\r\n+UUSORD: 0,100\r\n"
Socket 0: handle 0 has 100 bytes pending
    80.239 AT send      17 "AT+USORF=0,1024\r\n"
    80.249 AT read  +   53 "\r\n+USORF: 0,\"34.203.200.250\",5684,14,\"\x14\xfe\xfd\x00\x00\x00\x00\x00\x00\x00\n\x00\x01\x01\""
    80.261 AT read OK    6 "\r\nOK\r\n"
0000080261 [system] TRACE: received 14
mbedtls/library/ssl_tls.c:3679: bad message length
mbedtls/library/ssl_tls.c:4012: discarding invalid record (header)
    80.263 AT read  +   18 "\r\n+UUSORF: 0,124\r\n"
Socket 0: handle 0 has 124 bytes pending
    80.275 AT send      17 "AT+USORF=0,1024\r\n"
    80.295 AT read  +   92 "\r\n+USORF: 0,\"34.203.200.250\",5684,53,\"\x16\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x01\x00(\x00\x01\x00\x00\x00\x00\x00\x01\xd5\xcd\xb7\xf82\xbb\xc1s\xff\xc2\x99\x0e\\H\xf9\x8a\xbd\xca\xfa\x1c\xd9K\x99\xc8O\xd0<:Y\f>\xa1\""
    80.311 AT read OK    6 "\r\nOK\r\n"
0000080311 [system] TRACE: received 53
mbedtls/library/ssl_tls.c:7075: bad application data message
    80.313 AT read  +   17 "\r\n+UUSORF: 0,71\r\n"
Socket 0: handle 0 has 71 bytes pending
    80.325 AT send      17 "AT+USORF=0,1024\r\n"
    80.345 AT read  +   72 "\r\n+USORF: 0,\"34.203.200.250\",5684,33,\"\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x02\x00\x14\x00\x01\x00\x00\x00\x00\x00\x02\xe4K\xf4\xfb\xe3aW\xa8\xab\xa2\x81\xcb\""
    80.359 AT read OK    6 "\r\nOK\r\n"
0000080359 [system] TRACE: received 33
0000080359 [comm.coap] TRACE: recieved ACK for message id=1
0000080361 [comm.protocol.handshake] INFO: Handshake completed
0000080363 [system] INFO: Send spark/device/claim/code event
0000080363 [comm.coap] TRACE: sending message id=2
0000080365 [system] TRACE: send 124
socketSendTo(0,34.203.200.250,5684,,124)
    80.365 AT send      38 "AT+USOST=0,\"34.203.200.250\",5684,124\r\n"
    80.367 AT read  +   17 "\r\n+UUSORF: 0,38\r\n"
Socket 0: handle 0 has 38 bytes pending
    80.379 AT read  >    3 "\r\n@"
    80.429 AT send     124 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x03\x00o\x00\x01\x00\x00\x00\x00\x00\x03RP`z\xc7R\x0e>\xb4T\xb4\x9fWr\x94\xc3\x83\xfdi\xb2\x93\xd6z\x92Q!\\\v\xcdYy#\rlNl^\xdf5\xd5\x82~\x92\v\xbd\xe0t\xc3p'#5\v\xaa\x17H\x85\xf8yy\xe9d\x9e\xa7\xf5\xf6\xa4Q\xb84\xd8^e\xc9\x06poMyu\xee\xbc\xd04\xa6\x8d\x96\xc9\x8a\n\x17\xa0\xff\xea\xdf\x14\xfdI+\x12m{\xae"
    80.575 AT read  +   17 "\r\n+USOST: 0,124\r\n"
    80.585 AT read OK    6 "\r\nOK\r\n"
0000080587 [system] INFO: Send subscriptions
0000080589 [comm.coap] TRACE: sending message id=3
0000080589 [system] TRACE: send 41
socketSendTo(0,34.203.200.250,5684,,41)
    80.591 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,41\r\n"
    80.603 AT read  >    3 "\r\n@"
    80.653 AT send      41 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x04\x00\x1c\x00\x01\x00\x00\x00\x.....^\xd4\xb3\xc4\xff>4]c\x19Y\x8fZ\xc9\xf0"
    80.795 AT read  +   16 "\r\n+USOST: 0,41\r\n"
    80.805 AT read OK    6 "\r\nOK\r\n"
0000080805 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000080805 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000080807 [comm] INFO: Sending TIME request
0000080807 [comm.coap] TRACE: sending message id=4
0000080809 [system] TRACE: send 36
socketSendTo(0,34.203.200.250,5684,,36)
    80.809 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,36\r\n"
    80.821 AT read  >    3 "\r\n@"
    80.871 AT send      36 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x05\x00\x17\x00\x01\x00\x00\x00\x00\x00\x05\x96\xc2\x1e\xd7d\xcc\\z\xca\xe1J\x03G\xcc\x82"
    81.013 AT read  +   16 "\r\n+USOST: 0,36\r\n"
    81.023 AT read OK    6 "\r\nOK\r\n"
    81.033 AT send      17 "AT+USORF=0,1024\r\n"
    81.053 AT read  +   77 "\r\n+USORF: 0,\"34.203.200.250\",5684,38,\"\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x03\x00\x19\x00\x01\x00\x00\x00\x00\x00\x03\xbc4\x80\x01jBj\x0f;\xc1\xaa\rR\xa4.X\xe8\""
    81.067 AT read OK    6 "\r\nOK\r\n"
0000081067 [system] TRACE: received 38

[ Modem::getSignalStrength ] = = = = = = = = = =
    81.069 AT send       8 "AT+CSQ\r\n"
    81.081 AT read  +   14 "\r\n+CSQ: 11,2\r\n"
    81.091 AT read OK    6 "\r\nOK\r\n"
0000081091 [comm.protocol] INFO: Sending 'M' describe message
0000081091 [comm.coap] TRACE: sending message id=d079
0000081093 [system] TRACE: send 186
socketSendTo(0,34.203.200.250,5684,,186)
    81.095 AT send      38 "AT+USOST=0,\"34.203.200.250\",5684,186\r\n"
    81.107 AT read  >    3 "\r\n@"
    81.157 AT send     186 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x06\x00\xad\x00\x01\x00\x00\x00\x00\x00\x06\xe8lj<\x91\x0eW\xcf\xc2i\x1d\xd2\x801Q\xdd\xed`\x81\xcf\xda\xd8\x95\xd6gmq\xddr\x9c3\xf6\xf3\x16\xe4\x93\xa7\xa1\x8d\xd1U\xcb\xe5tD\xef\xb9\xf7\xf9\xd1\xf9H\xe1fB\x8f\xccj\xe7a\x15\x8a\x89\xb3\x9f\x1b=\xd0\x8a\x16W(%?P\xdd+?\b*\xf8\x95\x05\xb2\x8a\xbd=\x91?\x9c\v\xcd\x16\xec\x8b\xf3\x9b\xafe~\xb2\xdcU$\xb3\x1b=\xa3\xe4\x0e\xabFm\xc1\xfb\xe4\xe5\xf77\xa8\xf6\x93I\xcb\x0e\xd2!&\xb1\xe6\x91\x1d-.\xbd\xf1\xff^\xb3\x8b\x8dr\xd9\x13\x81\xcd\xdf\x8cM+WO{\xd83\xce\xdf=\fm\xbaGJ\xed8"
    81.317 AT read  +   17 "\r\n+USOST: 0,186\r\n"
    81.327 AT read OK    6 "\r\nOK\r\n"
0000081327 [comm.protocol] INFO: rcv'd message type=1
0000081327 [system] INFO: Cloud connected
    81.541 AT read  +   17 "\r\n+UUSORD: 0,38\r\n"
Socket 0: handle 0 has 38 bytes pending
    81.551 AT send      17 "AT+USORF=0,1024\r\n"
    81.571 AT read  +   77 "\r\n+USORF: 0,\"34.203.200.250\",5684,38,\"\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x04\x00\x19\x00\x01\x00\x00\x00\x00\x00\x04\x9d\xab/y\x8b\xb1)%yX\x10FP'\x88-\x1f\""
    81.583 AT read OK    6 "\r\nOK\r\n"
0000081583 [system] TRACE: received 38
0000081592 [comm.protocol] INFO: Sending 'S' describe message
0000081592 [comm.coap] TRACE: sending message id=d07a
0000081594 [system] TRACE: send 717
socketSendTo(0,34.203.200.250,5684,,717)
    81.594 AT send      38 "AT+USOST=0,\"34.203.200.250\",5684,717\r\n"
    81.605 AT read  >    3 "\r\n@"
    81.655 AT send     717 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\a\x02\xc0\x00\x01\x00\x00\x00\x00\x00\aQ\x1c\xa3TKzz\x13&Y<\xf0\xf8\xc1t\xc0g\x16\xed\xf0\x0e\xbe\xb1\x83P&@\xb2#\xec\x8fO\x1fA62\x02\xa9\x9f\xdc\x86\xa3\xc8\xb5j\x03lB$\x8e\xeaE\x0f\xb4\xefM\xff\xbb\x13WH\\\xaf\a\xbd\x01\x16\xb0U\x88|xL\xc9\xb9I\xd8j\xff\x90/S\xe3\xb2\ae\xdc4s\xce\xbb?K\x10m\xa9o\xf2\xa0\xef\x91\xb0\xd3\xa9V\xeb;\xfa\xe6\x13\xd9\xb4]\x9f-\x10\x96\xa9\x9f*\a\xcc\x8d \xa7\xb4\t/\x89\x99\t\x18\xdc\xdf\x83\x02b82u\xf3\x16\x18j\xd2|\xd5\xfe\xf5?\xe9\bl5\xab\x84\x0e\xbd\x13\xacW\xe0\x8b\x1c\x0e\x812\xfa\xc0C\x858@\xf6\x11\xa2\xc5\x92\xe4\xbdA\x87.\xd3\xf9\xc4\xbe\xd8\xd9\x11\x82Ql\xda\xd1\xaa\x9br%\xf5\xb0\xdf\xbd\xa2\xa0\xa7)\x98M\xd0\xbac\x8c\xa5\x10X*\x9d:\x9d\xb7P\x11\xf8\x91\xd8o\xc0H\xea\n#z\n\xd0\xe7\x1e\xc1\xfe\xfa\x0e\xe5\xba\xef\x97O\xf1\xa7\x98LdO\xa7\xfbs%\xf9\x88zy\xa1<A\xf0\xa8\xd5\xbf\xd2C^\xab,Gu\xf8\x1b:9zwY\xe2~\xba\x10\xd4\x15\x16W\r\x1d6\xc2\xadd\xecb\xcf3\f:\v]\xb7q^\xe29\a\xd4\xf2k\xe3\x1d\xd9w\xc2\xfa\x7f\x84||\xa9\x1e\xd3\t\xff\xe2\xfb\xa6\x1f \xac{\x97\xf9\xcc.F\xa6\x95\x1c;\x9b\xc6\x8f*\x83\xe0\x89*\xc6\x94R\xa6\xa7\xe2\xc0q\xd2!;\xd8\xaa\xaa9\x1f\xfado0\xe2\x00\x1b\n\xeb\xea\x9d4\x05\xb5\xdd7\xd1\xfc\xdc\xb3\xf0\xc6g\x16\xeah\x13\x06\xe3]B_\xa2\xcb[>1B\x90\x84\xc6\xdc@_\xb2\xc6\x8ex\xa57\x12\x9e\xcdM\x8bH\xee\x16\xcd\x0e\x7f\x1b\xbdFv{\xa3~<N\x06\xce\a=k\x1d\x876\x0f]DJD\xa7\xb8\x14]\xc2\xf8}\b\xa2\xe9$,:&7\xeb\xf3\x9e6\"\xd6\x8e\xa4o\xf8X\x1d\x98HtG\xe9\xfa\xf9\xbd\xe5\x01\xf1\xa1\xc5b\xb3\xfb\xe8\xee\v\xa3\xefl\xe4\xcf~L\x9f\xa1\v\x18f\xe0\\\x84\x03\xf3\x15\xf8WL(\t}\xe1u\xe3\x82V\xa4\x0e\x821\xc6\xee\x1d\x9b\xe7\xa7\xc6\xb7\x0fZ\xa1\x02\f\x17l\xc1g\xf5,\xa4z\x11\x04V+|d\x14#Vn\x00\x818\x1e\x97\x9ch~\xber{\xbcV#3\xb5KJ\x03\x94g\xc5#C6l\xa1\bn\xc8\x14]\xa7`\x97\xf5\xb0(\x9a\xa8EM{\x11\x98\xb0\x12\x1f\x182\xb2Q\xf5\x1d\x80\xa9\xb9\x8cae\xd1\xa1@\xafi\xe7\xa7*\x0f\xd2\x1ao\xc1\xff<1\xd1\xb1^Z\xccp\xd1\xd9u\xaf\xd7\xfdl\xfcI\xc1\xed\xaaYAb\xb5\x83\xaaa\x02zu\xf3p:.tE'\x8d\"P\xbf\x1d7\xdb\xbeS?\xca\x8f\x1b\x00`]_\xc5\x82\xe1\xdd\xaf\xf9C\x0e"
    81.880 AT read  +   17 "\r\n+USOST: 0,717\r\n"
    81.890 AT read OK    6 "\r\nOK\r\n"
0000081890 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000081898 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000081899 [comm.protocol] INFO: rcv'd message type=1
    81.899 AT read  +   18 "\r\n+UUSORD: 0,105\r\n"
Socket 0: handle 0 has 105 bytes pending
    81.910 AT send      17 "AT+USORF=0,1024\r\n"
    81.930 AT read  +   72 "\r\n+USORF: 0,\"34.203.200.250\",5684,33,\"\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x05\x00\x14\x00\x01\x00\x00\x00\x00\x00\x05\xb4\x14\x90\xbc\x9fu3\xb8\xda\xe2i\x05\""
    81.942 AT read OK    6 "\r\nOK\r\n"
0000081942 [system] TRACE: received 33
0000081942 [comm.coap] TRACE: recieved ACK for message id=2
0000081943 [comm.protocol] INFO: rcv'd message type=13
    82.000 AT read  +   17 "\r\n+UUSORF: 0,72\r\n"
Socket 0: handle 0 has 72 bytes pending
    82.010 AT send      17 "AT+USORF=0,1024\r\n"
    82.030 AT read  +   72 "\r\n+USORF: 0,\"34.203.200.250\",5684,33,\"\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\x06\x00\x14\x00\x01\x00\x00\x00\x00\x00\x06\x95`-\xef\x8d\xfbt@.\x89\x9a\xb6\""
    82.042 AT read OK    6 "\r\nOK\r\n"
0000082042 [system] TRACE: received 33
0000082042 [comm.coap] TRACE: recieved ACK for message id=3
0000082043 [comm.protocol] INFO: rcv'd message type=13
    82.101 AT read  +   17 "\r\n+UUSORF: 0,77\r\n"
Socket 0: handle 0 has 77 bytes pending
    82.112 AT send      17 "AT+USORF=0,1024\r\n"
    82.132 AT read  +   78 "\r\n+USORF: 0,\"34.203.200.250\",5684,39,\"\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\a\x00\x1a\x00\x01\x00\x00\x00\x00\x00\a\xc7\xb0[$[\xbe+8\x16\xe5\x96*\x91\x00!J\xf6\xbf\""
    82.144 AT read OK    6 "\r\nOK\r\n"
0000082144 [system] TRACE: received 39
0000082144 [comm.coap] TRACE: recieved ACK for message id=4
0000082145 [comm.protocol] INFO: Received TIME response: 1519023200
0000082145 [comm.protocol] INFO: rcv'd message type=12
    82.202 AT read  +   17 "\r\n+UUSORF: 0,38\r\n"
Socket 0: handle 0 has 38 bytes pending
    82.212 AT send      17 "AT+USORF=0,1024\r\n"
    82.232 AT read  +   77 "\r\n+USORF: 0,\"34.203.200.250\",5684,38,\"\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\b\x00\x19\x00\x01\x00\x00\x00\x00\x00\b\xbf\xb1.\x0f\xf6\x18\xea\xef|\x118\xfb\xe2\xe6^Sy\""
    82.244 AT read OK    6 "\r\nOK\r\n"
0000082244 [system] TRACE: received 38
0000082244 [comm.protocol] INFO: Sending 'A' describe message
0000082245 [comm.coap] TRACE: sending message id=d07b
0000082245 [system] TRACE: send 50
socketSendTo(0,34.203.200.250,5684,,50)
    82.246 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,50\r\n"
    82.257 AT read  >    3 "\r\n@"
    82.307 AT send      50 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\b\x00%\x00\x01\x00\x00\x00\x00\x00\b}\xfegx\xeb\aw\xdc\x83\xf4\xedE\xfd\x17\x83\xb0\xe10\x88\xff\xe38F\x86V\xab,\xa4S"
    82.448 AT read  +   16 "\r\n+USOST: 0,50\r\n"
    82.458 AT read OK    6 "\r\nOK\r\n"
0000082458 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0000082458 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0000082459 [comm.protocol] INFO: rcv'd message type=1
0000100099 [comm.coap] TRACE: sending message id=5
0000100099 [system] TRACE: send 50
socketSendTo(0,34.203.200.250,5684,,50)
   100.100 AT send      37 "AT+USOST=0,\"34.203.200.250\",5684,50\r\n"
mbedtls/library/ssl_tls.c:2971: mbedtls_ssl_flush_output() returned -1 (-0x0001)
mbedtls/library/ssl_tls.c:7165: mbedtls_ssl_write_record() returned -1 (-0x0001)
0000110112 [comm.protocol] ERROR: Event loop error 3
0000110112 [system] WARN: Communication loop error, closing cloud socket
0000110113 [system] INFO: Cloud: disconnecting
0000110113 [system] INFO: Cloud: disconnected
0000110213 [system] INFO: Cloud: connecting
0000110213 [system] TRACE: sparkSocket Now =0
0000110213 [system] TRACE: Close Attempt
socketClose(0)
   110.213 AT send      12 "AT+USOCL=0\r\n"
socketFree(0)
0000120225 [system] TRACE: socket_close()=success
0000120229 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
   120.231 AT send      56 "AT+UDNSRN=0,\"49004c000c51343334363138.udp.particle.io\"\r\n"
   150.235 AT send      56 "AT+UDNSRN=0,\"49004c000c51343334363138.udp.particle.io\"\r\n"
   180.242 AT send      56 "AT+UDNSRN=0,\"49004c000c51343334363138.udp.particle.io\"\r\n"
0000210255 [system] ERROR: Cloud: unable to resolve IP for 49004c000c51343334363138.udp.particle.io
0000210255 [system] WARN: Cloud socket connection failed: -1
0000210255 [system] TRACE: Internet test socket
socketSocket(TCP)

(Some of the battery state messages removed)

Are you sure that the NO_ACK flag is working?
I tried the 'test code' with the 'NO_ACK' flag set and it still disconnects immediately after the particle.publish....

NO_ACK should work fine. If you get the same thing happening that indicates to me the outbound and inbound connections are both closed.

I’m going to modify the above app to give us a little more detail on what’s happening, and to delay the point where we start communicating to 30 seconds after connecting. I’d like to see the system try to ping first as well. Lets make this 10 seconds just because we can.

When you capture and post the logs you can start it now at the point where it says INFO: Sending 'S' describe message to keep it shorter.

3 Likes

I modified the code a little for testing:
removed the particle.connect and only used cellular.connect() to establish IP connectivity.
Electron is breathing green.
Now I send UDP packets to my own server on the 'net:

if (millis() - start_time > 20000UL) {
    start_time = millis();
    Udp.begin(5684);
    Udp.sendPacket(buffer, sizeof(buffer), remoteIP, port);
    Udp.stop();
    if (Particle.connected()) {
        Particle.publish("up-time", String(millis()), PRIVATE, NO_ACK);
    }
}

This is working fine.
So sending outbound UDP is no problem. I have not tried sending replies though.
But still, if I send the particle.publish with 'NO_ACK', shouldn't that be the same as sending UDP packets?

The cloud connection is over UDP, so yes this is the same thing. What might be happening is the keepAlive pings are ACK’d so maybe they are coinciding with the publish. I would still like to see the log output from the modified code if you could run that, I think it will be helpful.

Thanks. I will try to test your code.
Currently the modem does not want to connect at all.
I'll try some more tomorrow...
Here's the log:

4294951.740 AT send 10 "AT+CREG?\r\n"
4294951.740 AT read + 14 "\r\n+UMWI: 0,1\r\n"
4294951.752 AT read + 14 "\r\n+UMWI: 0,2\r\n"
4294951.762 AT read + 14 "\r\n+UMWI: 0,3\r\n"
4294951.772 AT read + 14 "\r\n+UMWI: 0,4\r\n"
4294951.782 AT read + 14 "\r\n+UMWI: 0,5\r\n"
4294961.742 AT send 11 "AT+CGREG?\r\n"
0000040729 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000040754 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000040817 [sys.power] TRACE: Battery state CHARGED -> CHARGING
0000040838 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000042057 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
19.456 AT send 10 "AT+CREG?\r\n"
29.466 AT send 11 "AT+CGREG?\r\n"
0000083412 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000083437 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000084706 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
54.477 AT send 10 "AT+CREG?\r\n"
64.487 AT send 11 "AT+CGREG?\r\n"
89.497 AT send 10 "AT+CREG?\r\n"
0000126091 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000126117 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000127403 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
99.499 AT send 11 "AT+CGREG?\r\n"
124.509 AT send 10 "AT+CREG?\r\n"
134.519 AT send 11 "AT+CGREG?\r\n"
0000168769 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000168795 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000170081 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
159.528 AT send 10 "AT+CREG?\r\n"
169.538 AT send 11 "AT+CGREG?\r\n"
0000211450 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000211476 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000212745 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
194.546 AT send 10 "AT+CREG?\r\n"
204.556 AT send 11 "AT+CGREG?\r\n"
0000254130 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000254156 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000254314 [sys.power] TRACE: Battery state CHARGED -> CHARGING
0000254323 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000255441 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
229.566 AT send 10 "AT+CREG?\r\n"
239.576 AT send 11 "AT+CGREG?\r\n"
0000296811 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000296837 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000296978 [sys.power] TRACE: Battery state CHARGED -> CHARGING
0000297003 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000298122 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
264.587 AT send 10 "AT+CREG?\r\n"
274.597 AT send 11 "AT+CGREG?\r\n"
0000318772 [system] WARN: Resetting WLAN due to WLAN_WD_TO()

[ Modem::powerOff ] = = = = = = = = = = = = = =
284.707 AT send 12 "AT+CPWROFF\r\n"
0000339491 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000339517 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000340653 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED

[ Modem::powerOff ] timeout, retrying...
324.718 AT send 12 "AT+CPWROFF\r\n"
0000382171 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000382196 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000382338 [sys.power] TRACE: Battery state CHARGED -> CHARGING
0000382363 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000383482 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED

[ Modem::powerOff ] timeout, retrying...
364.728 AT send 12 "AT+CPWROFF\r\n"
0000424854 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
0000424880 [sys.power] TRACE: Battery state CHARGING -> CHARGED
0000426116 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED

[ Modem::powerOff ] timeout, retrying...

Do you have a battery plugged in? How are you powering things?

1 Like

The Device is usually powered by an 12V/2A Power Supply. We have designed a circuit board for the application (with I/O connectivity, 12/24 Power input, etc.).

Here’s the log:

> 0000033774 [comm.protocol] INFO: Sending 'S' describe message
> 0000033774 [comm.coap] TRACE: sending message id=4709
> 0000033778 [system] TRACE: send 717
> socketSendTo(0,54.158.29.30,5684,,717)
>     33.775 AT send      36 "AT+USOST=0,\"54.158.29.30\",5684,717\r\n"
>     33.787 AT read  >    3 "\r\n@"
>     33.837 AT send     717 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\b\x02\xc0\x00\x01\x00\x00\x00\x00\x00\b\xc5b\x86\x85\x0f\xf9\xc0\x90\x8708\xe1\xba\xda\xc1\xdb\xea'IP\x13bP\xe0*\x9fHl\xed\x00u\xbc\x82\x86u\xe4\xa3k\xfc\xdf\xc2\x03\xddj\xca\xf6\xbf\x86A\xc1\xe9\x1b{\x0e*t\x89\xd0e\xd5qY7\xee\x1fh\xef\xea\xc6\xb1&\xbf\xd2\x816{=}!t-\x1a]:\xb0\x8f\x9d\xb4fr\x9e\xb6-\xd0\xf2\"\xa1T\x92\x98\xdbFj\xd6\xe0\xda\x1c7\xdd\xe0\xf6\xfc\xffnre\fT\x9f\x99z4\xa6\xbe\x9d\xb3>,\x119\xa5)\x16J\xd2M^>\\y6\xfcr\xbdE\xaa\xb6#\xfa\xb7\xaa<z,\x8f\xdd\x18U{}\xe9x\xaa\x14R\x9f\xb4\xb2i\xb3R^i\xb0U\x13\x87\xe2\xd3@2m\x1c\xb5\xc9\x0ej\xa3,c\\\x13Z\xcdf\xf6\xf5\x90\x00\xc6HxZ\xe5\xa9\xc2\xab_\x04\x8c\x03\\\xdb\xa2\x0f_0\xdf\xd3\xb7I~\xd3\xbb\xc9\x92\x11\xaaH\xdd\x14\xd0g\x91/\x18`4|\x15|\x05!\xba@#\xa2}\xe2\xa7\xaf\x97\x85aF\x16\xbaz\x05J*\xb3%\x85\xa7\xd4\x7f,\x97\xce6\x86\x91\xccj\x05C\x9e\xddP^_\x01/\xa4+\xde\xad\a2\xb0\x95\xee=k\xa1\x1f\xf3s\xaf\x82E\x87\xc0\xfb\x12\x1c\xe5\x10P\x82\x89^d\x06I\xf9;\xd8g\xa0\xee\xa5\x8d$t\x8f\xcaR&\xf5\x7f[\x83\xf3i|\xa6\x1e \xd1O\x87\x1cW\xe4\xfd\x17:9\xf7\a\xfe\xc5\xb2\r}\xa0%lg\b\xb7\x90\x87\xcf 8N\xa2\x9cr\xcb\xa9\xdf#;\xdar\r2\x01\xc4M8\x9a\xb1\xdf\x10c\x84:\xa1+80{\xf5\xc6\x980\xc6M\x0e\xfb\xa0\xc1\x9aM\x81\xfef\x91lVS_\x06\x9c8\xfcnP8\x90\xc0\xb6$\xe8X87\xf9D\xebOFAEh\xdb\xe2?\xd3\vb\xcd\x1e2\xf0\x17_\x01\xba$\x95\xf9\xb4\x0f@\xcfv-\x86\x92W\xd4\xf2\x8f\xe8\xce=\x17\xff\xcb\xdde[HVY\x10h\xc2\x9b#\xe9\xed\xb0\xc0\xee>\xd7\xec\xd9\x0f\xa9\xb8\x893\xb7\x1a\x01\xc60n?<b\xa2Z\xb7\xff<\xb7+\xb1\x9e\xe6\xb3\x13\n\xab\x82\x87\x9a\n\xe9\xb9\x04\xdeF|\xf8\xb6/z[6\x1d\xd2\xb5\xb3VKpx\b\x01\x86\xc9\xc8\xfb\xb6\x89x\xedo\xf8*n\xa7\x9e\xfek\xbe\xc7\xccb\xdb\"\xcb\xf1\x9e)W\xe0\t\x05X\xd8rl\xf8\xe8_\x93\xfd\x9a\xaeD\xfa\x8e\xca\x12\x89\xfeos\x99+\x19\a\x83r\xfe\b\xee>\xd2lY\x90\xeb\x04\xe8\xc8a=\xaf\xd6\xf9\xd3\x89@\xa5\xb14\xa3\b\x97*\xe9\xf0\x98\x89\x84\xc0\xf0\xecl\x00\xe0\x1dO\xdb7\x89WPP\x97\xb1-9\xc0I\x0f\xb2;\xcd\xed\x83\xc1F\xd7\xc6\x8c5B`\x0e\xc7\x01\x12\xd2\x16\xa3\xe3*\xbc\xebk\x16Y\xfa\x9aq\xd0f\xe1)\xbcp\xdc\x97"
>     34.081 AT read  +   17 "\r\n+USOST: 0,717\r\n"
>     34.091 AT read OK    6 "\r\nOK\r\n"
> 0000034094 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
> 0000034110 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
> 0000034112 [comm.protocol] INFO: rcv'd message type=1
>     34.209 AT read  +   17 "\r\n+UUSORD: 0,38\r\n"
> Socket 0: handle 0 has 38 bytes pending
>     34.219 AT send      17 "AT+USORF=0,1024\r\n"
>     34.239 AT read  +   75 "\r\n+USORF: 0,\"54.158.29.30\",5684,38,\"\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\t\x00\x19\x00\x01\x00\x00\x00\x00\x00\tC\x85\xb9\xb7\x7f\xc6\x06\x87\xfd\x8f\xce\xea\xa5\x1d=@^\""
>     34.253 AT read OK    6 "\r\nOK\r\n"
> 0000034256 [system] TRACE: received 38
> 0000034256 [comm.protocol] INFO: Sending 'A' describe message
> 0000034258 [comm.coap] TRACE: sending message id=470a
> 0000034258 [system] TRACE: send 50
> socketSendTo(0,54.158.29.30,5684,,50)
>     34.257 AT send      35 "AT+USOST=0,\"54.158.29.30\",5684,50\r\n"
>     34.269 AT read  >    3 "\r\n@"
>     34.319 AT send      50 "\x17\xfe\xfd\x00\x01\x00\x00\x00\x00\x00\t\x00%\x00\x01\x00\x00\x00\x00\x00\t\x9a&\xc3\xc0f\xf5Ws7-\xdc\xd2\b>\xe8\x86u\x15?n\x8e\x99X\xb3\x04\xb9\xcf\x13\x96"
>     34.461 AT read  +   16 "\r\n+USOST: 0,50\r\n"
>     34.471 AT read OK    6 "\r\nOK\r\n"
> 0000034474 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
> 0000034474 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
> 0000034476 [comm.protocol] INFO: rcv'd message type=1
> 0000042106 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
> 0000042132 [sys.power] TRACE: Battery state CHARGING -> CHARGED
> 0000043418 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
> 0000044266 [comm.coap] TRACE: sending message id=6
> 0000044266 [system] TRACE: send 33
> socketSendTo(0,54.158.29.30,5684,,33)
>     44.263 AT send      35 "AT+USOST=0,\"54.158.29.30\",5684,33\r\n"
> 0000053267 [app] INFO: DONE SETTLING BY NOW I HOPE...
> 0000053267 [app] INFO: SETTING THE KEEP ALIVE
> mbedtls/library/ssl_tls.c:2971: mbedtls_ssl_flush_output() returned -1 (-0x0001)
> mbedtls/library/ssl_tls.c:7165: mbedtls_ssl_write_record() returned -1 (-0x0001)
> 0000054271 [comm.protocol] ERROR: Event loop error 20
> 0000054271 [system] WARN: Communication loop error, closing cloud socket
> 0000054272 [system] INFO: Cloud: disconnecting
> 0000054272 [system] INFO: Cloud: disconnected
> 0000054273 [system] INFO: Cloud: connecting
> 0000054273 [system] TRACE: sparkSocket Now =0
> 0000054273 [system] TRACE: Close Attempt
> socketClose(0)
> 0000054274 [app] INFO: DONE SETTLING BY NOW I HOPE...
>     54.270 AT send      12 "AT+USOCL=0\r\n"
> socketFree(0)
> 0000064285 [system] TRACE: socket_close()=success
> 0000064287 [system] INFO: Read Server Address = type:1,domain:$id.udp.particle.io
>     64.286 AT send      56 "AT+UDNSRN=0,\"49004c000c51343334363138.udp.particle.io\"\r\n"
> 0000084794 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
> 0000084820 [sys.power] TRACE: Battery state CHARGING -> CHARGED
> 0000086089 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED
>     94.292 AT send      56 "AT+UDNSRN=0,\"49004c000c51343334363138.udp.particle.io\"\r\n"
>    124.305 AT send      56 "AT+UDNSRN=0,\"49004c000c51343334363138.udp.particle.io\"\r\n"
> 0000127482 [sys.power] TRACE: Battery state DISCONNECTED -> CHARGING
> 0000127508 [sys.power] TRACE: Battery state CHARGING -> CHARGED
> 0000127650 [sys.power] TRACE: Battery state CHARGED -> CHARGING
> 0000127675 [sys.power] TRACE: Battery state CHARGING -> CHARGED
> 0000128794 [sys.power] TRACE: Battery state CHARGED -> DISCONNECTED

Voltage and amperage rating of your PSU is not the whole story. With the Electron the responsiveness of the supply also has to be considered (and while at it, DC ripple & noise should also be kept under control).
So to check wheter or not that might contribute to the issue, just connect a charged LiPo and see whether the problem persists or goes away.

1 Like

I will try with the Lipo, but I have also tried

  • 12V car battery
  • 13.8V Lipo
  • 5V USB from PC
  • 5V USB Power Supply
    All with the same result.
    The connection to the cloud is always lost at the exact moment, when particle.publish is called.
    The initial cloud connection is working fine, so does sending UDP data.

Thanks for running the test!

I'm seeing some DTLS errors in your logs. It's probably caused by noise in the communications, which could easily be caused by an inadequate power supply. If your 12VDC does not have sufficient bulk capacitance at VIN, the system will brown out when it goes to communicate. unencrypted UDP will go through with noise ok because nobody cares, as long as the destination IP:PORT are not affected ... but encrypted messages can get destroyed with just a bit of noise.

You should also disable the battery charger if you have the battery unplugged:
PMIC().disableCharging();

Before that though, as ScruffR suggests it would be a good idea to just try adding the battery back and see if your problems go away.

I've also caught an error in my code above and added a !once to the first if :wink:

2 Likes

... and I changed this line to: if (!once) { start_time = millis(); }

But, guess what:
I added the PMIC to the setup

    void setup() {
        PMIC().disableCharging();
        Particle.connect();    
    }

and now it's working. No more particle disconnects!
Reproducibly. Removing the 'disableCharging' will disconnect after the first publish. With the disableCharging added, its working fine.
Tried it with my production code: Same result.
Woohoo!

I will do some long term tests now and will keep you updated.

3 Likes

That’s wonderful news!

To collect a bit more info, I’m guessing you are running 0.8.0-rc.2 based on your logs, is that correct? Do you see this same behavior with 0.7.0-rc.7 or 0.6.4? It would be good to know if we inadvertently changed something in 0.8.0-rc.x, but it could also just be something related to the sensitivity of your power input.