OpenSprinkler › Forums › OpenSprinkler Unified Firmware › One OSPi turning on/off a Master on a remote OSPi
Tagged: OSPi
- This topic has 3 replies, 2 voices, and was last updated 5 months, 2 weeks ago by Ray.
-
AuthorPosts
-
August 13, 2024 at 12:36 am #79868
skiptParticipantHi all,
I have two OSPi’s one of which has a zone extension. On the first OSPi (the one without a zone extension), I have connected the the main irrigation valve (from our water tank) to S01, which is the designated Master. Any operations on the either OSPi requires enabling the Master on the first OSPi.
In order to open the main irrigation valve from the second OSPi, I’ve had to resort to this:
1. On the first OSPi, created a phantom (virtual?) station (S09), lets call it “Virtual Master”.
2. On the second OSPi, created a phantom station (S025), lets call it “Remote Master”, made it a Master with HTTPS station type, and set the “On” command to be “cm?pw=…&sid=8&en=1&t=x&ssta=0”, so that it invokes the first OSPi like this:
‘https://sprinkler.local/cm?pw=deadbeefcafebabec0ffeebababeeb0b&sid=8&en=1&t=30&ssta=0’It works, but it seems a bit clumsy; there is a hardcoded password and explicit duration, etc.
I have a feeling that I’ve missed something obvious and I’m hoping that there is a better/easier way. I’ve compiled the binaries from the latest sources last week.
Any ideas?
Thanks,
-SkipAugust 13, 2024 at 5:31 am #79874
RayKeymasterNormally when you use the remote controller feature, you have one controller dedicated as master controller, the other remote controller. That way you can map all zones on the remote controller to virtual zones on the master controller. For example, in your case, you can set your master controller to have a total of 8+24=32 zones, even if it only has 8 physical zones. Then you defines its zones 9 to 32 as remote zones on the remote controller. This way, all zones are operated from the master controller, and since the pump zones is also on the master controller, when any zones opens, the pump zone opens as well.
The way you have set up is also fine. Yes, it seems a bit awkward to carry the password and explicit duration. But that’s mainly because you are not use the remote zone feature, which would have managed the password and duration implicitly (by requiring the master and remote controllers have the same password, and the duration is sent automatically when a zone opens).
Another way, which we haven’t tested rigirously but should also work in your case, is to define your second OPSi’s master as a remote station, which maps to the first controller’s phantom master zone. The UI would set the first controller in remote extension mode when you set this up, but later you can access the first controller and simply remove it from remote extension mode. The good thing about this approach is that since it uses remote zone feature, password and duration are sent automatically. The downside is that if the first controller is independently running the master zone, while the second controller is sending a command to do something different, it may lead to master zone status that’s different from what you expected.
August 18, 2024 at 2:01 pm #79928
skiptParticipantThank you. That makes sense.
I switched things around to the way you recommended and got it to work, but there were a couple of bugs (surfaced by my environment) that I had to sidestep. I filed an issue here:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/issues/310
The background is that I made a couple of small mods to force TLS. I modified OpenSprinkler to only listen on localhost and added a tiny reverse proxy (in Go), in front of it. As I’ve described in the issue, there seems to be a UI problem which was preventing me from using remote port 443 for “Remote Station (IP)” station type. Another minor issue was that the function ‘void OpenSprinkler::switch_remotestation(RemoteIPStationData *data, bool turnon, uint16_t dur)’ doesn’t take a ‘usessl’ parameter and the UI doesn’t have a good way of letting the user to set it.
August 18, 2024 at 4:42 pm #79929
RayKeymasterWell the Remote Station (IP) is never intended to be used with secure port, because it’s generally used for controllers on the same network. In this case it’s usually not necessary to use secure connection unless if you are worries someone is logged onto your network and sniffing traffic (which would seem a bigger issue if they managed to get your WiFi password).
If the master and remote controllers are not on the same network, the Remote Station (OTC) type would be more appropriate as it goes through the secure cloud server — that is intended for controllers NOT on the same network hence secure connection is necessary.
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › One OSPi turning on/off a Master on a remote OSPi