OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › http://ui.opensprinkler.com/ not working for openspinkler pi
- This topic has 11 replies, 2 voices, and was last updated 11 years, 4 months ago by
Samer.
-
AuthorPosts
-
January 21, 2015 at 12:09 am #35267
AbhijitParticipantHello,
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 programThanks
Abhijit S
January 21, 2015 at 12:16 am #35268
SamerKeymasterThat 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.
January 21, 2015 at 12:40 am #35271
AbhijitParticipantI am used this code https://github.com/salbahra/Sprinklers/blob/master/www/js/main.js
to implement web interface it also having same problemJanuary 21, 2015 at 12:41 am #35272
SamerKeymasterThat’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.
January 21, 2015 at 12:49 am #35273
AbhijitParticipantI need to developed this functionality in my site using php code not by using app from app store
January 21, 2015 at 12:51 am #35274
SamerKeymasterIn that case you will need to proxy the AJAX calls through your PHP application to prevent CORS errors.
January 21, 2015 at 6:41 am #35276
AbhijitParticipantI 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 errorCan you please advice me why this happen through this js
January 21, 2015 at 6:42 am #35277
AbhijitParticipantcan you please modify this js for me
January 21, 2015 at 10:59 am #35278
SamerKeymasterThe 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.
January 22, 2015 at 1:04 am #35281
AbhijitParticipantIt 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 filesJanuary 23, 2015 at 5:11 am #35311
AbhijitParticipantHello 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 🙂
January 23, 2015 at 12:25 pm #35314
SamerKeymasterPerfect, that’s what I was recommending and what my old PHP app did. Glad it worked out!
-
AuthorPosts
- 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