Skip to content

[High] WLAN pairing PIN default mismatch (gamepad key 0000 vs dongle HOJA_WLAN_1234) #18

Description

@cursor

Severity

High — wireless dongle pairing broken on fresh / reset configs

Location

library/HOJA-LIB-RP2040 (submodule)

  • Gamepad default: src/utilities/settings.c (~L92–93) sets wlan_dongle_key = 0 → SSID HOJA_WLAN_0000
  • Gamepad join: src/hal/rp2040/wlan_hal.c (~L117–118) uses gamepad_config->wlan_dongle_key
  • Dongle host AP: external/HOJA-LIB-DONGLE/dongle_host.c (~L333–344) ignores cfg->pin and always brings up DONGLE_DEFAULT_WLAN_SSID / DONGLE_DEFAULT_WLAN_PASSWORD (HOJA_WLAN_1234 / HOJA_1234)

Summary

On gamepad config version reset, WLAN key defaults to 0. The dongle host intentionally advertises the fixed 1234 defaults and does not use the configured pin. Fresh devices (or after a config version bump) will not associate with a default-PIN dongle until the user manually sets key 1234.

Comment in dongle_host.c says the gamepad pairs on the default, but the gamepad default is 0000, not 1234.

Impact

Out-of-box / after-reset WLAN dongle pairing fails until the user discovers and sets PIN 1234. Default credentials are also weak if left unchanged.

Suggested fix

Default wlan_dongle_key to 1234 to match DONGLE_DEFAULT_WLAN_*, and/or make dongle host AP use cfg->pin when provided.

Found by

Automated code review (Cursor cloud agent)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions