OpenSprinkler Forums OpenSprinkler Unified Firmware Sending HTTP Command from ThingSpeak to OS

This topic contains 4 replies, has 3 voices, and was last updated by  Ray 4 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #53734

    Coupe Pete
    Participant

    Hi – i have almost completed a thingSpeak program to scrape the Evapotranspiration from an Australia BOM weather website and are using it to adjust the percentage watering on open sprinkler. The very last step is to work out how to send the command from thingSpeak to OS. I just wanted to confirm that the OpenSprinkler API requires a GET call and cannot use POST ? I have been playing around with POSTMAN and that testing seems to support my conclusion. I can also send the command from my browser successfully. Is my understanding correct or are the other ways of making the request ?

    PS: if anyone has done this and can show me how they did that would be awesome.

    #53787

    Coupe Pete
    Participant

    Hi – still looking for some help here. I have confirmed the correct command to use in ThingSpeak but opensprinkler responds with forbidden. Does anyone have experience using ThingSpeak or does anyone know of a reason this might be rejected ?

    If I copy the command out of the error message and use it in my browser or in POSTMAN it works fine. Obviously some of the details below have been modified for security reasons.

    Error using readContentFromWebService (line 46)
    The server returned the status 403 with message “Forbidden” in response to the request to URL http://irrigation.duckdns.org:351/co?pw=a6d82bced638de3e9bbb4983225c&o23=112.

    Error in webread (line 125)
    [varargout{1:nargout}] = readContentFromWebService(connection, options);

    http://irrigation.duckdns.org:351/co?pw=a6d82bced638de3ef1e9bbb4983225c&o23=112

    #53799

    Mike
    Participant

    Hi Pete,

    Have you set up your network to allow incoming requests from the internet? It’s very possible that your router is blocking the request. You’d need to open the port and forward to your OS for this to be successful.

    Mike

    #53817

    Coupe Pete
    Participant

    Yes – thanks for the suggestion. I have set up port forwarding and it works well. I can send the request from a web connected pc via the browser, or via Postman but not from thingspeak.

    #54015

    Ray
    Keymaster

    I’ve responded to this through support ticket. I suggested that you directly use IFTTT to send web request to OpenSprinkler, this way you can avoid having to use ThingSpeak to send web request. Not sure if this would meet your need, but the idea is that IFTTT can receive data from ThingSpeak as ‘trigger’, and send command to OpenSprinkler as ‘action’. The latter can be done using ‘webhook’ that IFTTT supports.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware Sending HTTP Command from ThingSpeak to OS