-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boot crash: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:1442 (xQueueGenericReceive)- assert failed! #3467
Comments
You cannot call configTime until WiFi has been initialized. |
lbernstone: Thank You! Thank You! Thank You! That was the issue... |
It is there in the traceback if you know how to read it. Please close the issue. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
This issue happens also when i am using sim7000g. What should I modify to make it working? |
I've made the modification you've suggested, but I still receive the same error. I also added "WiFi.mode(WIFI_MODE_AP);" just before "if (!Esp32MQTTClient_Init((const uint8_t*)connectionString))" and the last thing I see in the monitor is "Info: Initializing SNTP". PS. I also modified sntp_lwip.c I added "#include "tcpip_adapter.h" and and remains here, just like adding "WiFi.mode(WIFI_MODE_AP);" Probably SNTP is waiting for the WiFi connection to be ready and I am using the GSM. |
Indeed the problem is not the Azure MQTT client. Although the modem is connected to internet and I obtain an IP, the whole connection process is not completed. |
I am setting up a new Arduino ESP32 Feather board with BME680 sensor. The sample sketches I tried are working, and I have started to adapt the sample code.
My code compiles fine, but crashes with the following output:
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:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:1442 (xQueueGenericReceive)- assert failed!
abort() was called at PC 0x40089019 on core 1
Backtrace: 0x4008cc18:0x3ffb1db0 0x4008ce49:0x3ffb1dd0 0x40089019:0x3ffb1df0 0x4014780a:0x3ffb1e30 0x40147ae6:0x3ffb1e50 0x40136708:0x3ffb1e70 0x40136771:0x3ffb1e90 0x4013dcc9:0x3ffb1eb0 0x4013dcee:0x3ffb1ed0 0x40136567:0x3ffb1ef0 0x400d6bb7:0x3ffb1f10 0x400d14ac:0x3ffb1f80 0x400d7483:0x3ffb1fb0 0x4008932d:0x3ffb1fd0
Rebooting...
I installed the Exception Decoder in the Arduino IDE and get the following:
Decoding stack results
0x4008cc18: invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 155
0x4008ce49: abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 170
0x40089019: xQueueGenericReceive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c line 1442
0x4014780a: sys_mutex_lock at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/port/esp32/freertos/sys_arch.c line 78
0x40147ae6: sys_arch_protect at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/port/esp32/freertos/sys_arch.c line 469
0x40136708: do_memp_malloc_pool at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/memp.c line 302
0x40136771: memp_malloc at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/memp.c line 398
0x4013dcc9: udp_new at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/udp.c line 1145
0x4013dcee: udp_new_ip_type at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/udp.c line 1177
0x40136567: sntp_init at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/apps/sntp/sntp.c line 547
0x400d6bb7: configTime at /Users/awsjames/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-time.c line 55
0x400d14ac: setup() at /Users/awsjames/Desktop/IoT Downloads/bme680test/bme680test.ino line 93
0x400d7483: loopTask(void*) at /Users/awsjames/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/main.cpp line 14
0x4008932d: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
Here is the current code:
//INCLUDES FOR ESP32 FEATHER + BME680 TEST TO FUNCTION PROPERLY
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_BME680.h"
//ADDITIONAL INCLUDES FOR AWS IOT INTEGRATION
//#include <WiFiAP.h> //Code won't compile with this include file...
#include <WiFiMulti.h>
#include <WiFiUdp.h>
#include <WiFiScan.h>
#include <ETH.h>
#include <WiFiClient.h>
#include <WiFiSTA.h>
#include <WiFiServer.h>
#include <WiFiType.h>
#include <WiFiGeneric.h>
#include <ArduinoJson.h>
#include <AWS_IOT.h>
#include <WiFi.h>
#include "time.h"
#include <string.h>
//CONFIGURATION FOR BME680 SENSOR USING SPI
#define BME_SCK 5
#define BME_MISO 19
#define BME_MOSI 18
#define BME_CS 21
struct tm timeinfo;
#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME680 bme(BME_CS); // hardware SPI
AWS_IOT sensor;
//Defining parameters for connecting to Wifi and AWS
char WIFI_SSID[]="";
char WIFI_PASSWORD[]="";
char HOST_ADDRESS[]="*****";
char CLIENT_ID[]= "testclient";
char TOPIC_NAME[]= "iot/test";
char curtime [50];
//timer
int status = WL_IDLE_STATUS;
int tick=0,msgCount=0,msgReceived = 0;
char payload[512];
char rcvdPayload[512];
//Defining Time variables
const char* ntpServer = "pool.ntp.org";
const long gmtOffset_sec = -28800;
const int daylightOffset_sec = 3600;
//Air quality variable
float hum_weighting = 0.25; // so hum effect is 25% of the total air quality score
float gas_weighting = 0.75; // so gas effect is 75% of the total air quality score
float hum_score, gas_score;
float gas_reference = 250000;
float hum_reference = 40;
int getgasreference_count = 0;
void mySubCallBackHandler (char *topicName, int payloadLen, char *payLoad)
{
strncpy(rcvdPayload,payLoad,payloadLen);
rcvdPayload[payloadLen] = 0;
msgReceived = 1;
}
void GetGasReference(){
// Now run the sensor for a burn-in period, then use combination of relative humidity and gas resistance to estimate indoor air quality as a percentage.
Serial.println("Getting a new gas reference value");
int readings = 10;
for (int i = 0; i <= readings; i++){ // read gas for 10 x 0.150mS = 1.5secs
gas_reference += bme.readGas();
}
gas_reference = gas_reference / readings;
}
void setup() {
Serial.begin(115200);
while (!Serial);
delay(2000);
if (!bme.begin()) {
Serial.println("Could not find a valid BME680 sensor, check wiring!");
while (1);
}
//init and get the time
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
// Set up oversampling and filter initialization
bme.setTemperatureOversampling(BME680_OS_2X);
bme.setHumidityOversampling(BME680_OS_2X);
bme.setPressureOversampling(BME680_OS_2X);
bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
bme.setGasHeater(320, 150); // 320*C for 150 ms
while (status != WL_CONNECTED)
{
Serial.print("Attempting to connect to SSID: ");
Serial.println(WIFI_SSID);
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
status = WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
}
Serial.println("Connected to wifi");
if(sensor.connect(HOST_ADDRESS,CLIENT_ID)== 0)
{
Serial.println("Connected to AWS");
delay(1000);
}
else
{
Serial.println("AWS connection failed, Check the HOST Address");
while(1);
}
delay(2000);
}
void loop() {
if (! bme.performReading()) {
Serial.println("Failed to perform reading :(");
return;
}
}
I am not a developer and am trying to hack my way through fixing this. Any help would greatly be appreciated!
The text was updated successfully, but these errors were encountered: