Geierhoppjo
Geierhoppjo

Reputation: 1

Guru Meditation Error: Core 1 panic'ed (LoadProhibited). ESP32 using local Raspberry PI InfluxDB Database

I encounter this error whenever I try to connect to the InfluxDB Server Version 2.x that is locally hosted in my network. I've been looking for a solution but can't find any. I use an ESP32 without any pins attached. I'm also using the default generated example to connect and esp32 by the influxdb tutorial itself (see code below).

(pi:8086 is the locally defined address)

#if defined(ESP32)
  #include <WiFiMulti.h>
  WiFiMulti wifiMulti;
  #define DEVICE "ESP32"
  #elif defined(ESP8266)
  #include <ESP8266WiFiMulti.h>
  ESP8266WiFiMulti wifiMulti;
  #define DEVICE "ESP8266"
  #endif
  
  #include <InfluxDbClient.h>
  #include <InfluxDbCloud.h>
  
  // WiFi AP SSID
  #define WIFI_SSID "SSID"
  // WiFi password
  #define WIFI_PASSWORD "Password"
  
  #define INFLUXDB_URL "http://pi:8086"
  #define INFLUXDB_TOKEN "token"
  #define INFLUXDB_ORG "org"
  #define INFLUXDB_BUCKET "esp_test_bucket"
  
  // Time zone info
  #define TZ_INFO "UTC1"
  
  // Declare InfluxDB client instance with preconfigured InfluxCloud certificate
  InfluxDBClient client(INFLUXDB_URL, INFLUXDB_ORG, INFLUXDB_BUCKET, INFLUXDB_TOKEN);
  
  // Declare Data point
  Point sensor("wifi_status");
  
  void setup() {
    Serial.begin(115200);
  
    // Setup wifi
    WiFi.mode(WIFI_STA);
    wifiMulti.addAP(WIFI_SSID, WIFI_PASSWORD);
  
    Serial.print("Connecting to wifi");
    while (wifiMulti.run() != WL_CONNECTED) {
      Serial.print(".");
      delay(100);
    }
    Serial.println();
  
    // Accurate time is necessary for certificate validation and writing in batches
    // We use the NTP servers in your area as provided by: https://www.pool.ntp.org/zone/
    // Syncing progress and the time will be printed to Serial.
    timeSync(TZ_INFO, "pool.ntp.org", "time.nis.gov");
  
  
    // Check server connection
    if (client.validateConnection()) {
      Serial.print("Connected to InfluxDB: ");
      Serial.println(client.getServerUrl());
    } else {
      Serial.print("InfluxDB connection failed: ");
      Serial.println(client.getLastErrorMessage());
    }
  }
  void loop() {}

I get the following Error before the esp32 reboots itself and all happens again:

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
14:44:38.943 -> 
14:44:38.943 -> Core  1 register dump:
14:44:38.943 -> PC      : 0x4008ac05  PS      : 0x00060430  A0      : 0x800dc105  A1      : 0x3ffb2120  
14:44:38.990 -> A2      : 0x00000000  A3      : 0xfffffffc  A4      : 0x000000ff  A5      : 0x0000ff00  
14:44:38.990 -> A6      : 0x00ff0000  A7      : 0xff000000  A8      : 0x00000000  A9      : 0x3ffb20c0  
14:44:38.990 -> A10     : 0x3ffb212c  A11     : 0x3f4124aa  A12     : 0x00000000  A13     : 0x00000000  
14:44:38.990 -> A14     : 0x00000011  A15     : 0x3ffd0674  SAR     : 0x00000020  EXCCAUSE: 0x0000001c  
14:44:38.990 -> EXCVADDR: 0x00000000  LBEG    : 0x4008ac05  LEND    : 0x4008ac15  LCOUNT  : 0xffffffff  
14:44:38.990 -> 
14:44:38.990 -> 
14:44:38.990 -> Backtrace: 0x4008ac02:0x3ffb2120 0x400dc102:0x3ffb2130 0x400d66aa:0x3ffb2150 0x400d67cb:0x3ffb2190 0x400d710e:0x3ffb21d0 0x400d2882:0x3ffb2220 0x400dcb6f:0x3ffb2270 0x4008ea2a:0x3ffb2290

Decoding it with the Exception Deocder give:

Decoding stack results
0x4008ac02: strlen at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp-elf/src/newlib/newlib/libc/machine/xtensa/strlen.S line 82
0x400dc0ee: String::concat(char) at C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.2\cores\esp32\WString.cpp line 351
0x400d66ae: HTTPService::afterRequest(int, std::function , bool) at C:\Users\user\Documents\Arduino\libraries\ESP8266_Influxdb\src\HTTPService.cpp line 194
0x400d67cf: HTTPService::doGET(char const*, int, std::function ) at C:\Users\user\Documents\Arduino\libraries\ESP8266_Influxdb\src\HTTPService.cpp line 171
0x400d70fa: InfluxDBClient::validateConnection() at C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.2\cores\esp32/WString.h line 144
0x400d2886: setup() at C:\Users\user\Documents\Arduino\ESP32_influx_api/ESP32_influx_api.ino line 53
0x400dcb5b: setCpuFrequencyMhz at C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.2\cores\esp32\esp32-hal-cpu.c line 170
0x4008ea2a: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c line 139

I could think that it, as you can see, got something to do with the strlen function that a String possibly is out of bounce or so which fails the http request and the validation for the influxdbclient. I tried using another url, new tokens, other timesyncs and so on. Connecting to the WiFi works but it the client.validateConnection() function malfunctions in some way. But I can't find anything helpful online and I'm open for any help!

Upvotes: 0

Views: 17

Answers (0)

Related Questions