Skip to content

Conversation

sandeepkumar0153
Copy link

@sandeepkumar0153 sandeepkumar0153 commented Oct 5, 2025

simple reconnect attempts to connect a predefined number of times to the WiFi network.
there is an issue with raspberry pico w, where it may not connect in the first attempt after a restart.
works for all other devices as well.

  • I have tested that my proposed changes behave as described.

  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:

  • Heltec (Lora32) V3

  • LilyGo T-Deck

  • LilyGo T-Beam

  • RAK WisBlock 4631

  • Seeed Studio T-1000E tracker card

  • Nrf52840 diy

  • Rpi pico w

@vidplace7 vidplace7 added the enhancement New feature or request label Oct 5, 2025
@sandeepkumar0153
Copy link
Author

refactoring code slightly, will update once done.

updated wifi reconnect attempts code.
@sandeepkumar0153
Copy link
Author

updated the code, added some debug log info content.
tested on pico w and nrf52840 diy.

  1. no wifi AP max reconnect attempt scenario.
  2. wifi ap connect after 3 attempts caused by wifi router reboot.

@thebentern thebentern requested a review from Copilot October 7, 2025 11:09
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves WiFi connection reliability by implementing a configurable retry mechanism for WiFi connections, specifically addressing connection issues with Raspberry Pi Pico W devices that may fail to connect on the first attempt after restart.

  • Introduces configurable WiFi connection retry attempts (default 6 attempts)
  • Adds configurable reconnection delay between attempts (default 10 seconds)
  • Updates hardware pin configurations for multiple device variants

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
variants/rp2040/rpipicow/variant.h Updates button pin configuration for Raspberry Pi Pico W
variants/nrf52840/diy/nrf52_promicro_diy_tcxo/variant.h Modifies various hardware pin assignments and radio module configurations
src/mesh/wifi/WiFiAPClient.cpp Implements WiFi connection retry logic with configurable attempts and delays

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sandeepkumar0153
Copy link
Author

reverted variant.h to default config for two devices to match meshtastic repo.

static unsigned char wifiConnectAttempts = 0;

#ifndef MaxWifiConnectionAttempts
#define MaxWifiConnectionAttempts 6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Macros should be CAPS_LOCK

#endif

#ifndef wifiReconnectGap
#define wifiReconnectGap 10000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Macros should be CAPS_LOCK

thebentern and others added 2 commits October 12, 2025 08:27
macros have been capitalized, no further modification to code flow and logic from my end
Copy link
Author

@sandeepkumar0153 sandeepkumar0153 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macros have been made uppercase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants