Solving "wifi:channel=0 is invalid" when using FTM example code by adjusting default channel in WiFiGeneric.h #5809
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using the [FTM examples])https://github.com/espressif/arduino-esp32/tree/master/libraries/WiFi/examples/FTM/) I got an error in the Serial Monitor for FTM_Initiator.ino:
"wifi:channel=0 is invalid"
I solved it for myself by simply passing the channel argument to be 1 in WiFi.initiateFTM. However, a better fix would be to directly change the default channel here.
Summary
channel=0 seems to be invalid for initiateFTM, i.e. we get the error message "wifi:channel=0 is invalid". The proposed fix changes the default channel in initiateFTM from 0 to 1.
Impact
The example codes for FTM will work out of the box ;)