switch node1 to wifi test
This commit is contained in:
parent
9f4a163b53
commit
51cf876486
2 changed files with 109 additions and 178 deletions
34
WIFI_FIX_NOTES.md
Normal file
34
WIFI_FIX_NOTES.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# WiFi Initialization Fixes - 2026-01-18
|
||||
|
||||
## Problem
|
||||
Intermittent WiFi connection failures on Raspberry Pi Pico running node1.c
|
||||
- Error: "Failed to connect to WiFi"
|
||||
- Followed by panic: "WiFi initialization failed!"
|
||||
- Issue only occurred sometimes, not consistently
|
||||
|
||||
## Root Causes
|
||||
1. Insufficient startup delay before WiFi initialization
|
||||
2. Watchdog timeout (60s) conflicting with WiFi connection timeout (60s)
|
||||
3. No retry logic if initial connection fails
|
||||
|
||||
## Solution Applied
|
||||
Modified `node1.c` main() function:
|
||||
|
||||
### Change 1: Increase Watchdog Timeout
|
||||
- **Line 157**: `watchdog_enable(60000, 1);` → `watchdog_enable(90000, 1);`
|
||||
- Changed from 60 seconds to 90 seconds
|
||||
- Prevents watchdog from triggering during WiFi connection attempts
|
||||
|
||||
### Change 2: Increase Startup Delay
|
||||
- **Line 158**: `sleep_ms(2000);` → `sleep_ms(5000);`
|
||||
- Changed from 2 seconds to 5 seconds
|
||||
- Gives WiFi module more time to power up before initialization
|
||||
|
||||
## Testing
|
||||
After rebuilding and flashing with these changes, test for stability over multiple boot cycles.
|
||||
|
||||
## Next Steps if Still Unstable
|
||||
1. Add WiFi connection retry logic instead of panic on first failure
|
||||
2. Further increase watchdog timeout to 120s
|
||||
3. Reduce WiFi timeout to 30s with retry attempts
|
||||
4. Check WiFi module power supply stability
|
||||
Loading…
Add table
Add a link
Reference in a new issue