kike-canaries / canairio_firmware

CanAirIO is a citizen science initiative. We are developing a mobile application that is able to set a PM2.5 or CO2 sensors, and other related sensors, as a fixed station using WiFi or mobile station with an smartphone by using a Bluetooth connection.
https://canair.io
GNU General Public License v3.0
104 stars 23 forks source link

Disconnecting and removing wifi AP does not work via CLI ( Chrome) #269

Open Geelhem opened 11 months ago

Geelhem commented 11 months ago

Overview

I have the board connecting to wifi but I want to remove AP and add a new one the commands are accepted but list of neworks is not updated.

I have scan and attenmpted to leave MG1.0 to MG2.0 password is saved but board does not attemot to connect to it

Debug output

= CanAirIO Setup ==

-->[POWR] CPU Speed: 240 MHz -->[OGUI] display config ready.

SerialTerm v1.1.2 (C) 2022, MikO - Hpsaturn available commands:

-->[BATT] ADC eFuse Vref:1093 mV -->[INFO] ESP32MAC : B0:B2:1C:0A:FC:56 -->[INFO] Hostname : CanAirIOC56 -->[INFO] Revision : r951 -->[INFO] Firmware : 0.5.8 -->[INFO] Flavor : ESP32DEVKIT -->[INFO] Target : prod -->[INFO] == Detecting Sensors == -->[INFO] Sensorslib version : 0.6.7 -->[INFO] enable sensor GPIO : 27 -->[INFO] config UART sensor : SPS30 -->[SLIB] temperature offset : 0.00 -->[SLIB] altitude offset : 0.00 -->[SLIB] sea level pressure : 1013.25 hPa -->[SLIB] only i2c sensors : true -->[SLIB] sensor registered : SPS30 :D -->[SLIB] sensor registered : AM232X :D -->[SLIB] Sensors i2c count : 2 (SPS30,AM232X,) -->[INFO] Sensors detected : 2 -->[INFO] registering units : -->[INFO] restored saved unit : PM2.5 -->[SLIB] Sensors units count : 6 (PM1,PM2.5,PM4,PM10,T,H,) -->[WDOG] watchdog check each : 120 seconds. -->[WIFI] connecting to wifi : MG1.0...............................fail! [E][WIFI] disconnected! -->[INFO] InfluxDb cloud : enabled -->[INFO] WiFi current config : enabled -->[BTLE] Bluetooth GATT : ready for config client! -->[INFO] sensors units count : 6 -->[INFO] show unit selected : PM2.5 -->[HEAP] sizeof sensors : 0996b -->[HEAP] sizeof config : 0296b -->[HEAP] sizeof GUI : 0292b

==>[INFO] Setup End. CLI enable. Press ENTER ===

help        show detail usage information
setSSID     set the Wifi SSID
setPASW     set the WiFi password
connect     save and connect to WiFi network
list        list saved WiFi networks
select      select the default AP (default: last)
mode        set the default operation single/multi AP (slow)
scan        scan WiFi networks
status      WiFi status information
disconnect  WiFi disconnect
delete      remove saved WiFi network by SSID

reboot      perform a ESP32 reboot
clear       factory settings reset. (needs confirmation)
debug       enable debug mode
stime       set the sample time (seconds)
spins       set the UART pins TX RX
stype       set the sensor type (UART)
sgeoh       set geohash. Type help for more details.
kset        set preference key (e.g on/off or 1/0 or text)
klist       list valid preference keys
info        get device information
exit        exit of the setup mode. AUTO EXIT in 10 seg! :)
setup       TYPE THIS WORD to enter to SAFE MODE setup

Disconnecting...

done. -->[WIFI] device network IP : 192.168.2.106 -->[WIFI] publish interval : 10 sec.

scan done: 5 networks found

01 [][-59][MG1.0] 02 [][-59][MG2.0] 03 [][-75][TNCAP4E7DF1] 04 [][-79][NETGEAR34] 05 [*][-87][Penguin Palace]

st> -->[FOTA] remote OTA update : not need update -->[IFDB] influxdb.canair.io : connected!

WiFi is already connected

st> -->[MQTT] 192.168.2.23 : connected! -->[MQTT] HA device registered : CanAirIOC56 -->[MQTT] incoming msg: homeassistant/status - offline -->[MQTT] incoming msg: homeassistant/status - offline mode multi

