Provisioning over WiFi without COM Port

rmetzner49
Posts: 27
Joined: Mon Mar 27, 2017 1:09 am

Provisioning over WiFi without COM Port

Postby rmetzner49 » Sat Jan 29, 2022 12:46 am

First, I want to say you guys have done a tremendous job with Rainmaker, and I'm able to create a node and add parameters to my heart's desire. What is puzzling me is; how to provision an ESP32 with an existing WiFi connection. Indeed, if I disable WiFi, the ESP makes a new bar code just fine.

I have a few ESP widgets that are tough to get to, so I've tried things in various order. I should be able to TelnetStream.print the URL for the barcode. I also have conventional OTA working over WiFi. My setup code is as below:

// *************************************************************************
void setup(){
uint8_t mac[6];
Serial.begin(115200);
pinMode(GAS_ON, INPUT_PULLUP);
pinMode(PWR_ING, INPUT_PULLUP);
delay(2000);
WiFisetup(); // Once connected, begin Telnet
TelnetStream.begin(); // start telnet BEFORE Rainmaker for Telnet Provisioning
RMakerSetup(); // We can TelnetStream the URL for provisoning here
delay(500); //
GetRunTime();
OTAsetup(); // start over-the-air support
Version = ArduinoOTA.getHostname(); // OTA should have set Hostname
//StoreInitialHours(); // Need Preferences after Factory Reset
}// --------------------------- end setup -------------------------------------

If I comment out WiFisetup and TelnetStream.begin and OTAsetup, I get successful barcode. If I enable WiFi, the node doesn't connect with the Android Phone App.

Suggestions would be appreciated.

endlessparadigm
Posts: 16
Joined: Mon Oct 25, 2021 4:15 am

Re: Provisioning over WiFi without COM Port

Postby endlessparadigm » Tue Feb 01, 2022 5:28 am

What's inside your WiFisetup()?
I generally work with ESP-IDF but from my understanding if WiFi is provisioned already then you wont see QR code as it is meant for provisioning.
https://github.com/espressif/arduino-es ... v.cpp#L119

rmetzner49
Posts: 27
Joined: Mon Mar 27, 2017 1:09 am

Re: Provisioning over WiFi without COM Port

Postby rmetzner49 » Wed Feb 09, 2022 9:03 pm

I did conclude that after much looking at the order of events in Provisioning. To get around this, I now don't initialize WiFi until after the claiming process. You ask, why WiFi? Because I haven't been able to use Rainmaker's OTA service and can't afford to wait until Pedro or Piyoush get around to testing it for Arduino. I've found I'm able to use the classic ArduinoOTA to update firmware. Since the Provisioning only needs to happen ONCE per ESP32, it's happy with it.

What I was hoping to do but can't quite hit is, spitting out the QRCode URL in TelNet. That way I don't need the device being Provisioned on my bench.

Who is online

Users browsing this forum: No registered users and 9 guests