Author Topic: For those with no patience...  (Read 6949 times)

TechnoMonkey

  • Strong Breeze
  • ***
  • Posts: 127
    • EW9323
    • KTXARANS6
    • TechnoMonkeys Weather
  • Station Details: La Crosse WS-2315 / High Sierra Server / Mac Mini 2.3 GHz Intel Core i5/ 8GB Ram / OS 120GB SSD / Home Folder 500GB FireWire / DATA 8TB RAID 5 / 1TB TIME CAPSULE
Re: For those with no patience...
« Reply #15 on: January 18, 2016, 07:29:30 AM »
This may be a tad bit more info than you want, but it does have uptime and last boot.

http://sourceforge.net/projects/phpsysinfo/

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: For those with no patience...
« Reply #16 on: January 18, 2016, 06:59:59 PM »
Thanks! I'll take a look/download that. I finally noticed late yesterday that the computer uptime was not changing, a subtle hint that it just might be broken? Nothing gets by me! [rolleyes2] What my script was actually doing was converting the small (relative to the boot time and the current time seconds) unix epoc seconds into a date which was never going to work for the days, since very few months have more than 31 of those! [citation needed] [banghead]

There are several answers to my quest, that almost provide what I need, and it is extremely frustrating. Only thing worse would be caving to Edouard's AS (assuming it does what I want: Up time in Days, Hours, Minutes). [blush] [lol]

In the meantime, I have an intermittent crashing of WC and email settings that didn't get corrected in WC when I had problems with Comcast a couple of weeks ago. Those problems may be easier to fix and are really more important, anyway. Time for lunch and a trip to Sam's...
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
For someone with no patience . . . (Re: For those with no patience...)
« Reply #17 on: January 18, 2016, 11:25:21 PM »
Dear X-Air, TechnoMonkey, and WeatherCat scripters, .  .

Only thing worse would be caving to Edouard's AS (assuming it does what I want: Up time in Days, Hours, Minutes). [blush] [lol]

 ;) . . . Uh before you submit to a fate worse than death (or so it seems . . . )  did you actually download the script file from my previous posting, load it into your Script Editor, and press the run button just to see if - possibly, perhaps, maybe, could it be? - it actually does what you are looking for?  [biggrin]

Cheers, Edouard  [cheers1]

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: For those with no patience...
« Reply #18 on: January 19, 2016, 03:37:06 AM »
Mine has been working fine for several years and several OS versions. Se the link above my banner, below.

Thanks for all the work put into these, Edouard!
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

TechnoMonkey

  • Strong Breeze
  • ***
  • Posts: 127
    • EW9323
    • KTXARANS6
    • TechnoMonkeys Weather
  • Station Details: La Crosse WS-2315 / High Sierra Server / Mac Mini 2.3 GHz Intel Core i5/ 8GB Ram / OS 120GB SSD / Home Folder 500GB FireWire / DATA 8TB RAID 5 / 1TB TIME CAPSULE
Re: For those with no patience...
« Reply #19 on: January 19, 2016, 03:57:52 AM »
OK. I give up. How do I get that script to run on the webpage?  I can run it from the script editor and from the terminal and as an app, but I have noy been able to get it to run in the webpage.  I am googled out.

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: For those with no patience...
« Reply #20 on: January 19, 2016, 05:00:57 AM »
I have not yet run the script, although I may have downloaded it!  :P So, I have no idea what it does.

As for using it in your wed page (assuming the script does not provide for that), you can add a few lines of AS to create a file with almost any text you want. I have mine now writing both the boot time and the current time (in epoc seconds) to a txt file on the Desktop. I then have that file listed in the "Additional Files" group in WC Prefs so it gets uploaded every 60 seconds. You can then use either an html file or a PHP script on the web page where it needs to display and have either method insert the data for you. The PHP can use a simple three statement Open, Read, Close combo, setting a variable or two or six(!) to whatever is in the txt file. All those steps are trivial, as I'm sure you know. The problem I'm having is getting the difference in seconds to compute the correct years, months, days, hours, minutes, and seconds. Actually, I don't bother with years, not expecting to run any of my computers that long! Nor am I going to bother with seconds. I have a logic error in the hours routine, the months (and even the years), days, and minutes work fine. I'm just a bit cross-eyed at the moment to see where the erer iz! [banghead] [lol]