Disconnecting...

st> -->[WIFI] connecting to wifi : MG1.0.. done. -->[WIFI] device network IP : 192.168.2.106 -->[WIFI] publish interval : 10 sec. -->[FOTA] remote OTA update : not need update [E][MQTT] Anaire publish error : -3 -->[MQTT] 192.168.2.23 : connected! -->[MQTT] incoming msg: homeassistant/status - offline

Deleting network [key_net01][MG1.0]

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline

WiFi SSID : [MG1.0] IP address : 192.168.2.106 RSSI signal : -60 MAC Address : B0:B2:1C:0A:FC:54 Hostname : esp32-0AFC54

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline

sdfgsdf: command not found

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline

set ssid to: MG2.0

set password to: Philipp1

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline

scan done: 5 networks found

01 [][-60][MG2.0] 02 [][-60][MG1.0] 03 [][-73][TNCAP4E7DF1] 04 [][-80][NETGEAR34] 05 [*][-88][Penguin Palace]

WiFi SSID : [MG1.0] IP address : 192.168.2.106 RSSI signal : -61 MAC Address : B0:B2:1C:0A:FC:54 Hostname : esp32-0AFC54

Disconnecting... -->[WIFI] connecting to wifi : MG1.0. Connecting in MultiAP mode...........connected!

st> done. -->[WIFI] device network IP : 192.168.2.106 -->[WIFI] publish interval : 10 sec. -->[FOTA] remote OTA update : not need update [E][MQTT] Anaire publish error : -3 -->[MQTT] 192.168.2.23 : connected! -->[MQTT] incoming msg: homeassistant/status - offline

WiFi SSID : [MG1.0] IP address : 192.168.2.106 RSSI signal : -61 MAC Address : B0:B2:1C:0A:FC:54 Hostname : esp32-0AFC54

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline

Network not found

Saved networks:

(*) 1: [MG1.0]

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline

Disconnecting...

Connecting in MultiAP mode..-->[WIFI] connecting to wifi : MG1.0...connected!

st> done. -->[WIFI] device network IP : 192.168.2.106 -->[WIFI] publish interval : 10 sec. -->[FOTA] remote OTA update : not need update -->[MQTT] 192.168.2.23 : connected!

WiFi SSID : [MG1.0] IP address : 192.168.2.106 RSSI signal : -60 MAC Address : B0:B2:1C:0A:FC:54 Hostname : esp32-0AFC54

Deleting network [key_net01][MG1.0]

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline -->[WDOG] Watchdog reached, rebooting..

== CanAirIO Setup ==

-->[POWR] CPU Speed: 240 MHz -->[OGUI] display config ready.

SerialTerm v1.1.2 (C) 2022, MikO - Hpsaturn available commands:

-->[BATT] ADC eFuse Vref:1093 mV -->[INFO] ESP32MAC : B0:B2:1C:0A:FC:56 -->[INFO] Hostname : CanAirIOC56 -->[INFO] Revision : r951 -->[INFO] Firmware : 0.5.8 -->[INFO] Flavor : ESP32DEVKIT -->[INFO] Target : prod -->[INFO] == Detecting Sensors == -->[INFO] Sensorslib version : 0.6.7 -->[INFO] enable sensor GPIO : 27 -->[INFO] config UART sensor : SPS30 -->[SLIB] temperature offset : 0.00 -->[SLIB] altitude offset : 0.00 -->[SLIB] sea level pressure : 1013.25 hPa -->[SLIB] only i2c sensors : true -->[SLIB] sensor registered : SPS30 :D -->[SLIB] sensor registered : AM232X :D -->[SLIB] Sensors i2c count : 2 (SPS30,AM232X,) -->[INFO] Sensors detected : 2 -->[INFO] registering units : -->[INFO] restored saved unit : PM2.5 -->[SLIB] Sensors units count : 6 (PM1,PM2.5,PM4,PM10,T,H,) -->[WDOG] watchdog check each : 120 seconds. -->[WIFI] connecting to wifi : MG1.0... done. -->[WIFI] device network IP : 192.168.2.106 -->[WIFI] publish interval : 10 sec. -->[FOTA] remote OTA update : not need update -->[MQTT] 192.168.2.23 : connected! -->[IFDB] influxdb.canair.io : connected! -->[INFO] InfluxDb cloud : enabled -->[INFO] WiFi current config : enabled -->[BTLE] Bluetooth GATT : ready for config client! -->[INFO] sensors units count : 6 -->[INFO] show unit selected : PM2.5 -->[HEAP] sizeof sensors : 0996b -->[HEAP] sizeof config : 0296b -->[HEAP] sizeof GUI : 0292b

