khoih-prog / WiFiManager_NINA_Lite

Light-Weight WiFi/Credentials Manager for AVR Mega, Teensy, SAM DUE, SAMD, STM32, etc. boards running U-Blox WiFiNINA modules/shields. Powerful-yet-simple-to-use feature to enable adding dynamic custom parameters. Now using WiFiMulti_Generic library
MIT License
35 stars 10 forks source link

Asking for a complete code-example for RP2040-connect board incl. custom SSID/PW of Access Point #14

Closed iKK001 closed 3 years ago

iKK001 commented 3 years ago

Using the board "Arduino Nano RP2040 Connect" I have two or three questions:

  1. to set my own Access-Point SSID and PW - what do I have to do ? I thought of using the WiFiManager_NINA->begin(HOST_NAME); but this does not work. The Access-point SSID remains the default (ie. something like "WIFININA_51X356")

What other cmd does change to a default SSID/PW for the Access-Point at very first usage of the board ?

  1. What is the best library to use for the "Arduino Nano RP2040 Connect" board ? Is it WiFiManager_NINA_Lite or WiFiNINA_Generic or which one ?

My needed steps are as states here below:

A) At first startup (or when Home-SSID/PW change): --> RP2040 starts up as Access Point (with custom SSID/PW)
B) Then user can take a mobile phone and find the Access Point, connect to it in WiFi settings
C1) ideally, the mobile phone shows a HTML-page directly where user can enter Home-Network credentials (SSID/PW or home-network)
C2) if automatic opening of HTML is not possible, then user goes to custom IP where the SSID/PW of home-network can be entered
D) RP2040 receives the credentials and stores them securely in Flash
E) RP2040 reconnects automatically to the home-network using the received credentials (SSID/PW of home-network)
F) At any further startup after power-off, the RP2040 connects to the home-network directly (without being an Access Point any more). One exception: if home-network SSID or PW change, then restart at Step A)

If I understand correctly, your WiFiManager_NINA_Lite library can do exactly those steps - or not ??

I am very desperate to get this to work.

Please give a complete code-example for the steps above (A-F) for the "Arduino Nano RP2040 Connect" board.

Thank you

khoih-prog commented 3 years ago

Hi,

Thanks your using the library.

  1. to set my own Access-Point SSID and PW - what do I have to do ?

Use function

void setConfigPortal(String ssid = "", String pass = "");

For example, check the example in Custom AP settings #3

...

  WiFiManager_NINA = new WiFiManager_NINA_Lite();

  // Set customized AP IP
  WiFiManager_NINA_Lite->setConfigPortalIP(IPAddress(192, 168, 100, 1));

  String AP_SSID = "your_customized_ssid";
  String AP_PWD  = "your_customized_pwd";

  // Set customized AP SSID and PWD
  WiFiManager_NINA_Lite->setConfigPortal(AP_SSID, AP_PWD);

...

  1. What is the best library to use for the "Arduino Nano RP2040 Connect" board ? Is it WiFiManager_NINA_Lite or WiFiNINA_Generic or which one ?

You have to read the README of each library and figure out they are written for different purpose.


My needed steps are as states here below:

A) At first startup (or when Home-SSID/PW change): --> RP2040 starts up as Access Point (with custom SSID/PW) ... F) At any further startup after power-off, the RP2040 connects to the home-network directly (without being an Access Point any more). One exception: if home-network SSID or PW change, then restart at Step A)

If I understand correctly, your WiFiManager_NINA_Lite library can do exactly those steps - or not ??

Did you try the example RP2040_WiFiNINA ?

Can do or not is up to you to decide. If you haven't tried the example to understand what it can provide, or have no idea of what you're talking, I also have no idea what to say.

Certainly we, the library writers, can try our best by writing as many examples as we see fit to help.

Good Luck,