Comments (6)
Hello, I was able to connect the indicator_basis example to MQTT of AWS. But a default value is being publised and not the actual sensor readings from the "indicator_sensor.c" file, even after successfull connection in the logs it is showing an error -->
I (46805) aws_iot: Subscribe callback Test: test_topic/esp32 co2 : 179.0, tVOC : 180.0
I (46908) aws_iot: Subscribe callback Test: test_topic/esp32 co2 : 179.0, tVOC : 180.0
I (47008) aws_iot: Stack remaining for task 'aws_iot_task' is 3260 bytes
I (47603) city: Get time zone...
E (47613) esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00
E (47613) esp-tls: create_ssl_handle failed
E (47613) esp-tls: Failed to open new connection
E (47618) city: Connection failed...
As you can see the default values being publised are 179 and 180. Whereas the actual values are -->
These lines handle the data subscribing to the MQTT->
aws_iot.c
void iot_subscribe_callback_handler(AWS_IoT_Client *pClient, char *topicName, uint16_t topicNameLen,
IoT_Publish_Message_Params *params, void *pData) {
ESP_LOGI(TAG, "Subscribe callback Test: %.*s\t%.*s", topicNameLen, topicName, (int) params->payloadLen, (char *)params->payload);
}
...............................
.............................
...............................
while((NETWORK_ATTEMPTING_RECONNECT == rc || NETWORK_RECONNECTED == rc || SUCCESS == rc)) {
//Max time the yield function will wait for read messages
rc = aws_iot_mqtt_yield(&client, 100);
if(NETWORK_ATTEMPTING_RECONNECT == rc) {
// If the client is attempting to reconnect we will skip the rest of the loop.
continue;
}
ESP_LOGI(TAG, "Stack remaining for task '%s' is %d bytes", pcTaskGetName(NULL), uxTaskGetStackHighWaterMark(NULL));
vTaskDelay(3000 / portTICK_PERIOD_MS);
// sprintf(cPayload, "%s : %d ", "WiFi RSSI", wifi_app_get_rssi());
paramsQOS0.payloadLen = strlen(cPayload);
rc = aws_iot_mqtt_publish(&client, TOPIC, TOPIC_LEN, ¶msQOS0);
sprintf(cPayload, "%s : %.1f, %s : %.1f", "co2", getco2(), "tVOC", gettvoc());
// sprintf(cPayload, "%s : %.1f, %s : %.1f", "Temp", getTemp(), "Hum", getHum());
paramsQOS1.payloadLen = strlen(cPayload);
rc = aws_iot_mqtt_publish(&client, TOPIC, TOPIC_LEN, ¶msQOS1);
if (rc == MQTT_REQUEST_TIMEOUT_ERROR) {
ESP_LOGW(TAG, "QOS1 publish ack not received.");
rc = SUCCESS;
}
}
END
aws_iot.h
#ifndef MAIN_AWS_IOT_H_
#define MAIN_AWS_IOT_H_
#define CONFIG_AWS_EXAMPLE_CLIENT_ID "CaaX"
/**
* Starts AWS IoT task.
*/
void aws_iot_start(void);
#endif /* MAIN_AWS_IOT_H_ */
END
Tasks_common.h
#ifndef MAIN_TASKS_COMMON_H_
#define MAIN_TASKS_COMMON_H_
// AWS IoT Task
#define AWS_IOT_TASK_STACK_SIZE 9216
#define AWS_IOT_TASK_PRIORITY 6
#define AWS_IOT_TASK_CORE_ID 0
#endif /* MAIN_TASKS_COMMON_H_ */
END
Please look into the code and check if any errors are there and any corrections to be made in this file or any other file. Thank you
from sensecap_indicator_esp32.
Could you share the modifications you've made?
If it's inconvenient, just placeholder it.
from sensecap_indicator_esp32.
Otherwise you could try the code https://github.com/Seeed-Solution/SenseCAP_Indicator_ESP32/tree/bf7ff29d95cf5591a3f277ff3a930094286a5a4e as you are following the wiki instruction.
If you're using the lastes demo of HA, you could follow here #29.
from sensecap_indicator_esp32.
if using MQTTS, you'll need to modify the corresponding credentials such as *.pem
.
The demo is for MQTT.
from sensecap_indicator_esp32.
Could you share the modifications you've made? If it's inconvenient, just placeholder it.
I am configuring the "indicator_basis" example and trying to connect that to the AWS MQTT, How can I share the whole file..?
I am following a different configuration file, not the HA one..!
from sensecap_indicator_esp32.
Could you share the modifications you've made? If it's inconvenient, just placeholder it.
I am configuring the "indicator_basis" example and trying to connect that to the AWS MQTT, How can I share the whole file..? I am following a different configuration file, not the HA one..!
Just share the core function of you application that you think is working.
from sensecap_indicator_esp32.
Related Issues (20)
- IDF Patch failed HOT 1
- Troubleshooting GPIO Compilation Errors with ESP-IDF 5.1 and Resolving Dependencies HOT 1
- IDF-SDK 5.1 cant compile HOT 3
- Patch release5.0_psram_octal_120m.patch fail HOT 5
- After flashin (ESP-IDF v5.1) the screen keeps flickering very fast (app is installed), can onyone help? HOT 1
- Build Error HOT 8
- Re-programming SenseCAP: not showing up as /dev/cu.usbserial-xxxx anymore HOT 4
- Timezone Issue HOT 3
- Still get static_assert about "FLASH and PSRAM Modeβ even with patch applied HOT 3
- esp-library problem HOT 3
- Patch failed with last version of IDF HOT 3
- Compile error: unknown type name 'time_t' HOT 4
- Photo Example
- MicroPython support HOT 1
- Customizable MQTT Topics for Multiple Device Support
- indicator_ha showing one hour less HOT 8
- Can Indicator RP2040 pull the image from Vision V2 faster? HOT 1
- Memory leaks cause system to crash and/or openAI requests to fail in indicator_openai example HOT 1
- Problem with flashing any example using wifi & screen HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sensecap_indicator_esp32.