-
Notifications
You must be signed in to change notification settings - Fork 145
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
Connectivity status (MEGH-3931) #190
Comments
From RainMaker's perspective, connected to Internet = Connected to MQTT. So, for checking Internet connectivity, you can monitor the |
I am unable to access event handler objects or class members. Can you please guide me with some example. i am trying to access ESP_EVENT_DECLARE_BASE for RMAKER_MQTT_EVENT_CONNECTED this enum. any example from this will help which i was not able to find anywhere . |
The example pointer is already shared above. Sharing again Registering for events: https://github.com/espressif/esp-rainmaker/blob/master/examples/switch/main/app_main.c#L139 Handling events: https://github.com/espressif/esp-rainmaker/blob/master/examples/switch/main/app_main.c#L84 You need to include these files #include <esp_event.h>
#include <esp_rmaker_common_events.h> |
Hi there !
My Assumption are : Any suggestion for reconnect code will be appreciated. Thanks in advance. |
@b4sudhir , MQTT client keeps retrying after every 10 seconds, irrespective of what the disconnect reason was. It could be Wi-Fi disconnect or Internet lost or server itself being down. One reason for the connection failing could also be low memory. You can use the below snippet and call it from the MQTT disconnected event to see how much RAM is available
Can you tell if you are using Arduino or esp idf for RainMaker? If you are using esp-idf, just replace |
@shahpiyushv Thank you So much. |
@b4sudhir , generally, it is recommended to add a new issue if it is not related to the current one. That helps in better tracking and can also help other users who are looking for similar answers :) The name is a normal parameter like rest of the parameters, with the only difference that it is handled internally. However, you can enable CONFIG_ RMAKER_NAME_PARAM_CB so that you get callback for that too and handle it yourself. For MQTT publish, you can use RMAKER_MQTT_EVENT_PUBLISHED event. We have not exposed the message received events via RainMaker because those are redirected to appropriate callbacks. Meanwhile, just curious to know what your use case is. |
@shahpiyushv Actually i want to store device name in eeprom and whenever i edit in app it will store device name in esp 32 eeprom and in next reboot it will display in the app with edited name only . Basically i want freedom to edit my device name and store in memory so if my esp restart it will not change my edited name. Actually tried your way but not successful in the process. |
@b4sudhir , even right now, is you use the default name parameter (which is automatically added in the standard devices) the name is stored in persistent storage (nvs) on the device side and so, is retained across a reboot. Is there any specific use case for storing it in EEPROM instead? |
How do I know or differentiate if my IOT device is connected to wifi without internet.
Use cases : Connected to wifi, with internet, Connected to wifi without internet(when WAN is failing).
The text was updated successfully, but these errors were encountered: