freedomotic / fd-vue-webapp

A Vue.js web application for Freedomotic Open IoT framework
http://fd-vue-webapp.herokuapp.com/
GNU Affero General Public License v3.0
65 stars 66 forks source link

unable to access webapp client from mobile #135

Closed amenak77 closed 6 years ago

amenak77 commented 6 years ago

test_newclient4

After compiling webapp client's project and replacing default polymer client with it into webserver plugin, webapp is correctly found at [server IP address]:8090 address; if you try to access from a pc or notebook within the LAN there is no problem. If you try from a smartphone you have a rightful login panel which deny access even if you enter right data. Ping is sent and received correctly; this probably means an auth problem more than a connection one. Mobile problem only.

mcicolella commented 6 years ago

Is the pc or the notebook the same which FD is running on when it works?

amenak77 commented 6 years ago

Yes, when it works, it is the same notebook and the call is made through localhost; I haven't tried access to freedomotic via webapp from another LAN pc; I'll try ASAP; however, I downloaded firefox mobile app and used it to access freedomotic and I have same bad login message

amenak77 commented 6 years ago

Hi all, I tried to access freedomotic from another LAN computer thriught webapp client; first step is OK: you digit in browswer (chrome) navbar 192.168.1.58:8090 and apperas vue login; then if you enter Fd notebook ip address into server address field, 9111 in server port field plus ususal admin/admin you have THE SAME BAD LOGIN INFORMATION warning; so I think we can change the issue in "unable to access webapp client from another LAN device". PS using localhost (obviously) same failure. Sometimes...

amenak77 commented 6 years ago

Ever and ever strange; if you access freedomotic from the same LAN device, access is granted whatever charachter you digit into the first thwo form fields (server address and server port) if you correcly insert admin/admin; otherwise access is denied. The last issue definition should be "errors with auth LAN token ring" I suppose

mcicolella commented 6 years ago

The problem is here. RestAPI url is set statically.

amenak77 commented 6 years ago

Excuse me, but I don't understand; why is this a problem?

mcicolella commented 6 years ago

Because it points always to 'localhost'. If the client is on the same machine running FD all is OK. When you connect from another device (a smartphone for example) the app searches RestAPI on the 'localhost' that isn't the PC where the plugin is running but the client itself. So it doesn't find the API. Hope it's clear.

amenak77 commented 6 years ago

Perfectly clear, thank you; so we can get rid of this annoying bug soon ;)

mcicolella commented 6 years ago

Just updated the app. The issue should be fixed. I removed server ip and port number because the first is automatically detected from the URL and the last is set statically on the RestAPI. Less parameters for users :) Please check. N.D. remember to delete the browser history

amenak77 commented 6 years ago

Great! I'll check ASAP and obviously I'll let you know ;)

amenak77 commented 6 years ago

First of all, just to make my point clear: fantastic work! Great Mauro and great Ubaldo. All works very well; the webapp has a great level and personally, command my home lights without install or configure anything. Autodiscovery at its maximum extent; even ip address and restapi port don't reqire any configuration. UI is set automatically depending on type of device you have. Fantastic. We can close the issue

mcicolella commented 6 years ago

Fixed in 66765a1dbd967480b73e376f4acbd11be6d776b1