Skip to main content

! Join a Wi‑Fi network (device.join_wifi)

Declaration

ok, err = device.join_wifi(SSID, password[, timeout_ms])

Parameters

  • SSID
    String. Wi‑Fi SSID (name)
  • password
    String. Wi‑Fi password
  • timeout_ms
    Integer, optional. Timeout in milliseconds. Default 10000

Returns

  • ok
    Boolean. true if operation succeeded; otherwise false
  • err
    String. Error message when operation failed

Notes

This function becomes synchronous in versions after 20250317

Example

local ok, err = device.join_wifi('Tenda_9B3F', '12345678')