ruuvi / ruuvi.gateway_esp.c

Ruuvi Gateway ESP32 code
BSD 3-Clause "New" or "Revised" License
24 stars 15 forks source link

UI does not detect gateway reboot when password protection is disabled, and the gateway reboots and reconnects to the network fairly quickly (less than 10 seconds) #1020

Closed TheSomeMan closed 5 months ago

TheSomeMan commented 5 months ago

In this case, an error occurs at the moment of saving the configuration.

If password protection is enabled, then the request to "/status.json" is redirected to "#auth":

I (9693) esp_netif_handlers: eth ip: 192.168.1.127, mask: 255.255.255.0, gw: 192.168.1.1
I (9694) ETH: [sys_evt/20] Ethernet Got IP Address
I (9697) ETH: [sys_evt/20] ~~~~~~~~~~~
I (9701) ETH: [sys_evt/20] ETH:IP:192.168.1.127
I (9707) ETH: [sys_evt/20] ETH:MASK:255.255.255.0
I (9712) ETH: [sys_evt/20] ETH:GW:192.168.1.1
I (9717) ETH: [sys_evt/20] ~~~~~~~~~~~
I (9721) network: [sys_evt/20] ### Ethernet connected
I (9727) wifi_manager: [sys_evt/20] WIFI_MANAGER:EV_STATE: Set WIFI_MANAGER_ETH_CONNECTED_BIT
I (9737) wifi_manager: [sys_evt/20] Set STA IP String to: 192.168.1.127
I (9744) wifi_manager: [sys_evt/20] DHCP IP: 192.168.1.1
I (9756) LEDS: [leds_task/8] LEDS_TASK_SIG_ON_EV_NETWORK_CONNECTED (ready=1)
I (9758) ADV_POST_TASK: [adv_post_task/5] Handle event: NETWORK_CONNECTED
I (9765) ADV_POST_TASK: [adv_post_task/5] Force pending advs1 retransmission
I (9773) ADV_POST_TASK: [adv_post_task/5] Force pending statistics retransmission
I (9781) ruuvi_gateway: [main/1] ### Handle event: NETWORK_CONNECTED
I (9782) TIME: [time_task/1] ### Activate SNTP time synchronization
I (9784) http_server: [http_server/1] Request from 192.168.1.145 to 192.168.1.127 (Host: ruuvigateway9c2c.local): GET /status.json
I (9795) ruuvi_gateway: [main/1] ### Start mDNS: Hostname: "RuuviGateway9C2C", Instance: "RuuviGateway9C2C"
I (9810) http_server: [http_server/1] Response: status 302 (Found), URL=http://ruuvigateway9c2c.local/#auth

If password protection is disabled, then the gateway just answers the request to "/status.json" (but the encryption key for saving configuration is now obsolete):

I (10186) ETH: [sys_evt/20] Ethernet Got IP Address
I (10189) ETH: [sys_evt/20] ~~~~~~~~~~~
I (10193) ETH: [sys_evt/20] ETH:IP:192.168.1.127
I (10199) ETH: [sys_evt/20] ETH:MASK:255.255.255.0
I (10204) ETH: [sys_evt/20] ETH:GW:192.168.1.1
I (10209) ETH: [sys_evt/20] ~~~~~~~~~~~
I (10214) network: [sys_evt/20] ### Ethernet connected
I (10220) wifi_manager: [sys_evt/20] WIFI_MANAGER:EV_STATE: Set WIFI_MANAGER_ETH_CONNECTED_BIT
I (10229) wifi_manager: [sys_evt/20] Set STA IP String to: 192.168.1.127
I (10236) wifi_manager: [sys_evt/20] DHCP IP: 192.168.1.1
I (10244) LEDS: [leds_task/8] LEDS_TASK_SIG_ON_EV_NETWORK_CONNECTED (ready=1)
I (10250) ADV_POST_TASK: [adv_post_task/5] Handle event: NETWORK_CONNECTED
I (10258) ADV_POST_TASK: [adv_post_task/5] Force pending advs1 retransmission
I (10266) ADV_POST_TASK: [adv_post_task/5] Force pending statistics retransmission
I (10274) ruuvi_gateway: [main/1] ### Handle event: NETWORK_CONNECTED
I (10275) TIME: [time_task/1] ### Activate SNTP time synchronization
I (10288) ruuvi_gateway: [main/1] ### Start mDNS: Hostname: "RuuviGateway9C2C", Instance: "RuuviGateway9C2C"
I (10546) http_server: [http_server/1] Request from 192.168.1.145 to 192.168.1.127 (Host: ruuvigateway9c2c.local): GET /status.json
I (10550) network: [http_server/1] callback: cb_on_request_status_json
I (10556) http_server: [http_server/1] Json resp: code=200, content:
{"ssid":null,"ip":"192.168.1.127","netmask":"255.255.255.0","gw":"192.168.1.1","dhcp":"192.168.1.1","urc":0}
markoaamunkajo commented 5 months ago

Config GW to auth without password Open config wizard Try to reboot gateway Should show message that connection is lost

markoaamunkajo commented 5 months ago

QA passed