Page 1 of 1

"Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited)" error

Posted: Fri Jun 22, 2018 4:03 am
by zam_ii
Hi,

I tried to connect to IoT platform from ESP32 through MQTT.
My code as below. There is no problem when I use Adafruit MQTT broker.
But I got a "Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited)" error when tried to send MQTT to this IoT platform.

Is it due to the key is too long? Is there any solution?

Code: Select all

#include "WiFi.h"
#include "PubSubClient.h"

const char* ssid = "*****";
const char* password = "*****";
const char* mqtt_server = "mqtt.favoriot.com";
const char* username = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImlsemFtYWxwcyIsInJlYWRfd3JpdGUiOnRydWUsImlhdCI6MTUyODQ0ODQwN30.7ChIJzlW0Ja7QGR_sO6T04yh3pCY9tEqPbf********";
const char* passkey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImlsemFtYWxwcyIsInJlYWRfd3JpdGUiOnRydWUsImlhdCI6MTUyODQ0ODQwN30.7ChIJzlW0Ja7QGR_sO6T04yh3pCY9tEqPbf********";
const char* topic = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImlsemFtYWxwcyIsInJlYWRfd3JpdGUiOnRydWUsImlhdCI6MTUyODQ0ODQwN30.7ChIJzlW0Ja7QGR_sO6T04yh3pCY9tEqPbf********/all";

WiFiClient espClient;
PubSubClient client(espClient);

void mqttconnect() {
  while (!client.connected()) {
    Serial.print("MQTT connecting ...");
    String clientId = "ESP32";
    if (client.connect(clientId.c_str(),username,passkey)) {
      Serial.println("connected");
    } else {
      Serial.print("failed, status code =");
      Serial.print(client.state());
      Serial.println("try again in 5 seconds");
      delay(5000);
    }
  }
}

void setup() {
  Serial.begin(115200);
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  client.setServer(mqtt_server, 1883);
}

void loop() {
  if (!client.connected()) {
    mqttconnect();
  }

   String json = "{\"device_developer_id\":\"deviceDefault@ilzamalps\",\"data\":{\"humidity\":\"80\",\"temperature\":\"30\"}}";
   client.publish(topic,json.c_str());

   delay(30000);
}

Code: Select all

Connecting to zamii@unifi
..
WiFi connected
IP address: 
192.168.0.148
MQTT connecting ...Guru Meditation Error: Core  1 panic'ed (InstrFetchProhibited)
. Exception was unhandled.
Register dump:
PC      : 0x00000000  PS      : 0x00060030  A0      : 0x800d21a8  A1      : 0x3ffd0ca0  
A2      : 0x3ffc3224  A3      : 0x3ffd0cac  A4      : 0x00000000  A5      : 0x00000155  
A6      : 0x00000003  A7      : 0x00000000  A8      : 0x800d2090  A9      : 0x00000002  
A10     : 0x3ffc32d4  A11     : 0x3ffc322a  A12     : 0x00000158  A13     : 0xfb792634  
A14     : 0xfb792634  A15     : 0x3ffc3b14  SAR     : 0x00000018  EXCCAUSE: 0x00000014  
EXCVADDR: 0x00000000  LBEG    : 0x400d210d  LEND    : 0x400d211c  LCOUNT  : 0x00000000  

Backtrace: 0x00000000:0x3ffd0ca0 0x400d21a5:0x3ffd0cd0 0x400d2266:0x3ffd0d10 0x400d13c8:0x3ffd0d40 0x400d14b3:0x3ffd0d70 0x4010cf50:0x3ffd0da0

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078ad0

Re: "Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited)" error

Posted: Sat Jun 23, 2018 5:44 am
by ajithcs
I tried your code and I test it to "test.mosquitto.org" without username and passkey

const char* mqtt_server = "test.mosquitto.org";
const char* topic = "temp/random";
if (client.connect(clientId.c_str())) {

and i got successfully connected.
Connecting to CONNECTSA
...........
WiFi connected
IP address:
192.168.0.103
MQTT connecting ...connected

Re: "Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited)" error

Posted: Sun Jun 24, 2018 2:07 am
by ESP_Sprite
Are you sure your power supply is adequate?

Re: "Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited)" error

Posted: Sun Jun 24, 2018 9:56 pm
by zam_ii
ESP_Sprite wrote:Are you sure your power supply is adequate?
Same as me, tried using others mqtt broker, no problem.

As mentioned using other mqtt broker, connect this board to laptop using usb cable, no problem.

Re: "Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited)" error

Posted: Mon Jun 25, 2018 10:25 am
by ajithcs
Post by ESP_Sprite ยป Sun Jun 24, 2018 7:37 am
Are you sure your power supply is adequate?

hi, thanks for the reply.
But no power supply issues.

Re: "Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited)" error

Posted: Mon Jun 25, 2018 3:12 pm
by zam_ii
Please help, any idea?