OpenSprinkler › Forums › OpenSprinkler Mobile and Web App › Refresh Interval
- This topic has 8 replies, 3 voices, and was last updated 7 years, 5 months ago by Ray.
-
AuthorPosts
-
March 30, 2017 at 9:41 am #45733
Csaba TothParticipantSniffing the http traffic I realized the “GET /ja?pw=….” http request sending interval of an UI running in Chrome browser & Win7 is 5 sec.
Is it possible to change the interval, or it is “hardwired” in the application?The other question: at the end of the GET call there is a number what looks like a msec based epoch time, but this is incremented by 1 at each call.
So it should be something else.
What represents that number?Thanks.
March 30, 2017 at 9:43 am #45734
SamerKeymasterThe refresh interval is currently hardcoded and cannot be adjusted.
The epoch time added is done by jQuery library when using
cache: false
option. This should represent the unix time stamp in milliseconds.March 30, 2017 at 12:31 pm #45735
Csaba TothParticipantThanks Samer!
The attachment at the end of GET request is something different.
Look took the sequence of calls on the picture.Csaba
Attachments:
March 30, 2017 at 12:37 pm #45737
SamerKeymasterIt’s possible the jQuery library generates the first unique token based on the time then increments it to avoid collision since it’s possible two Ajax queries fire at the same time.
Sent from my iPhone using Tapatalk
March 30, 2017 at 12:58 pm #45739
Csaba TothParticipantHi Samer,
It looks to increase the epoch timer value by 1 msec at every 5 seconds.
So it is something different.Anyway our small team is on the way to add sensors to the OS system. The present config will upgrade from one sensor input to 4 inputs.
Rainsensor, Flowsensor, 2 soil sensors (one for sunny one for shaded areas).
Plus current sensor of the valve load.Based on sensor measurement we are adding diagnostic & alarming features too.
I have made the hw design, tests, and the firmware is under coding.
It can be added to any existing OS systems (not OSPi at the moment) using the PT2 connector.
I will post it for the community after the appropriate test cycle to recive the more extensive field test of the contributors.This will need to change the UI.
I will make a very straightforward description about the changes we need for above features.
At the moment our team is lack of javascript developers.
Can you make the coding of the required changes in the UI?Thanks, Csaba
March 30, 2017 at 1:08 pm #45741
Csaba TothParticipantI haven’t seen you post when I was edited my previous post. I don’t have any clue about Ajax at the moment.
The epoch time in the GET command could be used for time synchronization if it would be precise, for example.
In this form it is only increasing the the load of the communication line.Best regards.
April 12, 2017 at 11:31 pm #45863
RayKeymaster@tcsaba101: sorry about my late response. At the moment both Samer and I are overloaded with work so I don’t think we will have time to help with the required changes in the UI. The entire project is open-source, so hopefully you can find someone to help you with the code changes.
Regarding the earlier posts, I may not be following all the details accurately, but here are two notes:
– the refresh interval (5 seconds) is hardcoded in the app / web interface. You can change that if you are customizing the UI. It of course has nothing to do with the firmware — once the app / browser is closed, it won’t poll the controller any further.
– the added time stamp (epoch time in msec) is for caching purpose (if I understand correctly from Samer’s post) — it’s for keep track of each unique call.
– The controller’s /jc (or more generally /ja) API returns the device’s epoch time (in seconds).May 3, 2017 at 6:03 pm #46101
Csaba TothParticipantHi Ray and Samer,
Thanks for the answer, I am working on the changes with colleagues, just the learning curve could have been saved, if…
The Hw, Firmware adjustment to sensors handling is in good shape, the cloud server connection is under test, the Ui questions are on debate.Some tech questions:
According to my observation the UI calls increasing the epoch time field by 1 at each calls (what takes place in every 5 seconds).At starting the UI, there are 3 ssh calls established:
api.github.com:443
api.wunderground.com:443
ui.opensprinkler.com:443
All looks ssh calls, but only opensprinkler and wunderground have data transfer in my monitor.
Can you tell some words about the content?At start /jp, /jn, /jo, /js, /jc queries are requested separately, then /ja is requested in every 5 secs.
Does it have some practical sense?Security is becoming more and more important. From this point the plain http data transfer is not safe.
Although the password MD5 hashed, but this is paperweight security.The AVR8 structure does not gives a wide encoding selection, but have you got any idea to increase the data security in the transfer?
Thanks.
May 4, 2017 at 9:24 pm #46128
RayKeymaster“At start /jp, /jn, /jo, /js, /jc queries are requested separately, then /ja is requested in every 5 secs.
Does it have some practical sense?” –> this is for backward compatibility: not all hardware supports the /ja command, due to the limit of the microcontroller capability. For that reason, it needs to check whether /ja is supported or not, if not, it needs to send separate queries. -
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Mobile and Web App › Refresh Interval