Use of java, javascript or HTML5

see the documentation for the methods, which run also in the companion...

Taifun

1 Like

Will do, thanks

I’m losing the will.
I got this working so I could debug in the Chrome console window but it only gives very basic information about the requests made and no debugging of the html and javascript.
So I worked out how to connect from a HTML file in chrome on my Windows 10 laptop using JSON POST:-
var xhr = new XMLHttpRequest();
var url = “http://192.168.122.1:8080/sony/camera”;
xhr.open(“POST”, url, true);
xhr.setRequestHeader(“Content-Type”, “application/json”);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
var json = JSON.parse(xhr.responseText);
console.log(json.email + ", " + json.password);
}
};
var data = JSON.stringify({“method”: “startRecMode”, “params”: [], “id”: 1, “version”: “1.0”} );
xhr.send(data);
Unfortunately I get


So, I’ve spent the morning trying incognito, Moesif Origin and Cors Changer and anything else I could find short of creating a local server,
Any ideas, I’m about ready to give up on this?

All your devices on the same subnet? 192.168.122.xxx

No because my laptop is using DHCP 192.168.1.1 from router with subnet mask 255.255.255.0 which I connect with Ethernet cable but Sony Camera is fixed Direct WiFi 192.168.122.1
I believe the issue is accessing the local file system from what I’ve read so can’t mix http with file:///

I already had node.js and nvm installed so I’ve just installed http-server and it offerred the optiion to use one on the same subnet; I tried all options and still get Access to XMLHttpRequest at ‘http://192.168.122.1:8080/sony/camera’ from origin ‘http://192.168.122.147:8080’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
TestCamera.html:21

I give in. Thanks for your help.

I lied, I can’t give in yet as I feel as though I’m so close to achieving what I want. One of the comments in the numerous articles I read said that CORS was not a problem in Firefox, so I installed it and serving the html file through the http-server did not produce the CORS error but it had 2 other errors which I spent a bit of time on.

The only reason I wanted to do this was to get my camera live streaming so I could decode the livestream, then it occurred to me in the early hours that using the emulator may do that, and it does, so I am now able to debug my LiveStream.html file with the javascript in on my laptop. I probably still have a way to go but I can tackle that line at a time until I sort it, or not, BUT I have learnt more and pleased to progress.

The main reason for updating this is so that other noobies may get something from it.

Thanks for your help