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:
    http://raysfiles.com/os/TestOSAPI.html

    Some suggestions for using it:

    • 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.1.9. If your controller runs an older firmware, do NOT use the Change Options (co) API because the way options are handled in earlier firmwares are completely different from 2.1.9.
    • If your OpenSprinkler homepage fails to load, the first thing to check is the Json All (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.0 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