ESP v3 EEPROM

I’m new to OSP/ESP8266 v3 and really enjoying digging into it, WOW some really great idea. Of course I’m tinkering and looking to possibly extend it slightly.
One area of concern is on upgrade (OTA) seems it looses its config, including networking.
I’ve not dug through the OTA yet to see all of its limitations, and the process.
If it could have its network/pwd + OTC key persistent – seems to me that everything else could be restored after an upgrade. Maybe I’m too hopeful!
Looking at the EEPROM on v3 hw, I’m wondering what the thinking is for the 256 bytes – and if the plan is to be able to use it through OTA?
many thanks for any insights.

2.3.0(4) API commands. Not able to use commands like cm for manual turn on

I have installed 2.3.3 (that I built and run via docker) on RPI.

All is working fine.

I want to control OS either via the API or MQTT.

The only docs for the API I can find are these.

https://raysfiles.com/os_compiled_firmware/docs/2.2.0/OSAPI2.2.0(1).pdf

if I try

curl https://my.url.net/ja

it spits back all the system info so I know that the API is working BUT.

If I try to then control the unit for example trying a manual

`
12. Manual Station Run (previously manual override) [Keyword /cm]
/cm?pw=xxx&sid=xx&en=x&t=xxx&ssta=x
Parameters:
● sid: Station index (starting from 0)
● en: Enable bit (1: open the selected station; 0: close the selected station).
● t: Timer (in seconds). Acceptable range is 0 to 64800 (18 hours). The timer value must be provided if opening a station.
● ssta: shift remaining stations in the same sequential group
`

I get a reply but then the station is not turned on. (i.e. the command is ignored)

curl https://my.url.net/cm?pw=xxx&sid=1&en=1&t=10
[4] 3583987
[5] 3583988
[6] 3583989
[3] Done curl https://my.url.net/cm?pw=xxx
[5]- Done sid=1
[6]+ Done en=1
$ {“result”:16}