==>[INFO] Setup End. CLI enable. Press ENTER ===

help        show detail usage information
setSSID     set the Wifi SSID
setPASW     set the WiFi password
connect     save and connect to WiFi network
list        list saved WiFi networks
select      select the default AP (default: last)
mode        set the default operation single/multi AP (slow)
scan        scan WiFi networks
status      WiFi status information
disconnect  WiFi disconnect
delete      remove saved WiFi network by SSID

reboot      perform a ESP32 reboot
clear       factory settings reset. (needs confirmation)
debug       enable debug mode
stime       set the sample time (seconds)
spins       set the UART pins TX RX
stype       set the sensor type (UART)
sgeoh       set geohash. Type help for more details.
kset        set preference key (e.g on/off or 1/0 or text)
klist       list valid preference keys
info        get device information
exit        exit of the setup mode. AUTO EXIT in 10 seg! :)
setup       TYPE THIS WORD to enter to SAFE MODE setup

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] HA device registered : CanAirIOC56 -->[MQTT] 192.168.2.23 : connected!

Disconnecting...

st> -->[WIFI] connecting to wifi : MG1.0.. done. -->[WIFI] device network IP : 192.168.2.106 -->[WIFI] publish interval : 10 sec. -->[FOTA] remote OTA update : not need update -->[MQTT] 192.168.2.23 : connected! [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline

SSID is empty, please set a valid SSID into quotes

Deleting network [key_net01][MG1.0]

WiFi SSID : [MG1.0] IP address : 192.168.2.106 RSSI signal : -60 MAC Address : B0:B2:1C:0A:FC:54 Hostname : esp32-0AFC54

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline

Saved networks:

set ssid to: MG2.0

st> [E][MQTT] Anaire publish error : -3 [E][MQTT] status subscription error : -9 -->[MQTT] 192.168.2.23 : connected!

set password to: Philipp1

WiFi SSID : [MG1.0] IP address : 192.168.2.106 RSSI signal : -59 MAC Address : B0:B2:1C:0A:FC:54 Hostname : esp32-0AFC54

st> [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline [E][MQTT] Anaire publish error : -3 -->[MQTT] incoming msg: homeassistant/status - offline

scan done: 5 networks found

01 [][-57][MG1.0] 02 [][-57][MG2.0] 03 [][-72][TNCAP4E7DF1] 04 [][-77][NETGEAR34] 05 [*][-85][Penguin Palace]

Disconnecting...

Connecting in MultiAP mode..-->[WIFI] connecting to wifi : MG1.0..........fail! [E][WIFI] disconnected! -->[WIFI] connecting to wifi : MG1.0......................connection failed!

Saved networks:

st> .................fail! [E][WIFI] disconnected! -->[WIFI] connecting to wifi : MG1.0.. done. -->[WIFI] device network IP : 192.168.2.106 -->[WIFI] publish interval : 10 sec. -->[FOTA] remote OTA update : not need update [E][MQTT] Anaire publish error : -3 -->[MQTT] 192.168.2.23 : connected! -->[MQTT] incoming msg: homeassistant/status - offline [E][MQTT] Anaire publish error : -3 -->[MQTT] 192.168.2.23 : connected! Terminal disconnected: NetworkError: The device has been lost.

Device config

If apply, please write the next information, you can have it on the settings section Device info on the CanAirIO app.

board: please choose any  ESP32DevKit, and similar behaviour on M5stick+
firmware version : Latest stable
mobile app version: revxxx
sensors: I2C SPS30
OLED: yes
Power: USB
hpsaturn commented 10 months ago

tip: to work with the CLI without debug messages, first disable the debug mode with debug 0

hpsaturn commented 10 months ago

Maibe it is a duplicated ticket: https://github.com/kike-canaries/canairio_firmware/issues/250

Please let me know if is the same behavior. I'm trying to understand what happen with this old issue.