Closed whale-av closed 3 weeks ago
I think this is a bug a not a feature request, it's not intended that GPIO depends on Wifi.
Thank you for your reply. Could it be my fault... because I filled in the information for an MQTT broker address? Here is my config file.... in case it is my fault and the config causes the problem: nuki_hub.json.redacted.txt David.
@technyon: multiple GPIO related functions are part of NukiNetwork::update() which are mostly skipped when no mqtt connection is present/enabled. Does this need changing?
@iranl Yes, it's an oversight on my part, will have a look.
Hi,
I've checked and GPIO controls are working when disconnected ... except of course general input/output as those need a connected broker. What exactly do you mean by "connected to a wi-fi network with access point isolation enabled"?
Thank you. I don't know what "general input/output means". My use is just to send a BLE command to open Nuki lock when GPIO 14 is grounded.
I cannot recheck for a while unfortunately, and this reply is too long, but... At first I tested with Nuki-hub connected to my home network.... with many clients connected. The GPIO commands failed when I disconnected Nuki-hub from that network, and restarted the ESP32-S3.
So for testing I tried to connect to an access point with nothing else connected. Unfortunately I had set the access point up for a specific purpose many years ago, and I could no longer access the nuki-hub configuration on that network, and no GPIO. First hurdle..... I had mac address security enabled.... so I disabled that. Still no config access and no gpio. Second hurdle.... that took a while to find... Access point isolation was enabled.
"Access point isolation" allows access for clients to the WAN, but does not allow any communication between clients on the LAN.
Removing Access point isolation allowed access to the config from my laptop and GPIO worked again. That is why I suspected that MQTT is looped back from the gateway if no client is found. GPIO is now working at the remote location with Nuki-hub connected to that access point, but with that access point turned off GPIO will not work. There has never been any web connection for that access point while testing, nor at the remote location.
Sorry for such detail, but it could be important for your analysis. David.
General input-output:
Which Nuki Hub version are you using?
@iranl As far as I can see, NukiNetwork::update() only processes the general input/output functionality of GPIO. Executing lock ations is handled in NukiWrapper / NukiOpenerWrapper, so a MQTT connection shouldn't be required.
Nuki-hub version 9.0 Installed using web tool.
I don't have access at the moment..... I remember GPIO 14 (I have added an additional pull-up circuit) Input: Unlock: When connect to Ground, an unlock command is sent to the lock
@whale-av Let me know when you have access again. Also since it works for me, maybe try flashing the latest binary, maybe something has changed since the 9.0 releases:
https://github.com/technyon/nuki_hub/actions/runs/11426381208
Thank you. I will do that, but it will be more than a week before I return home. David.
I have brought the lock and esp32 home so that I can test. The nuki hub is updated to 9.01. I have reduced the configuration as far as possible, but the problem persists. I have attached the setup as reported when clicking the version number in the web interface. Thank you again for your help.. setup.txt
Logs from Nuki hub via webtool......
It seems that the "Restart ESP32 on network disconnect enabled: No" config setting is ignored.
wi-fi not present... so no GPIO as ESP32 reboots continuously after autoconnect timeout...
AND wi-fi present... so GPIO working as boot completes..
I've worked on this in #508.
You should be able to enable "Disable network if no connection within 60 seconds" from the http://nukihubip/advanced page (this page has no menu entry, you need to input it in your browser).
With this feature enabled the device should attempt to setup a network connection for 60 seconds. If it fails it reboots and disables all network features untill the next reboot (which can only be done by removing the power with the network disabled)
Thank you. I updated to 9.02 and did see the advanced menu, but did not see the "Disable network if no connection within 60 seconds" entry. The main page still declared 9.01 so I assumed the update had failed, but now having returned to the web-tool installed 9.01 I know that it had installed because the "advanced" page is gone.. So I tried to update again to 9.02 and lost all contact with the ESP32 on the network. Back to 9.01 for now and maybe I should wait a while before trying again.
PR #508 is not merged yet and thus not in any beta or nightly
I have OTA'd to 9.02 Beta3 Updater build: 11693590688.16.1 and ticked the "Disable network if no connection within 60 seconds" box in the /advanced menu. After a reboot GPIO does now work after 60 seconds when no network is available, and Nuki-Hub will connect again to the network after a power cycle. Thank you all... I will soak test before putting the hardware to serious use, but I cannot think of any reason that your solution will fail.
I was fooled for a while into thinking that it would not reconnect after a power cycle, as I had been using internet explorer to view the webpage, and that no longer worked. Firefox works fine with the new server page.
Good to hear!
PROBLEM DESCRIPTION
A clear and concise description of what the problem is. GPIO control of the Nuki Lock only works when Nuki-hub is connected to a Wi-Fi Network. I would like the feature to work when Nuki-hub is not connected to a network.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!