Hi,
Long time, no posts and the ‘General’ Category seems to have gone, so move this wherever you think it best!
Retired now and using a PAC R1 with Node-RED for a home control system. I know I could use MQTT through Node-RED, but, as this is the main controller, I want the PAC R1 to control, and not rely on my Node-RED/Mosquitto install. This means less things to rely on in case of a crash - and I know the PAC R1 to be very reliable with uptimes of, well, I never get that far, but lots of months at least!!
My problem:
I am trying to carry out an Optoscript httpget to retrieve data from a Shelly control module API. The version without using user:password in the call works fine, but as soon as I enable authentication, I add the user:password@ into the httpget command but it fails with -450.
Basically, I am unsure how to add the user:password into the httpget command and was wondering if you can see a way of doing this.
TIA
Colin J
Just to add: the call works OK from a Browser (Firefox, Chromium)
sHttpURLShellyLivRoom = "XX.XXX.XXX.XXX";
sHttpURLShellyLivRoom = "user:password@XXX.XXX.XXX.XXX";
sHttpCmd = "/settings/color/0";
nHttpPort = 80;
nHttpStatusESP = 99;
nHttpStatusShelly = HttpGet(
stHttpBody, // Return body data dest string table
stHttpHeader, // Return header data dest string table
stHttp_SrcStrTblBody, // Source body data string table (may be empty)
0, // 0 for non-secure, <>0 for SSL
sHttpCmd, // URL
nHttpStatusSonoff, // Status returned by HTTP server
nHttpPort, // Port to which you want to connect
sHttpURLShellyLivRoom ); // Address, (numeric or www.google.com, etc)
nIndex = 0;
sWebBodyTest = stHttpBody[nIndex];