I promise to take a look at Edouard's AS tomorrow... maybe.  :o
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: For those with no patience...
« Reply #21 on: January 19, 2016, 11:31:48 PM »
Quick! Look at the Station page and see the results of my 'patient' labors! [tup] Should you care, anyway. [rolleyes2] Right now the Software and the Computer times are almost identical because just before I could test the erer I found this morning, the power went out! Then my wife need transportation... finally after a few hours, things seem to be working. [computer] [cheer]

Even though I didn't use Edouardo's well documented AS, I couldn't have made this work without his sysctl kern.boottime shell command!

Now we have a freezing rain, sleet, and snow forecast. [rolleyes2] That almost always means downed power lines, usually by breaking limbs. Fortunately, I got our two ventless gas logs checked out with the power outage earlier today. At least we'll have heat and hot water in the house!  ;D
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Need to run the whole package (Re: For those with no patience...)
« Reply #22 on: January 20, 2016, 12:01:44 AM »
Dear Steve, TechnoMonkey, X-Air, and WeatherCat scripters,

Thanks for all the work put into these, Edouard!

You're welcome!  :)

OK. I give up. How do I get that script to run on the webpage?  I can run it from the script editor and from the terminal and as an app, but I have noy been able to get it to run in the webpage.  I am googled out.

You need to run the entire package of AppleScripts in order to get this data on a webpage.  Here is the link to the package:

http://athena.trixology.com/index.php?topic=1039.0

The way it works is that the script WC Status Growler collects that information as part of its operation and then it hands off the data to WC AppleScript Tags Processor  The WC AppleScript Tags Processor script basically replicates how WeatherCat substitutes values for web tags. 

All these scripts are alas now many years old having been last developed under OS 10.6.  People who installed them back then have been able to get them to work with new versions of OS X, but it appears that Apple won't allow you to install these AppleScripts without some trickery.

If you are interested, download the package and take a look a the copious documentation.  If you are still game to try to run them, let me know and I can give you files that you can get to run on your Mac.

Cheers, Edouard  [cheers1]

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: For those with no patience...
« Reply #23 on: January 29, 2016, 02:01:31 AM »
Just about completely re-wrote the PHP to create the Computer Up-Time code last week. I tested single values for single minute, hour, day, month, and even year. Then made single and multiple values for every possible pair, trio, and quartet. OK, I cheated on the years testing; I just can't see running the mini for more than 1 year, 11 months, 30 days, 23 hours, 59 minutes without a restart for some reason! But, based on the other tests, I think it will still work even then!

It's very basic, repetitive code, begging to be converted to a function or two... later... [rolleyes2]

However, if you should ever see a mangled/mal-formatted output on the "Station" page, please copy and paste what you see and send it to me! I'm sure Stu has heard this before, but I got a laugh when I read it today:
    Ninety-nine little bugs in the code,
    Take one down, patch it around,
    117 little bugs in the code.
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Remember . . . . (Re: For those with no patience...)
« Reply #24 on: January 29, 2016, 11:53:58 PM »
Dear X-Air and WeatherCat amateur coding monkeys, . . . .

I'm sure Stu has heard this before, but I got a laugh when I read it today:
    Ninety-nine little bugs in the code,
    Take one down, patch it around,
    117 little bugs in the code.

Remember, . . . . .

If debugging is the process by which bugs are removed from software, then surely programming is the process by which bugs are inserted into software! . . .  [banghead]

Alas, it appears that Apple Computer has lost sight of this perennial bit of wisdom . . . .  [rolleyes2]

Cheers, Edouard  [cheers1]

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: For those with no patience...
« Reply #25 on: January 30, 2016, 12:19:19 AM »
I stole borrowed that quote from an Aviation Week & Space Technology article discussing the software problems facing the F-35, Jpint Strike Fighter (One aircraft for Air Force, Navy, and Marine use [all with different needs, of course]). Airborne, ground, simulator, and mission planning data must be running in one huge application in many different environments and interactions with other airborne devices may require almost instantaneous updates.

The code must be checked / validated / tested every time a change is made. One commenter stated:"... The best debugged code in history is reputed to be the Space Shuttle code which is about 410,000 [Single Lines of Code]. It is believed that there is 1 UNDISCOVERED bug in every 10,000 lines." No one knows, right now, how many lines of code are in the JSF, but an over-site organization claims the lack of operational software is delaying the actual production of the aircraft.

Writing the software is the easy part, testing it becomes exponentially harder as the size/complexity increases. When the software is critical to the life of a human, there is no such thing as an "little bug"!
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system