Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote Access #156

Closed
jkiape opened this issue Mar 5, 2017 · 7 comments
Closed

Remote Access #156

jkiape opened this issue Mar 5, 2017 · 7 comments
Labels
help needed Action - Asking for help from the community

Comments

@jkiape
Copy link

jkiape commented Mar 5, 2017

Trying to gain remote access to sonoff I made a port forward to sonoff's local ip port 80.
When I am trying to connect from outside, the web server redirects to local ip.
Any ideas ?

@jkiape jkiape closed this as completed Mar 5, 2017
@jkiape jkiape reopened this Mar 5, 2017
@arendst arendst added the help needed Action - Asking for help from the community label Mar 5, 2017
@legotheboss
Copy link

I don't know if I would recommend this. If you want remote access, I would suggest using a public MQTT broker and conveying commands via that. Make sure you use strong credentials to prevent others from maliciously using your sonoff.

@jkiape
Copy link
Author

jkiape commented Mar 6, 2017

I'm aware of this process and I can do it relatively safe through Raspeverry pi (and port forward) that I have.

Thank's

@splodgemcroo
Copy link

I had the same problem, and tracked the issue down to the fact that the webserver component has a captive portal function (presumably to help with configuring the sonoff if it's in AP mode? not sure as I haven't used it in that way).

In order to disable redirecting to the local IP, i edited the webserver.ino file, found the captivePortal() function, and commented out the whole if (!isIp(webServer->hostHeader())) block so that the function always returns false.

Hopefully I've explained that ok - let me know if not, and I'll try and elaborate.

@jkiape
Copy link
Author

jkiape commented Mar 8, 2017

It works!
Thank you very much

@arendst
Copy link
Owner

arendst commented Mar 8, 2017

Could you check if changing line 1358 in file webserver.ino from

  if (!isIp(webServer->hostHeader())) {

to

  if ((_httpflag == HTTP_MANAGER) && !isIp(webServer->hostHeader())) {

also solves your problem please?

arendst added a commit that referenced this issue Mar 8, 2017
4.0.2 20170308
* Restore correct seriallog level after Serial logging was disabled
* Add simple dimmer slider to Sonoff Led web page
* Reduced root webpage size by 31%
* Expand Status 2 with Build date/time and core version
* Fix webserver redirection when not in WifiManager mode (#156)
* Add command ButtonRestrict On/Off to restrict access to button hold
and button multi press options above 2 (#161)
* Fix DS18S20 negative temperature readings (#165)
* Fix crlf compilation error due to bad syntax (#144, #167)
@jkiape
Copy link
Author

jkiape commented Mar 8, 2017

also solves your problem please?
Yes it does !

@arendst arendst closed this as completed Mar 8, 2017
@gabryk91
Copy link

gabryk91 commented Apr 21, 2018

@arendst I'm also trying to connect to my tasmota from outside, I did all the necessary configuration on my router from an x port to port 80 of the tasmota, but I can't see the web server, I had searched in the webserver.ino for the suggested lines, but I can't find those (I guess they were changed in recent updates). Can you provide me some direction to solve this problem? I understand the warning about opening the tasmota to the outside world, but still I want to do it with all the precautions, thanks

edit: if I would edit the webserver.ino as suggested by @splodgemcroo how can I send it to tasmota then?

curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
4.0.2 20170308
* Restore correct seriallog level after Serial logging was disabled
* Add simple dimmer slider to Sonoff Led web page
* Reduced root webpage size by 31%
* Expand Status 2 with Build date/time and core version
* Fix webserver redirection when not in WifiManager mode (arendst#156)
* Add command ButtonRestrict On/Off to restrict access to button hold
and button multi press options above 2 (arendst#161)
* Fix DS18S20 negative temperature readings (arendst#165)
* Fix crlf compilation error due to bad syntax (arendst#144, arendst#167)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help needed Action - Asking for help from the community
Projects
None yet
Development

No branches or pull requests

5 participants