Rainmaker & WifiLocation
Rainmaker & WifiLocation
Hello Everybody,
I got Rainmaker Running and i got WifiLocation(https://github.com/gmag11/WifiLocation) running by themselfes, but as soon as i merge the WifiLocation to my working Rainmaker solution i get lot's of errors.
ERROR list
[ 23373][E][esp_crt_bundle.c:184] esp_crt_bundle_attach(): Failed to attach bundle
E (23821) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x7680
E (23822) esp-tls: Failed to open new connection
E (23822) TRANSPORT_BASE: Failed to open a new connection
E (23827) MQTT_CLIENT: Error transport connect
E (23830) esp_mqtt_glue: MQTT_EVENT_ERROR
and Sometimes:
E (3208) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x7680
E (3209) esp-tls: Failed to open new connection
E (3209) TRANSPORT_BASE: Failed to open a new connection
E (3215) HTTP_CLIENT: Connection failed, sock < 0
E (3217) esp_claim: Failed to open connection to https://esp-claiming.rainmaker.espressif.com/claim/initiate
E (3227) esp_claim: Claim Init Request Failed.
E (3231) esp_claim: Claim Init Sequence Failed.
E (3235) esp_rmaker_core: esp_rmaker_self_claim_perform() returned -1. Aborting
I think it mixes up the certificates or sth, since WifiLocation usses the google API....
Did anyone tried something similiar yet?
Thank you and best regards
Quabsi
I got Rainmaker Running and i got WifiLocation(https://github.com/gmag11/WifiLocation) running by themselfes, but as soon as i merge the WifiLocation to my working Rainmaker solution i get lot's of errors.
ERROR list
[ 23373][E][esp_crt_bundle.c:184] esp_crt_bundle_attach(): Failed to attach bundle
E (23821) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x7680
E (23822) esp-tls: Failed to open new connection
E (23822) TRANSPORT_BASE: Failed to open a new connection
E (23827) MQTT_CLIENT: Error transport connect
E (23830) esp_mqtt_glue: MQTT_EVENT_ERROR
and Sometimes:
E (3208) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x7680
E (3209) esp-tls: Failed to open new connection
E (3209) TRANSPORT_BASE: Failed to open a new connection
E (3215) HTTP_CLIENT: Connection failed, sock < 0
E (3217) esp_claim: Failed to open connection to https://esp-claiming.rainmaker.espressif.com/claim/initiate
E (3227) esp_claim: Claim Init Request Failed.
E (3231) esp_claim: Claim Init Sequence Failed.
E (3235) esp_rmaker_core: esp_rmaker_self_claim_perform() returned -1. Aborting
I think it mixes up the certificates or sth, since WifiLocation usses the google API....
Did anyone tried something similiar yet?
Thank you and best regards
Quabsi
-
- Posts: 309
- Joined: Wed Feb 20, 2019 7:02 am
Re: Rainmaker & WifiLocation
There are high chances that the issue is occurring because of low memory. Can you try disabling local control (CONFIG_ESP_RMAKER_LOCAL_CTRL_ENABLE) to free up some memory and see if this works?
Re: Rainmaker & WifiLocation
Hi ESP_Piyush,
thank you very much for your reply, how and where can i find the config file i need to change?
Also how much Memmory should be available?
I included before calling
it looks like i got: 174720 byte Available Ram...
Best regards and thank you for your help!
thank you very much for your reply, how and where can i find the config file i need to change?
Also how much Memmory should be available?
I included
Code: Select all
Serial.println("Available Ram: " + String(ESP.getFreeHeap()) + " byte");
Code: Select all
WifiLocation location (googleApiKey);
loc = location.getGeoFromWiFi();
Best regards and thank you for your help!
-
- Posts: 32
- Joined: Tue Jul 26, 2022 10:08 am
Re: Rainmaker & WifiLocation
Hi,
The error code -0x7680(MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED) means that no CA chain is set. Secondly, local control is not available for Rainmaker with Arduino.
Alternatively, you can let the device connect to the MQTT broker first and then run your code by creating an event handler like this.
To attach event handler, you need to call the function below after RMaker.initNode() function inside setup()
The error code -0x7680(MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED) means that no CA chain is set. Secondly, local control is not available for Rainmaker with Arduino.
Alternatively, you can let the device connect to the MQTT broker first and then run your code by creating an event handler like this.
Code: Select all
/* Event handler for catching RainMaker events */
static void event_handler(void* arg, esp_event_base_t event_base,
int32_t event_id, void* event_data)
{
if (event_base == RMAKER_COMMON_EVENT) {
switch (event_id) {
case RMAKER_MQTT_EVENT_CONNECTED:
log_i("MQTT Connected.");
// Your WiFiLocation code
break;
default:
break;
}
}
}
Code: Select all
void setup()
{
....
esp_event_handler_register(RMAKER_COMMON_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL);
....
}
Re: Rainmaker & WifiLocation
Thank you very much for the great idea.
i tried it the following way:
but i still get the same error below.
[247842][E][esp_crt_bundle.c:184] esp_crt_bundle_attach(): Failed to attach bundle
E (248256) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x7680
E (248256) esp-tls: Failed to open new connection
E (248256) TRANSPORT_BASE: Failed to open a new connection
E (248262) MQTT_CLIENT: Error transport connect
E (248265) esp_mqtt_glue: MQTT_EVENT_ERROR
it seems that as soon as i create a new WiFiClientSecure object it fails, even before the MQTT Event is fired...
in fact it never reaches the code above because RMAKER_MQTT_EVENT_CONNECTED is never happening.
i tried it the following way:
Code: Select all
/* Event handler for catching RainMaker events */
static void event_handler(void* arg, esp_event_base_t event_base,
int32_t event_id, void* event_data)
{
if (event_base == RMAKER_COMMON_EVENT) {
switch (event_id) {
case RMAKER_MQTT_EVENT_CONNECTED:
{
log_i("MQTT Connected.");
// Your WiFiLocation code
Serial.println("getting location...");
Serial.println("Available Ram: " + String(ESP.getFreeHeap()) + " byte");
WiFiClientSecure client; // <= as soon as i include this line it fails
location_t loc2 = getGeoFromWiFi2(client);
Serial.println("Latitude: " + String(loc.lat, 7));
Serial.println("Longitude: " + String(loc.lon, 7));
Serial.println("Accuracy: " + String(loc.accuracy));
break;
}
default:
break;
}
}
}
[247842][E][esp_crt_bundle.c:184] esp_crt_bundle_attach(): Failed to attach bundle
E (248256) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x7680
E (248256) esp-tls: Failed to open new connection
E (248256) TRANSPORT_BASE: Failed to open a new connection
E (248262) MQTT_CLIENT: Error transport connect
E (248265) esp_mqtt_glue: MQTT_EVENT_ERROR
it seems that as soon as i create a new WiFiClientSecure object it fails, even before the MQTT Event is fired...
in fact it never reaches the code above because RMAKER_MQTT_EVENT_CONNECTED is never happening.
Re: Rainmaker & WifiLocation
after more debugging it looks like the error occures because of setCACert(googleCA); in WifiLocation solution. Maybe that's overwritting something from Rainmaker...
Who is online
Users browsing this forum: No registered users and 27 guests