HOME > > SENSING AND CONTROL MAIN PAGE   
Other Ancestors: > > > > OFFERS OVERVIEW

Far Watch WATCHER

Quis custodiet ipsos custodes?
NOTE: this page is different from the similarly named "ssfw_004.htm"

filename: ssfw004_kitfork.htm

This page describes The "Fork for 7NC kitchen" fork of FW004, "Far Watch Watcher".

"Far Watch Watcher" is a utility which increases the benefit you get if you have set up an Arduserver... which can cost as little as $16... or have a FarWatch webserver.

Or any other web server which includes a line with the data in the right format! (Explained later.)

FW004_kitfork isn't typical of the software I offer via the web. It is crude. It isn't as flexible as I would like. But it does work... in a narrow context... if you are willing to get past the setting up. And it is free!


This page isn't typical of what I usually publish. It is unpolished. It doesn't take you gently by the hand. It doesn't do things "well". But, if you can overcome all of that, you can see FarWatchWatcher working by using it to watch one of my FarWatch servers....http://mon7nc.dyndns.org:1202/

(Testing that as a simple link should bring up (in a new tab) a short webpage starting "Yet another Arduserver!...".)

OR, you can use FW004 with a webserver of your own, as long as it contains one essential lines.

Material in boxes like the following is not central to the story here. It is intended to be helpful... but may cover detail you don't need.

To set up a suitable webserver easily, use an ESP8266... The code you need is downloadable from my essay on another Arduserver... this time with an ESP8266.

Below, you see one of the windows from a running instance of FarWatchWatcher- the subject of this page. The application you can download, free, from this page. It harvest data from the webserver, records it to a data file, and presents the data on a graph. New data joins the graph at the right hand edge, and older data is slowly "pushed" to the left.

Graph from FW004

All that you need...

The server you watch must only return one line. It must start with data in the following format...

hhhhsttthhhhstttb

(It must not have any tags at the start of the line.)


Where you see hhhh in the line above, you must have...

Supply leading zeros, as necessary. Both versions of FW004 will record the data. Versions after the first will plot the numbers. The digits will be turned into a number, and plotted. If a number is too big, it will wrap around. ("go off top, come back at bottom")

Where you see sttt in the line above, you must have...

The digits will be treated as reporting a temperature in DECI-degrees, C.

Except for the last character in the data line, the rest are ignored.

If the line returned...

hhhh+156hhhh-051b

... FW004 (version kitfork) would "think" that the server was seeing 15.6 degrees C and -5.1 degrees C, and put dots on the graph accordingly. (Actually, the -5.1 would either be lost, or "wrap" around (vertically) and appear in a misleading place. The graph is set up to handle temperatures from about 45 - 85 Fahrenheit at the moment. Two horizontal lines mark the "60 deg F" and "70 deg F" levels... another thing that earlier versions of FarWatchWatcher and precursors (FW003) lack.)

Little bonus: You saw the "b" at the end of the line. If that is 0 (zero) a line at the bottom of the FarWatchWatcher graph is low. If it is anything else, the line is high. "b" for Binary. It is meant for reporting the state of a digital input to the server that is serving up the temperatures. "0" and "1" would be logical values. but in fact anything other than "0" is as good as "1".

One last thing... if possible, it would be good if the server preceded the line with the data with a line that had ...

hhhhsttthhhhstttb

... on it, so much the better. (Not used at the moment... but will be helpful to future versions of FarWatchWatcher.

-------
FarWatchWATCHER FW004_kitfork automatically harvests some of the data the server offers. It draws a graph of the readings. It even records them in a spreadsheet- friendly data file.

I do offer a much better page than this, discussing the general FarWatchWatcher concept, and giving links to various related pages.

How you would actually get a FarWatch Watcher up and running...

This essay is a kludged version of an earlier one. The earlier one explained... in more detail... an older datasource/ FarWatchWatcher combination. The older essay may help you figure out things I've explained badly here. (FW004 is a tweaked version of FW003.)

I may not, in the time I've been able to give this, been able to explain things adequately, but at least I've got the code online for you. Start by seeing if you can get this FW004 to read my humidity and temperature sensor (URL is here somewhere). If you get that far, and have some ESP8266 experience (or get it, from my article, cited here too), try setting up your own sensor reading webserver for FW004 to read? If you succeed, I would be delighted to know that my work wasn't a waste of time. Apologies for not making this easier for you, the way I hope most of my pages make them easy.

Still reading? Great! You have an Arduserver running? (or one of mine is responding.) Time to download and try FW004_kitfork, FarWatchWatcher...

(Text in this color is specifically about the "kitfork" version of FW004... an early version... 2/19 (Though "early" in this form, that was an evolution of an old product.)

You can download a zip file containing FW004, the "kitfork" fork. The program is under development just now. It will read, graph and record two temperatures, though. (Plus the state of an "on"/"off", or other digital datum.) Don't hesitate to get in touch, should you have questions.

(Text in this color is specifically about the "ver19305" version of FW004... an improved version from 5 March 2019.)

Alternatively.. or in addition!... you can download a zip file containing FW004, the "05 Mar 19" fork. The program isn't a "finished product"... but it works!!. It will read, graph and record two temperatures, though. Plus the state of an "on"/"off", or other digital datum. AND: It will generate a graph of two temperatures, the state of the digital bit, and the second of the "hhhh" data. (It records both hhhh data to the data file.) Don't hesitate to get in touch, should you have questions.

Which to start with?

The "kitfork" (older) version is more carefully "properly" written up. But it is a little awkward to set up. Not impossible. Just not "user friendly". And its functions are less extensive.

The new version ("19503") is "better". It re-saves the graph as a jpg each time the graph scrolls. (Over-writing the previous .jpg.)

Hint: If you have a webserver on the Windows machine you are running FW004 on, then if in the page served, you have...


<img src="MyGraph.jpg" alt="Graph from FW004">

... and you've told FW004 to save to that folder, using that filename (both are interactively set), then anyone accessing the webpage will see the (datestamped) graph, as it appeared on your PC the last time it scrolled.

You can (usually!) see that in action at...

(FW004 is behind the more modest graph near the bottom of the page.)

The "19503" version has a few bits of "user friendliness" that "kit Fork" lacks. It has a quirk: The colors of the legends are "wrong" the first time you run it when there's not a preexisting ini file. But, just by stopping execution, starting again, the problem goes away. I think. It is only a problem with the colors in the graph legend, and only 'til you restart the program after the ini file is created. If you find that too much to bear, I will refund anything you've paid me to use the program. (Nothing, remember: It is FREE.)

Brave? I'd start with the latest version. The rest of the text here needs tweaking to be exactly right for that, but the differences won't matter much, I don't think. A "tortoise", not a "hare"? By all means start with "kitfork"... the "upgrade" to the better one, should you want the saving of the image, wouldn't be a Big Deal.

Installation

===
Set up a folder for FW004. You can have multiple folders for multiple copies of FW004 and its associated files, if you anticipate monitoring more than one data server. The folder name can be whatever you wish. I have two data servers. One in the garden, one watching the house's heating. My folders? "FW004-garden", "FW004-heating". Not hard. All of FW004 tries to KISS. In ver19305, there's a field you can put "Garden" or "Heating" or anything you want in. Eventually what is there will appear in all the places it would be helpful. It is already part of the jpg the application saves.

This folder must be one to which whatever user is going to run the .exe is allowed to write.

It is easy to set Windows to run the program when it boots.

Fetch the .zip file I provide, and unpack from it to the folder you created at least FW004.exe. (That maybe all that is in the .zip) (Note that the "kit fork" part does NOT appear there. The title bar of the main window shows "Fork... for NC 8266". (No mention of "kitchen". Sorry!) Don't Try To Run It Yet.

It won't run happily directly from the .zip.

Windows 10 may whine... they want me to pay to be "recognized". If you get "Windows Protected Your PC..." with a big "Don't run" button, look for the "more information" link in the text. Click that, and a "Run Anyway" button appears. You DID scan the .exe with your anti-virus software, I hope?)

(Only needed for the kitfork version. ver 19305 creates this for you.) In the folder you created, create a new file called TmpFrmWeb.txt

It doesn't have to have anything in it. But be sure it isn't called "TmpFrmWeb.txt.txt"... which could happen if you don't display file extensions. (If you don't: Create a simple text file called "TmpFrmWeb". You can see the extension if you do right-click/ properties. DO NOT mess with the "opens with" there!)

Now try to run FW004.exe, and it should create a FW004ini.txt.

It may not run well the first time you try to use it.

But, please, don't give up! There's not a lot to get right. This is FREE software. Do you know how much work it is to polish something to the point that it handles everything a new user can do? (I spent most of a working day trying to make it run better when first installed. I think I succeeded... but testing takes even more time than coding! "All" I did was to make it "behave" if...

*** A separate page is available with details of what goes in FW004's ini file. ***

Put the URL of your data source in the "Watched URL" edit box. (Until that is right, the program may be laggy, as it tries... and fails... to access a "server" at whatever "URL" is specified by that edit box. If you are comfortable with editing ini files, put the server's URL into the ini file as the entry for "IPAddr". Mostly, you don't need to use that "old skool" approach... just change things on the display, click "save settings".)

One thing you DO have to edit the old fashioned way still is the WhereFmtCodeLineIs line. But if you are using the Arduserver this is designed for, that will already be right!

Put anything you like in the "Free text..." box.

If you are using ver19305, you can put any of the following in "Filename for image"...

In the separate box to the right of the box for the filename, only ".jpg" makes sense. We'll come back to the filename in a moment. The separate box determines the extension for the file. It also supplies the necessary "." You can put what you like... if it starts with a ".", but the file will still be saved as a JPEG. Sorry.

Going back to the filename:

If you used "tmp" or "frmFW004", the file would be saved in the folder the .exe is in.

If the .exe was running under Windows user "Fred", then the "C:\users..." filename would save the .jpg in Fred's documents, with the name "NamedWithPath.jpg"

Note that when you use the long version, technically you are supplying the PATH + filename. And that the name+path ends with the last character of the name. Not a "." Not a "/"


... continuing the install process...

If you aren't using the dataserver this was written for, you may need to open FW004ini.txt in a text editor.

Close the program, if it is running.

In the text editor, find the following line in the ini file...

WhereFmtCodeLineIs=

.. and set it to "the right number". (Which I will explain!)

Several of the lines in the ini file, e.g....

CodeForTypeOfDataSource=

...don't matter! at the moment.

You can leave the .ini file open in your text editor the whole time... but each time you quit FW004, the ini file is re-saved... with the values then present in the application.

Quit FW004 BEFORE making changes to what you see in the ini file. THEN (re)save the ini file from the text editor. That way, when you next start FW004, what it sees in the ini file will be in step with what is on the screen in the text editor.

"The right number" (for WhereFmtCodeLineIs=)...

Access your data source with a simple web browser. (Firefox, Chrome... whatever.)

Access the page's source. (Firefox: Right-click, "View Page Source.)

Find the line that says...

hhhhsttthhhhstttb

See which line that is, counting the first line as "1".

THAT's the number to put in FW004ini.txt as "WhereFmtCodeLineIs".

SAVE the edited FW004ini.txt. Restart FW004. You HAD stopped FW004 before trying to edit the ini file, hadn't you? (If not, start again... when FW004 is stopped, it wipes out whatever ini file is present.)

FW004 should start running, returning the values from the server.

When FW004 is started, it should return values from the server.

You can click "Tick for debug speed..." to speed the fetch/report cycle up for testing purposes.

Where have we got to?

So... you have, at least in theory, access to a webpage serving up the data in the right format.

You've got FW004.exe in a folder of its own, with a TmpFrmWeb.txt file (contents unimportant) and a tweaked .ini file. (The program itself will tweak the ini file when you change things in the program's window while it is running, e.g. you can change the URL accessed.)

Now FW004 should Just Work!

Your anti-malware software may need to be told to let the program "do" TCP to and from the Arduserver. It probably SHOULD ask if the activity is sanctioned by you!

Graph from fw004

All that in place! Great! In due course, a graph of the temperature values from the server will build. (And there will be the "on/off" data in the lime-green line at the bottom of the graph. (In the graph above, the state of that datum from the server doesn't change during the period plotted. (Which was about 32 hours. It started just after midnight on day one, passed midnight once (magenta line), and ran for about another 8 hours before the screenshot was captured. There were two temperature sensors in different parts of one room. The outside air temperature was low. The room had a thermostatically controlled electric heater, which switched on about a dozen times. The big spike at about 2pm came from a door opening briefly to a very warm large room adjacent to the small room the sensors were in. The temperatures were generally between 60 degrees (troughs of green line) to 76 degrees (peaks of blue lines).

If you are running ver 19305, you should have an additional line which is reporting the value returned in the second "hhhh" field. (You could have lines for both... but my largess goes only so far. One day this will be a commercial product.)

By the way, contrary the working of earlier versions of FW004, on the graph as the numbers coming from the server INCREASE, the lines go UP.. as they always "should" have. (When you are a programmer, you can complain. You'd surprised how hard fixing THAT "little quirk" was!)

Note the vertical lines on the graph. The magenta ones are done at midnight... on the machine that FW004 is running on. The gray ones are done at 6am, noon, and 9pm.



Graph from FW004

The following is "exactly" right for ver19305, and broadly right for version kitfork.

The image to the left is of the main control panel for the application. The wide, scrollable pane across the bottom has the html sent by the server in its raw form, i.e. as it arrived from the server. The left hand pane above that shows how the data was interpreted, and sent to the data file on the disk.

The right hand panel is a temporary repository for things en route to your hard drive. To reduce "thrash", new data is added to the data log in batches. Don't be alarmed that after gradually filling, the right hand window suddenly empties. (It will then start refilling.)



Readings window from FW004

Again, the following is "exactly" right for ver19305, and broadly right for version kitfork.

The bottom memo of the "FW004_readings_f1" window gives you...

(As of ver 19305, that last material isn't used, but it is hoped that future versions of FW004 will be self-configuring.)

In version kitfork, there are some "Sdatum" lines. They were a Bad Idea, and not worth explaining!

The top memo on FW004_readings_f1 may have ERROR MESSAGES and warnings in it. They don't "announce" themselves with beeps or flashing lights or modal dialog boxes. If your installation isn't working, have a look for messages in the top memo!




I headed this "Quis custodiet ipsos custodes?"? The link will take you to the Wikipedia entry.


Please remember disclaimers at top... neither the software nor the webpage meet my usual standards for customer care... but if they are useful, I am pleased to share them.

If the software is useful to you, I would be very grateful for any publicity you can generate for this page. Mention it in IoT forums? On social media? Etc?. Failing that, at least a quick email telling me where (broadly... not your street number!) you are using it, and what you are monitoring, would be interesting to me. Do of course "complain" about any rough edges that were a nuisance to you... so I can try to get rid of them for the next person!



   Search this site                 powered by FreeFind
 
Site Map    What's New    Search
N.B.: The search engine just looks through the web site for the words you enter. It cannot answer "Which program is fastest?"
Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, download something, and circulate it for me? At least (please) send an 'I liked the parallel port use page, and I'm from (country/ state)' email? (No... I don't do spam) Links on your page to this page would also be appreciated!
Click here to visit editor's Sheepdog Software freeware, shareware page.

By the way.... I am interested in buying any second hand Dallas Rain Gauge or Wind sensor (any version). It must be in reasonable condition mechanically- no cracks or broken bits, but I'm hoping you have one with "dead" electronics, which you are willing to sell for a price that reflects the fact. The "no broken bits" requirement doesn't extend to the electronics. Shipping: It can be to the US or the UK. If you have something for me, please click here for my eddress?

Other projects

This is part of just one of my websites. Please visit any of the following....

Delphi Tutorials
Pascal programming tutorials
Electronics for hobbyists and schools
Main Home Page... various topics, not all computery.

You can email this page's editor, Tom Boyd. Click here for details.

Index of sensing and control pages (From there you can also go to other help from the editor of this page.)


Valid HTML 4.01 Transitional Page has been tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org. Mostly passes.

AND passes... Valid CSS!


-- Page ends --