Announcement

Collapse
No announcement yet.

The remote server returned an error: (401) Unauthorized

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    The remote server returned an error: (401) Unauthorized

    I am trying to control a Foscam FI8918W using HSTouch. I assigned port 10201 to it and forward the port. I can control the camera with a browser.
    I downloaded 'HomeSeer Pan Tilt Camera.xml' and changed all references to IP, Port, User & Password to match my camera.
    In HSTouch I get live video with ImageURLNormal set to 'http://192.168.1.16:10201/snapshot.cgi?user=xxx&pwd=xxx'
    The ActionsWhenPressed button is configured as follows:
    HomeSeer: Run a HomeSeer script with values from elements(s)
    &hs.GetUrl("http://192.168.1.16:10201/decoder_control.cgi?command=6&user=xxx&pwd=xxx","",True,1020 1)
    The ActionsWhenReleased button is configured as follows:
    HomeSeer: Run a HomeSeer script with values from elements(s)
    &hs.GetUrl("http://192.168.1.16:10201/decoder_control.cgi?command=7&user=xxx&pwd=xxx","",True,1020 1)

    When I click any pan or tilt control in HSTouch, I get the error:

    "Failed to run the script: ERROR: The remote server returned an error: (401) Unauthorized."

    I tried removing the port reference-

    &hs.GetUrl("http://192.168.1.16/decoder_control.cgi?command=6&user=xxx&pwd=xxx","",True,1020 1)
    And I get this error:
    "Failed to run the script: ERROR: Unable to connect to the remote server"
    So I put the port reference back in.

    I have tried many things including:
    Installing Netcam plug-in - made no difference so I disabled it
    Deleting the forwarding of port 10201 - - made no difference so I put it back in
    I tried changing "True" to "False" - no joy
    I tried using the admin login for the camera - again no joy
    Verified that my camera has the latest firmware
    I have surfed the forums for days on end, trying to find the meaning of Error 401.
    I give up. What am I doing wrong?

    Thank you

    #2
    That error would indicate that your username and or password isn't correct or you have something on your HomeSeer server blocking incoming access. ie firewall, antivirus software, etc.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      The remote server returned an error: (401) Unauthorized

      The Homeseer software is running on a HT-S4-PRO Hometroller so there wouldn't be a firewall or anti-virus, right? I have tried 2 different log-ins for the camera (the admin and a user), both of which work in a browser. Is it possible that the router could be blocking the command?

      Comment


        #4
        The remote server returned an error: (401) Unauthorized

        I verified that the Hometroller's firewall is turned off and there is no anti-virus installed (other than HSProtect). After enabling Active X in Internet Explorer, I can control the camera from the Hometroller using IE. However, HSTouch still gives the same error.
        Also, I tried disabling the firewall in the router but that had no effect either.
        I should mention that I have a few Z-Wave devices installed which I can control through HSTouch.

        I must be missing something basic. Are there any Homeseer plug-ins required to control the IP cams through HSTouch?

        Thanks for the much needed help.

        Comment


          #5
          The remote server returned an error: (401) Unauthorized *****SOLVED!!!

          Whoo Hoo! After a lot of hair pulling and reading nearly every post for the past 10 days, I stumbled on the fix. The documentation is wrong.
          This is not the correct syntax to control the Foscam FI8918W (at least not my FI8918W cams):
          &hs.GetUrl("http://192.168.1.16:10201/decoder_control.cgi?command=6&user=xxx&pwd=xxx","",True,1020 1)

          This is:
          &hs.GetUrl("http://192.168.1.16:10201/decoder_control.cgi?user=xxx&pwd=xxx&command=6","",True,1020 1)

          The username and password should precede the command, not follow it. I knew it had to be something simple.

          I will finally get some sleep tonight!!

          Comment


            #6
            Did you mean to put a space in the characters at the end of your line, at the port number? I tried your entry for my Foscam, & it didn't work.

            Comment


              #7
              The remote server returned an error: (401) Unauthorized *****SOLVED!!!

              No, that was unintentional. The thread editor added that space and I couldn't get rid of it. 10201 is the port that I assigned to the camera. Use whatever port that you assigned when you set up port forwarding in your router.

              Comment

              Working...
              X