OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) http://ui.opensprinkler.com/ not working for openspinkler pi

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #35267

    Abhijit
    Participant

    Hello,

    I am used this url http://ui.opensprinkler.com/ to manage opensprikler pi
    I am face issue when i am adding new program with 40 station then system was added 2 more program automatically
    When i am check program listing then display 3 program

    Thanks

    Abhijit S

    #35268

    Samer
    Keymaster

    That location/URL is not designed to be used with OSPi. That is the UI assets for the Arduino OpenSprinkler.

    In particular, the OSPi will give you CORS errors when using a different domain for AJAX requests than the document URL. Please use the direct IP/interface for the OSPi on the desktop or one of the app store apps.

    #35271

    Abhijit
    Participant

    I am used this code https://github.com/salbahra/Sprinklers/blob/master/www/js/main.js
    to implement web interface it also having same problem

    #35272

    Samer
    Keymaster

    That’s also for the same reason. There is the issue of CORS hence why I suggest using the app store versions which don’t have this limitation.

    #35273

    Abhijit
    Participant

    I need to developed this functionality in my site using php code not by using app from app store

    #35274

    Samer
    Keymaster

    In that case you will need to proxy the AJAX calls through your PHP application to prevent CORS errors.

    #35276

    Abhijit
    Participant

    I have checked main.js ,
    i found that this below command (call) run 3 time through this js
    http://XX.XXX.XXX.XX:XXX/cp?pw=opendoor&pid=-1&v=%5B1,16,0,0,0,0,0,1%5D
    hence add 3 program in system. also display timeout error

    Can you please advice me why this happen through this js

    #35277

    Abhijit
    Participant

    can you please modify this js for me

    #35278

    Samer
    Keymaster

    The JavaScript app uses a library called jquery-retry. If the AJAX fails, the request is attempted two more times.

    That’s why your seeing the effect three times. The AJAX is failing due to CORS and cannot be allowed without changing the source code of OSPi.

    As I mentioned earlier, if your building a PHP app then have it communicate with OpenSprinkler to prevent issue with CORS.

    #35281

    Abhijit
    Participant

    It is issue of opensprinkler pi not for opensprinkler
    As per your post this problem fail ajax request,so how should we prevent ajax request
    What changes need to ospi file.so as per i will change ospi files

    #35311

    Abhijit
    Participant

    Hello samer ,

    I have resolved that problem . i have create ajax call to php script. in php script i have create code for create command and send os system.

    thanks for your efforts and time 🙂

    #35314

    Samer
    Keymaster

    Perfect, that’s what I was recommending and what my old PHP app did. Glad it worked out!

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) http://ui.opensprinkler.com/ not working for openspinkler pi