ESP8266 failing with pm open,type:2 0



  • The GW has been working just fine for that last few days, but when I rebooted it today, I now get the "pm open,type:2 0" from the ESP8266. When this happen, the GW stops working... Re building and loading of new code has same problem.
    I have tried 3 different ESP8266

    Any ideas on what is the root cause??

    Thanks

    GatewayESP8266MQTTClient with RFM95 radio
    Using beta 2.1. as of 1Dec2016
    IDE 1.6.13
    esp8266/hardware/esp8266/2.3.0

    
    0;255;3;0;9;MCO:BGN:INIT GW,CP=RLNGE--,VER=2.1.0-beta
    0;255;3;0;9;TSF:LRT:OK
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    0;255;3;0;9;!TSM:INIT:TSP FAIL
    0;255;3;0;9;TSM:FAIL:CNT=1
    0;255;3;0;9;TSM:FAIL:PDT
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 2
    cnt 
    
    connected with lafleur, channel 1
    dhcp client start...
    ip:192.94.167.240,mask:255.255.255.0,gw:192.94.167.4
    0;255;3;0;9;TSM:FAIL:RE-INIT
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;!TSM:INIT:TSP FAIL
    0;255;3;0;9;TSM:FAIL:CNT=2
    0;255;3;0;9;TSM:FAIL:PDT
    pm open,type:2 0       <-----------------------------
    0;255;3;0;9;TSM:FAIL:RE-INIT
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;!TSM:INIT:TSP FAIL
    0;255;3;0;9;TSM:FAIL:CNT=3
    0;255;3;0;9;TSM:FAIL:PDT
    0;255;3;0;9;TSM:FAIL:RE-INIT
    0;255;3;0;9;TSM:INIT
    
    
    /*
     * TRL Ver 1 01 Dec 2016
     * MySensor 2.1b as of 23 Nov 2016
     */
      
    #include <ESP8266WiFi.h>
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    //#define MY_SPECIAL_DEBUG
    #define MY_DEBUG_VERBOSE_RFM95
    
    
    #if defined(ARDUINO_ARCH_ESP8266)
    #else
    #error This program requires an ESP8266 CPU
    #endif
    
    //#define MY_DEFAULT_RX_LED_PIN   16
    #define MY_DEFAULT_TX_LED_PIN     16
    //#define MY_DEFAULT_ERR_LED_PIN  26
    
    // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
    #define MY_BAUD_RATE 115200
    
    // Enables and select radio type (if attached)
    #define MY_RADIO_RFM95
    
    // Pin's defined below are for ESP8266
    #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF128
    //#define MY_RFM95_RST_PIN RFM95_RST_PIN
    #define MY_RFM95_IRQ_PIN                15
    #define MY_RFM95_SPI_CS                 2
    #define MY_RFM95_TX_POWER               23  // max is 23
    //#define MY_RFM95_ATC_MODE_DISABLED
    #define MY_RFM95_ATC_TARGET_RSSI        (-60)
    #define MY_RFM95_FREQUENCY              (915.0f)
    
    #define MY_GATEWAY_MQTT_CLIENT
    #define MY_GATEWAY_ESP8266
    
    // Set this node's subscribe and publish topic prefix
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX   "MG1-out"
    #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "MG1-in"
    
    // Set MQTT client id
    #define MY_MQTT_CLIENT_ID "mysensors-2"
    
    // Enable these if your MQTT broker requires usenrame/password
    //#define MY_MQTT_USER "username"
    //#define MY_MQTT_PASSWORD "password"
    
    // Set WIFI SSID and password
    #define MY_ESP8266_SSID "test"
    #define MY_ESP8266_PASSWORD ""
    
    // Set the hostname for the WiFi Client. This is the hostname
    // it will pass to the DHCP server if not static.
    // #define MY_ESP8266_HOSTNAME "mqtt-sensor-gateway"
    
    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    #define MY_IP_ADDRESS 192, 94, 167, 42
    
    // If using static ip you need to define Gateway and Subnet address as well
    #define MY_IP_GATEWAY_ADDRESS 192, 94, 167, 4
    #define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    // MQTT broker ip address.
    #define MY_CONTROLLER_IP_ADDRESS 192, 94, 167, 32
    
    // The MQTT broker port to to open
    #define MY_PORT 1883
    
    #define MY_PARENT_NODE_ID   0
    
     /*
    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    #define MY_INCLUSION_BUTTON_FEATURE
    // Set inclusion mode duration (in seconds)
    #define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    #define MY_INCLUSION_MODE_BUTTON_PIN  3
    
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Flash leds on rx/tx/err
    #define MY_DEFAULT_ERR_LED_PIN 16  // Error led pin
    #define MY_DEFAULT_RX_LED_PIN  16  // Receive led pin
    #define MY_DEFAULT_TX_LED_PIN  16  // the PCB, on board LED
    */
    
    
    /* ************************************************************************************** */
    // All #define above need to be prior to #include <MySensors.h> below
    #include <MySensors.h>
    
    
     // this is part of MySensor core 
    void before() 
    { 
      Serial.println ("In before");
      //WiFi.mode(WIFI_AP);    // : set mode to WIFI_AP, WIFI_STA, or WIFI_AP_STA or WIFI_OFF
      //wifi_set_opmode_current(STATIONAP_MODE);
      //wifi_set_opmode_current(STATION_MODE);
     }
    
    void setup() 
    {
      Serial.println("In Setup");
      }
    
    void presentation() 
    {
      // Present locally attached sensors here
    }
    
    
    void loop() 
    {
      // Send locally attach sensors data here
    }
    
    


  • @lafleur I am having almost an identical problem. Did you ever find a solution for this?



  • @lafleur I also see "pm open,type:2 0". Did you happen to install the ping pong sketch?

    probably not related but I'm using an RFM69 with the ESP8266.

    ..ip:192.168.0.219,mask:255.255.255.0,gw:192.168.0.1
    .IP: 192.168.0.219
    0;255;3;0;9;No registration required
    0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
    IP: 192.168.0.219
    0;255;3;0;9;Attempting MQTT connection...
    0;255;3;0;9;MQTT connected
    pm open,type:2 0
    


  • I am also experiencing this using Sonoff relay sketch for ESP8266, any news on how to fix it?


  • Mod

    I had a similar problem with MySensors >= 2.1.0. Switching to 2.0.0 made it go away. Maybe worth trying, at least to verify if 2.1 has a problem.

    The gateway rebooted every time a node sent a message.

    0;255;3;0;9;332 MCO:BGN:INIT GW,CP=RNNGE---,VER=2.2.0-beta
    0;255;3;0;9;338 TSF:LRT:OK
    0;255;3;0;9;341 TSM:INIT
    0;255;3;0;9;343 TSF:WUR:MS=0
    0;255;3;0;9;351 TSM:INIT:TSP OK
    0;255;3;0;9;354 TSM:INIT:GW MODE
    0;255;3;0;9;357 TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;361 MCO:REG:NOT NEEDED
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.2.0-beta
    0;255;3;0;9;364 MCO:BGN:STP
    force slp enable,type: 2
    fpm open,type:2 0
    s2
    0;255;3;0;9;4902 MCO:BGN:INIT OK,TSP=1
    0;255;3;0;9;38508 TSF:MSG:READ,1-1-0,s=5,c=1,t=16,pt=1,l=1,sg=0:1
    1;5;1;0;16;1
    Fatal exception 3(LoadStoreErrorCause):
    epc1=0x4021dca2, epc2=0x00000000, epc3=0x00000000, excvaddr=0x40234734, depc=0x00000000
    
    Exception (3):
    epc1=0x4021dca2 epc2=0x00000000 epc3=0x00000000 excvaddr=0x40234734 depc=0x00000000
    
    ctx: cont 
    sp: 3ffefc00 end: 3ffeff70 offset: 01a0
    

  • Mod

    @mfalkvidd MySensors has a dependency for ESP8266 on the ESP Arduino version, as it duplicates the startup code.
    I'd suggest to try with MySensors 2.1.x and ESP8266 2.3.0 board support and fix any issues we run into.



  • I have tried to use 2.0 but still get the same response: pm open,type:2 0 in serial monitor. strangely I get no other serial responses, just that. Do I have to set debug on in the board settings?
    I can ping the sonoff so I know it's connected. What am I missing?



  • See this remark:

    @tekka said in MySensors 2.0.0 Released:

    @mpp said in MySensors 2.0.0 Released:

    pm open,type:2 0

    This is a message emitted by the ESP8266 core, not MySensors related.

    I suggest you add the following to enable debugging on the serial interface:

    #define MY_DEBUG
    

    Also tripple check your wiring, it seems to make the ESP very unstable if there's a loose/bad connection. TSM:FAIL:CNT could indicate a problem with the radio/transmission.


Log in to reply
 

Suggested Topics

10
Online

11.4k
Users

11.1k
Topics

112.7k
Posts