Access-Control-Allow-Origin error, OpenRemote/Z-Wave.me
Posted: 27 Apr 2015 00:11
I have a z-wave network set up using the new Z-Wave expert UI through a raspberry pi. I am creating my own website using an apache2 server to control my devices. The expert UI works fine but when I bring my website up the controls for the devices won't work.
Say my website is set at, "mywebiste.ddns.net", I am using ajax get and post requests to turn devices on and off and to check there status like "mywebsite.ddns.net:8083/OpenRemote/SwitchBinaryStatus/2/0". When viewing the network and console through a browser I get the error:
"XMLHttpRequest cannot load mywebsite.ddns.net:8083/OpenRemote/SwitchBinaryStatus/2/0. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http:/mywebsite.ddns.net' is therefore not allowed access. The response had HTTP status code 404"
Now I have tried to edit the apache2 config files to add:
Header add Access-Allow-Control-Origin "*"
but that hasn't helped. I have followed http://enable-cors.org/server_apache.html as well as various other forum help and nothing has worked yet.
Anyone have any ideas how to fix this?
Say my website is set at, "mywebiste.ddns.net", I am using ajax get and post requests to turn devices on and off and to check there status like "mywebsite.ddns.net:8083/OpenRemote/SwitchBinaryStatus/2/0". When viewing the network and console through a browser I get the error:
"XMLHttpRequest cannot load mywebsite.ddns.net:8083/OpenRemote/SwitchBinaryStatus/2/0. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http:/mywebsite.ddns.net' is therefore not allowed access. The response had HTTP status code 404"
Now I have tried to edit the apache2 config files to add:
Header add Access-Allow-Control-Origin "*"
but that hasn't helped. I have followed http://enable-cors.org/server_apache.html as well as various other forum help and nothing has worked yet.
Anyone have any ideas how to fix this?