`

can someone give me advice on how to get the API to actually run the command thx and where is any updated api docs. And what are the result codes. If only I knew what 16 meant.

note I am using https as I am using a reverse proxy. I don’t think this is an issue as the jp commands works fine.

Also if you know how to control OS with MQTT topics then can you provide some info or any documentation on what topic and payload might be the same as say the cm API commmand.

Auto rain delay doesn’t appear to be working

Hi everyone,

I’ve got my OpenSprinkler set to auto rain delay and the weather forecast says it’s supposed to rain tomorrow and the day after but no rain delay has been initiated. My understanding is that if any rain is detected to occur within 24 hours, then a rain delay is supposed to be activated?

Flow input measurement problem

My System – OpenSprinkler Unified Firmware (latest version) Buster on Raspberry Pi Zero 2W connected via wifi to my network.
I’m controlling the sprinkler valves using a simple custom pcb using the GPIO pins to control the valves.

Flow control measurement problem
While tracking down inaccurate flow rate measurements that occurred when the flow rate input exceeded 8hz I discovered a 50ms delay in the main.cpp do_loop that limited the polling capability of the flow input signal.

Using strace I discovered a 50ms delay caused by tv_usec. Tracking down tv_usec lead me to this etherport.cpp function:

// This function blocks until we get a client connected.
// It will timeout after 50ms and return a blank client.
// If it succeeds it will return an EthernetClient.
EthernetClient EthernetServer::available()
{
fd_set sock_set;
FD_ZERO(&sock_set);
FD_SET(m_sock, &sock_set);
struct timeval timeout;
timeout.tv_sec = 0;
timeout.tv_usec = 50 * 1000; // 50ms

So, my question is why is this function being continuously executed each time through the do_loop?

How create a “parallel” overlay switching system …

Hello users. Newbie here.

Several years ago I installed a drip system in my large back yard using 8 valves and a different brand of timer and app. It basically worked, but I didn’t like the interface and eventually ignored/forgot the system because I’m always out there anyway and I started just setting a hose with a mechanical timer on each faucet (I have several of these around the yard now.) But it won’t accommodate my leaving on vacation, so now I want to “modernize” my system without losing the benefits of my “manual” system. I just purchased an OpenSprinkler timer (haven’t installed it yet, Order #79182), but I’m pretty handy and want to simultaneously add a “parallel” system for casual walk-up use. I say “parallel” because it would exist independently of my OpenSprinkler controller, but in the same outdoor case and using the same 24Vac always-plugged-in power source and same zone valves. Let me explain.

First I want simple on-off switches for each zone, so I could walk up, after noticing a zone that needs more water, flip a switch, putter around in another part of the garden for five or ten minutes, and then come flip it off. This seems easy – just a toggle switch (for each zone) between the main power and each valve. I’m not a hardware hacker, but I can do that.

The part I *don’t* know how to do is add a similar *mini timer* (either dial or push-button-to-increment) for each zone to start and run immediately and for only that long. My problem is choosing a not-too-expensive timer switch for this purpose (again, separate from my OpenSprinkler timer, “overlaid” onto the same valve hardware).

Ideally, there exists a mini pcb that can switch 24Vac for a varying amount of time, perhaps by dialing a trimpot or just pressing a mini button that would add increments (of perhaps five minutes each press). I wanted to see if any of you people had an idea for this. I’m willing to spend a bit to get this “overlay” parallel system, but am looking for a clever, easily wire-able solution (doesn’t involve programming, allows walk-up minimal-interaction use). Thanks for even reading this. Any ideas?

-Craig in Fairfield CA

Create program with API

Hi,
Hope someone will understand my question 🙂
I’m trying to create programs through API.
I’m following API documentation https://raysfiles.com/os_compiled_firmware/docs/2.2.0/OSAPI2.2.0(1).pdf
I’m having trouble with the bit encoding, page 6, part 14 (14. Get Program Data [Keyword /jp])

If I understand well the “flag” element contains binary values. But I can’t figure how to convert it.
For example a program that is enabled, that dont use weather adjustment, no restrictions, use weekdays, no repetitions, no date range should be encoded at bit level as : “10000000” – if I understand the documentation.
When I get my program data through API (opensprinklerIP/jp?pw=xxx) for such a program the flag is “1”.
How a bit sequence “10000000” is converted to “1” ?
When I use online converters, (https://www.rapidtables.com/convert/number/binary-to-octal.html) the binary 10000000 is converted to octal value 200, not 1.
I’m stuck at that point.
Thanks, have a good day !

Any Home Assistant Users uploading programs?

I’m working to migrate from my custom OS integration to the HA one. I calculate eto daily, which generates a program string [x,x,x,x],[y,y,y,y,y] where x are the start times and y the station run times. I’ve got the logic figured out through the HA web api on how to load up the start times and durations — however I can’t figure out how to disable a start time. So one day I might have [210,400,-1,-1], [1,2,3,4] and the program would run at 210 and 400 minutes after midnight. The next day might be [300,-1,-1,-1],[1,2,3,4], so only run the program once 300 mintues after midnight. The HA integration start times are numbers, so they don’t accept a -1 value. If I write a 0, I _think_ it will run at midnight.

Just wondering if anyone else came across this and have any suggestions or advice?

Feature Request: NTP by hostname and not IP

It would be nice to be able to use an NTP hostname instead of strict IP address (for what I hope are obvious reasons).
This would allow the use of NTP hostnames such as us.pool.ntp.org (tho I wouldn’t be opposed to being able to use pool.ntp.org).
See here for more info: https://www.ntppool.org/zone/us

Thanks!

./s4z

Water level in master/remote configuration

I recently purchased my second OS system for the new greenhouse. It’s set up as a remote, stations 9-16. I’d like to understand how Water Level is applied in this configuration. When I edit a program, all stations are listed as a group with “Use Weather Adjustment”.

Since 8 valves are in the greenhouse, they should have their own Water Level. I’m using ETo calculations in my own program to set the water level of the first OS. One solution is to disable Use Weather Adjustment in the greenhouse and have my program adjust watering times directly based on greenhouse ETo and crop requirements, such as corn’s need for increased water over the growing period.

Is it true that all valves in master/remote use the same Weather Adjustment? Does anyone know a better alternative than adjustment by an external program?

Thank you

Current 2.3.3 API and MQTT docs?

I have built the docker (rpi) image for 2.3.3 and that’s running great!

Best I have have been able to find is API docs for 2.2.0
https://raysfiles.com/os_compiled_firmware/docs/2.2.0/OSAPI2.2.0(1).pdf

and for MQTT nothing but this post which only mentions subscribing to topics and noting about publishing control topics
https://openthings.freshdesk.com/support/solutions/articles/5000859089-how-to-use-mqtt

Mostly I just want to be able to manually turn on a station/zone via api or mqtt like one can do in the web ui

Currently I can get json data via the api so I know I can curl via api but when I try any of the control commands (e.g. mp, cr) they are ignored.

so for example

should run program 0 (first)
curl https://myurl/mp?pw=opendoor&pid=0&uwt=0

or

should run first station for one minute
curl https://myurl/cr?pw=opendoor&t=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

both return

{"result":16} whatever that means?

I could do this via a mqtt publish but as I mentioned I cannot find any information of the equivalent mqtt topics to the api commands.

need more input preferably current documentation