'Inteligenty' dom ze sterownikiem PLC
Główna => Programowanie => Wątek zaczęty przez: meskas w Stycznia 15, 2013, 08:02:52 am
-
Hi,
maybe you can help me with jquery problem?
When i run test connections script i get this error in Google chrome console.
XMLHttpRequest cannot load http://192.168.1.1/READPI. Origin null is not allowed by Access-Control-Allow-Origin.
-
Hello,
It is a know issue related to same-origin-policy (http://en.wikipedia.org/wiki/Same_origin_policy) not to WAGO. Here is an article explaining what to do:
http://www.edom-plc.pl/index.php?option=com_content&view=article&id=82:problemy-z-poczeniem&catid=37:wizualizacjehtml&Itemid=74&lang=en
Good luck!
-
Still getting same problem...
Tried to add test connection script to wago and it works, but that PLC doesn't have required space for all web page...
-
When you open Chrome, do you get a message like/similar to this one?
http://www.edom-plc.pl/plugins/content/mavikthumbnails/thumbnails/550x30-images-stories-e-dom-chrome_message.png
-
Fixed the problem :)
just added (dataType: 'jsonp') to ajax call, but them the output info must be parsed in different way
-
I'm glad
Pls share the code once you get it working
-
I will post my code here,
but now i have trouble with WRITEPI... i can't get it to write value to my PLC i can use READPI and i read it normally.
When i use ajax call i get WRITEPI status 302 redirected.... maybe you have some ideas?
-
Hi,
I have never had such a problem. What code do you use now to read/write from/to WAGO?
-
Solved my mystery of write :) looked at your code and saw that in WRITE you need to use ADR1 VALUE1 FORMAT1 in READ you just use ADR and FORMAT, now working on jsonp data parsing, so i will post my read and write codes here :)
-
Hi,
I am very curious, how you got around the SOP restriction. I analyzed JSNOP before but thought that access to the response file from the server is neccessary. I will be happy to see that information to be wrong!
-
Yeah... i failed with JSON... :)
Android was able to do it without JSON, but my browsers still hang with cross browsing....
So now it is a long way to code it on my pc then to upload to Android and then to test it...
-
...but then the original file should be just fine. It works well on Android (see the source file of the Android App (http://www.edom-plc.pl/index.php?option=com_content&view=article&id=94%3Aandroidappcode&catid=36%3Asterowanie&Itemid=70&lang=en), link at the bottom), but fails on PC unless you use Chrome with the --disable-web-security option (browser restart neccessary)... So all my work is done on PC, almost no testing on Android device.