igorgladkov / rotini

Project Rotini (alpha)
44 stars 0 forks source link

Local / remote access not working correctly #148

Open qfluxlab opened 8 years ago

qfluxlab commented 8 years ago

I know this was marked fixed in #125, but I still have the issue. Running OH2 with app version 0.13.78. My local OH server is in 192.168.20.x, and my office network is 192.168.10.x. The app always forces local access instead of remote when I'm at work. If I disable wifi, remote access works fine.

qfluxlab commented 8 years ago

I should add that I'm using my.openhab as remote option.

derkens commented 8 years ago

I'm curious how the switching works... This morning my.openhab.org was down. I have two wifi accesspoints in my house, they have the same ssid and are on the same network. Only difference is ip address of the ap itself and obviously the mac address. Downstairs (where I did the initial setup) i have local access. Upstairs, i'm switched to remote access (wich is through my.openhab.org) Also on vpn to my home, I expect to have local access through the tunnel, but I'm still connected via remote. Wich basicly was only problematic this morning.

igorgladkov commented 8 years ago

@derkens Local network detected by access point MAC address, so that would explain that. Next release will actually show that information in the help section (@dynostatic can you also check that after the release). I think the feature need to be expanded to accommodate your case as well.

qfluxlab commented 8 years ago

@igorgladkov The new diagnostic info is useful. The connectivity issues have been better over the last few days, and I think I see why now. The app shows my "local" MAC to be that of my girlfriend's router, but there isn't an OH instance running on that network. I've used the app there on wifi to monitor my house remotely, but that's it.

I guess with the app thinking her network is "home", everywhere else (including my actual home) is connecting with remote settings. I did notice the app seemed sluggish at home lately, which makes sense if it's not local access.

How is the app determining the local network association? I was curious how HABdroid handles this, and it does the following: Check android connectivity manager for mobile network or wifi/ethernet. If mobile, then use remote settings. If wifi, then attempt test connection to openhab. If openhab connection success, then use local settings, else use remote settings.

igorgladkov commented 8 years ago

@dynostatic I think I see what the issue is: after initial release of the feature, the app would save local access point on first successful connection to the server, but since you were on another wifi at that point it thought it is local connection (I missed the condition to check if local config is used). The local access point will be reset every time you got through setup, so that would be a way to fix that.

qfluxlab commented 8 years ago

@igorgladkov All is good now. I ran setup from my home network, and now the correct access point is saved. I can definitely see the need to support @derkens use case with range extenders and/or multiple access points being fairly common.