Changelog
1.2.0
- Added: wifi-hal contract 1.2 (
"provide": {"php-baremetal/wifi-hal": "1.2.0"}):bm_wifi_hal_sta_set_power_save()sets the station's power save withesp_wifi_set_ps()(NONE:WIFI_PS_NONE,MIN:WIFI_PS_MIN_MODEM,MAX:WIFI_PS_MAX_MODEM), at once and for the following connects. A mode already set does not reach the driver again; a mode the driver refuses (NONEwhile Bluetooth shares the radio) returns false and leaves the previous one. Nothing changes until the first call: the ESP-IDF default,WIFI_PS_MIN_MODEM, stays.
1.1.0
- Added: wifi-hal contract 1.1 (
"provide": {"php-baremetal/wifi-hal": "1.1.0"}). One listener hears the station, scan and access point events (bm_wifi_hal_set_listener()), always from the default event loop task, one at a time and in order. - Added:
bm_wifi_hal_sta_connect_ex(): a connect that waits for the address or returns at once, with its own number of automatic retries (-1retries forever). The outcome comes as an address or a give-up; a waiting connect that times out gives up with reasonOTHER. - Added: disconnect reasons mapped from the ESP-IDF codes (wrong password, network not found, connection
lost, asked for, other), with the raw code kept. A password refusal (202, 15, 204; not
AUTH_EXPIRE, 2) counts as wrong only until the connect has had an address; after that the same codes mean the connection was lost. Two refusals in a row give up at once withWRONG_PASSWORD, whatever the number of retries (-1included); a single refusal is retried like any other reason, and any other reason starts the count again. Once the station was associated, every end not asked for that is not a counted refusal isLOST(a hotspot switched off deauthenticates with code 3). - Added: an optional log line (
ESP_LOGI) with the default event loop task's stack high-water mark after the firstSCAN_DONEand the firstSTA_GOT_IP, on when the build definesBM_WIFI_HAL_LOG_EVT_STACKto 1 (off by default). Measured on the board: 1416 to 1592 bytes free of the 2304-byte stack. - Added: the access point events follow the script's calls. Switching the station on while the access point
is up (AP to APSTA) makes ESP-IDF stop and restart the access point internally; that raises no
AP_STOPPED/AP_STARTEDand keeps the client count.AP_STOPPEDcomes only afterbm_wifi_hal_ap_stop(), and everybm_wifi_hal_ap_start()gives oneAP_STARTED, also when it replaces the settings of an access point already up. Settings refused for an access point already up leave it running with the old ones (it used to be stopped). - Added:
bm_wifi_hal_scan_start()andbm_wifi_hal_scan_results(), a scan that does not block (up to 48 results kept);bm_wifi_hal_scan()now runs on top of them. - Added:
bm_wifi_hal_sta_ssid()andbm_wifi_hal_ap_active(). - Changed:
bm_wifi_hal_ap_clients()counts the stations from the driver's join and leave events, so it matches the counts the events carry. - Changed: losing the address while associated (
IP_EVENT_STA_LOST_IP) now clears it, sobm_wifi_hal_sta_connected()returns false until a new address arrives.
1.0.2
- Fixed: a 32-byte SSID (and a 64-digit PSK) was cut by one byte, so the network could not be joined or the access point had the wrong name.
- Fixed: the automatic reconnects after a drop used what the first connect had left of its 10 retries. The count now starts again at every address the station gets, and stops for good after a disconnect or a connect timeout (an address that arrived late no longer turns the retries back on).
- Fixed: the driver wrote SSIDs and passwords, in clear, to the
nvspartition. It now keeps them in RAM (WIFI_STORAGE_RAM). Entries written by earlier versions stay until thenvspartition is erased.
1.0.1
- Changed: the author's contact email.
- Docs: projects use
"sdk": "esp32@^2.0".
1.0.0
Initial release.