Access to Edgent WiFi Credentials

Hello, enjoying the journey to Blink IOT but have hit a few small bumps right here at the end. My device runs well on old Blynk and utilizes WiFiClient to enable web service calls to Thingspeak. I have run the Edgent example without issues so I assume my toolchain and Blynk environment is ok. Next, I have imported the code into Edgent as documented and it compiles without error. Since I am using the Edgent WiFi provisioning, I realize that I’ll need to somehow gain access to the WiFi credentials (and client object) so that I can perform my webservice calls (i.e., HTTP POST to ThingSpeak API). Question: is there documentation on how one can access WiFi credentials (e.g., SSID, PWD, client object) from the BlynkEdgent.begin() action or is there an Edgent equivalent to instantiate the WiFi object? Thanks!

I guess the wifi SSID stored in a variable called configStore.wifiSSID, and the wifi password stored in a variable called configStore.wifiPass

Thanks John. Any idea how I might access the WiFi client object so that I can do my HTTP POST call? It was so easy with WIFiClient. Thanks.

Can you show us your http url ?
What are you trying to achieve exactly ?

I really don’t understand why you need the WiFi credentials to make the an HTTP POST from your device.
I could point you to where I think these are stored in the configStore, but I think that would be sending you off down a rabbit hole that would lead nowhere.

I could also point you to examples of making HTTP(S) API calls from the Edgent sketch for the ESP32 or ESP8266, or how to use the Webhook functionality to make these POST calls from the server.
However, I need more information about your hardware, and exactly what it is you are trying to achieve first.

Pete.

John, Pete, thanks for the tips. I had used Webhooks in a previous version but then moved the calls back into the sketch where I had more control. For Blynk IOT I guess it might be simpler to define the Webhooks in Console and just go that route. I will try that and see how it goes.

1 Like

There are limitations, such as one webhoook call per minute, and no feedback to the device from the webhook.

That’s why I said that more info regarding exactly what you are trying to achieve and what hardware you are using would be useful.

Pete.

Hi Pete, thanks again for your help. Got my ESP32 app working using the esp_wifi.h library…was simple but just didn’t understand that including this lib wouldn’t overlay or somehow mess up the Edgent WiFi provisioning. Looks like they will play well together.

Making an HTTP(S) call is fairly easy from the ESP32 Edgent sketch. This uses GET to post data to the Blynk server, but a POST is also possible…

You use the HTTPClient.h library, declare an HTTPClient object, then make call using [object].POST

No credentials are required.

Pete.