Page 1 of 1

WiFI MK11 Firmware update

Posted: Tue Jul 02, 2024 12:39 pm
by UkTinkerer
Hi There,

I got some help from Pontus with updating fimrware on the Challenger MKII WifI/BLE board (V0.2). I have been trying to adjust the WiFI protocol using the AT commands to enable the LR mode both for SoftAP and Station mode I believe the correct command for this is SET > AT+CWAPPROTO=<protocol> and QUERY > AT+CWAPPROTO?. On the shipped FW ( 2.3.0) I get an Error response when sending this I tried this command AT+CWAPPROTO=8 which I believe will set Bit 4 as documented in the ESP32-C3 AT commands definition.
The query command works fine

The branched esptool works but only in Linux, I found the reset/read wouldn't function in windows so just noting that here for any other users - use linux!

In terms of firmware I am currently not able to get the factory firmware from Espressif to work. I suspect there might be something specifc needed to map the TX serial correctly to the ESP32 from the RP2040

When I flash the ESP32-C3 with the factory-MINI.bin and leaving the USB2Serial sketch running on the board, I can see data from the ESP32 coming back stating it is running the new firmware but it doesn't respond to AT commands. I have tried 2.4.0 and 3.2.0 neither worked correctl and when running a design using WiFIEspAT library it throws an error when attempting to communicate with the ESP32.

I suspect I need to use the at.py utility to modify the factory bin with the correct settings to make this work, either that or I'm doing something else wrong. It might be nice to have tested *.bins available for users - the USB2Serial demo lists "factory_CHALLENGER_RP2040_WB_V2.4.0.0.bin" which is ahead of what my boards shipped with.

Many thanks for any help!

Re: WiFI MK11 Firmware update

Posted: Tue Jul 02, 2024 3:48 pm
by Pontus
Hi,
Let's see if we can't get this show on the road.
The standard firmwares, as you have noted, will not work as our board are configured differently.
I have attached the latest version that we use in production here for you to try out. When I have a couple of minutes over I will create a post here with all the different fw's that we use in production.

Let me know how it works out for you.
/P

Re: WiFI MK11 Firmware update

Posted: Wed Jul 03, 2024 12:05 pm
by UkTinkerer
Thanks Pontus, the firmware update worked and I have working AT command responses. Perfect!

However, I'm still not able to set the LR protocol mode of the ESP32. So I need to dig a bit more there. I did pull your esp-at repo and had a look in the menuconfig for anything there that might enable/disable that capability but couldn't see anything.

I'm handcrafting AT commands and can set the protocol successfully only to a limited set of protocols e.g I can set ti to "b" (1) only and "bgn"(7) but not the listed "bgnlr" (11) or "lr" (8)

I think this is about when I set this - there are examples of how to do this when developing natively onto the esp32 and people have had issues which seem to be about making sure you init and start before setting this, but the equivalents of these in WiFiEspat don't exist. https://github.com/espressif/esp-idf/issues/9933

I'm using one board as a SoftAp which I would like to be set to bgnlr and a number of boards acting as stations which I want to set as LR - this will enable the clients to operate at extended range but also allow none ESP based stations to connect to the SoftAP - this enables me to use the SoftAP to proxy data to LR station clients which is handy if you know your clients don't need much bandwidth but are going to need to operate further from the SoftAP than your machine.

Any help on how I can make this work would be useful, I bought the boards because they ESP32C3 supports LR

Here is my example called int setup after doing the challanger wifi reset

Code: Select all

void configAP() {
  //Init Wifi and start AP 
  WiFi.init(ESP32_SERIAL);  
  delay(5000);
  WiFi.beginAP(ssid,pass);

  Serial.println("Checking State after startup");
  Serial2.println("AT+CWSTATE?");
  PrintResponse();
  
  Serial.println("Checking mode after startup");
  Serial2.println("AT+CWMODE?");
  PrintResponse();

  Serial.println("Checking protocol after startup");
  Serial2.println("AT+CWAPPROTO?");
  PrintResponse();

  Serial.println("Setting protocol");
  Serial2.println("AT+CWAPPROTO=1");
  PrintResponse();

  Serial.println("Checking protocol after Set");
  Serial2.println("AT+CWAPPROTO?");
  PrintResponse();

  
}


void PrintResponse(){
  delay(50); //wait for response to arrive
  while(Serial2.available()) {
    String input = Serial2.readStringUntil('\n');
    Serial.println(input);
  }
}

Good output when setting protocol to 1 ==
WiFi chip reset OK!!
Checking State after startup
+CWSTATE:3,""



OK

Checking mode after startup
+CWMODE:3



OK

Checking protocol after startup
+CWAPPROTO:7

OK

Setting protocol


OK

Checking protocol after Set
+CWAPPROTO:1

OK
Bad output when setting to bgnlr (11)
WiFi chip reset OK!!
Checking State after startup
+CWSTATE:3,""



OK

Checking mode after startup
+CWMODE:3



OK

Checking protocol after startup
+CWAPPROTO:7

OK

Setting protocol


ERROR

Checking protocol after Set
+CWAPPROTO:7

OK

Re: WiFI MK11 Firmware update

Posted: Wed Jul 03, 2024 3:40 pm
by UkTinkerer
After a bit more tinkering I realised I'd been using the older firmware!

New firmware works and I can set the protocol correctly. FYI the firmware version reported back from WifiESPAT library from the binary in this post is actually
Firmware version is 3.2.0.0-dev


Apologies, my commands were fine and now it sets and queries correctly - Minor typo last time for anyone wanting to set "bgnlr" its 15 that you need to set the protocol too.

Re: WiFI MK11 Firmware update

Posted: Tue Jul 09, 2024 8:01 am
by Pontus
Ah, great. I'll update accordingly.
Good to see your progress.