I’m making heavy use of the Luup Request callback mechanism (http://vera/port_3480/data_request?id=lr_Foo) in my plugins, calling them from JavaScript tabs to transfer sensitive information (security system PINs) straight from Lua to the user’s browser.
These work great over a LAN, and also over VPN.
Users are reporting that they don’t work over the MiOS remote access (https://fwdn.mios.com/remote/port_3480/data_request?id=lr_Foo). I got a user to run Firebug while using a JavaScript tab that makes such a call, and the call returned immediately without any JSON data inside.
Should Luup requests work over remote access? Is the URL above correct?
I can’t test this myself because I’m one of those unlucky users for whom JavaScript tabs don’t work over remote access, full stop.
The request is like this: https://fwdn.mios.com///<Vera_Serial_No>/data_request?id=user_data
I tested it and it works. If the above URL is wrong, the received response is the empty body with the status 200 OK instead of the expected 404 Not Found.
I’ll try to find why your JavaScript tabs don’t work remotely and will give you an answer in the other thread.
I’m aware of the URLs with the username/password/serialnumber sequence, but I don’t see how I can construct one of those with a relative path from the remote dashboard, where they’re not in the document URL anyway.
I’ve been putting the relative path “…/port_3480/data_request?id=lr_Foo” into the AJAX request. It works locally, but it seems that the relative layout isn’t the same for the case of lr_Foo requests.
Edit: in case it’s not obvious, the lr_ in this topic is important. I’m only experiencing problems with functions registetered via register_handler. I’ve got no issue with the user_data call.
I must confess I didn’t give any importance to what was after id, so your last edit helps. I don’t see any reason why the user_data request works and these not. Have you tried to use port_49451 instead? This is what I see on the Wiki for functions registered with luup.register_handler.
I’ve got output_format=json on both HTTP requests, but the remote forwarder is stripping it (even if I say output_format=xml, I get an empty string in my handler for lul_outputformat
I’ll modify my handler to treat an empty output format as JSON, which it wasn’t doing, until this bug in the forwarder gets fixed.
Try to open a JavaScript tab for a device (on my Vera, if you are using the remote access I’ve authorized for user “web”, go to Global > Security System > Configuration).
Edit: I’d be able to help you much more if you sorted out this other topic’s problem first. I don’t have a workaround for that one, but I do for the issue in this topic.
Best Home Automation shopping experience. Shop at Ezlo!