OpenSprinkler Forums OpenSprinkler Unified Firmware Useful script for testing OpenSprinkler API

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #67486

    Ray
    Keymaster

    I’ve written a Javascript program for diagnosing and testing certain firmware issues/bug, and for testing a subset of the OpenSprinkler HTTP API. It is useful in the following scenarios:

    • there is a flash or json data corruption, causing the OpenSprinkler homepage to fail to load properly.
    • retrieve raw log data and diagnose log data issues.
    • reset options values, or delete programs if they have corrupted data.

    The script is available at:
    https://raysfiles.com/os/TestOSAPI220.html

    There is a similar script for checking log data specifically, and downloading log data as a CSV spreadsheet file:
    https://raysfiles.com/os/TestOSLogWithCSV.html

    Some notes for using it:

    • You can either use the controller’s IP address, or OTC token if you’ve set it up for your controller.
    • The script directly calls the HTTP API, so does not require opening the homepage (thus it’s helpful if the homepage doesn’t load correctly). It assumes OpenSprinkler firmware 2.2.0.
    • If your OpenSprinkler homepage fails to load, the first thing to check is the Get Json A ll(ja) API. Check the resulting data, is it valid, if not, there is probably a corrupted data item somewhere.
    • If View Log fails to display anything, use the Json Log API. Check if the result is valid.
    • Some APIs are not available on all platforms, for example, the Debug (db) API is only available on OS 3.x and OS 2.3, not available on OSPi. Similar ‘Reset to AP’ is only available on OS 3.0
    • For Changing Options (co) API, you will need to refer to the API document for available Json option names and the acceptable range of values.
    • The script also displays the HTTP command sent to the controller. You can use it as example for how to send HTTP API command.
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware Useful script for testing OpenSprinkler API