Skip to content

Can't set the "Remote Port" of a "Remote Station (IP)" to 443 #310

@9nut

Description

@9nut

Version: OSPi, git tag is '221(0)'

Background:
I've made a small mod to restrict OpenSprinkler to only advertise on localhost and have a tiny reverse proxy in Go, to provide TLS. Here is the gist of the changes:

https://gist.github.com/9nut/b093efef6ed8eadc4acf712aefe4a1bf

Problem Description:
When I set up a phantom station to be a "Remote Station (IP)" type, and set its "Remote Port" to 443, upon pressing the "Submit" button in the UI, I get a "Unable to reach the remote station" error (but I can manually access it).

In addition, if I press "Continue" and then go back to the setup for the same station, the value shows as 7088. The port value seems to have been left-shifted 4 bits (443==0x1BB, 7088==0x1BB0). I believe this is an issue between the UI and how the value is stored. To verify this, I modified the code to force port 443 and to use usessl==true and the station works properly.

diff --git a/OpenSprinkler.cpp b/OpenSprinkler.cpp
index cdf25ec..96d0266 100644
--- a/OpenSprinkler.cpp
+++ b/OpenSprinkler.cpp
@@ -2116,7 +2116,8 @@ void OpenSprinkler::switch_remotestation(RemoteIPStationData *data, bool turnon,
 
        char server[20];
        snprintf(server, 20, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
-       send_http_request(server, port, p, remote_http_callback);
+       // send_http_request(server, port, p, remote_http_callback);
+       send_http_request(server, 443, p, remote_http_callback,true);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions