Hi,
I want to access a WebServer (Camera IP) with login by a Arduino-WebClient, but I dont know how do it.
I have tried this code on Arduino-WebServer:
if (client.connect(server, 81)) {
** Serial.println("connected");**
** // Make a HTTP request:**
** //client.println("GET /search?q=arduino HTTP/1.1");**
** client.println("GET /myusername:mypassword HTTP/1.1");**
** //client.println("Host: www.google.com");**
** client.println("Host: IPCamera_Web");**
** client.println("Connection: close");**
** client.println();**
** }**
** else {**
** // kf you didn't get a connection to the server:**
** Serial.println("connection failed");**
** }**
When the user agent wants to send the server authentication credentials it may use the Authorization header.
The Authorization header is constructed as follows:
Username and password are combined into a string "username:password"
The resulting string literal is then encoded using Base64
The authorization method and a space i.e. "Basic " is then put before the encoded string.
For example, if the user agent uses 'Aladdin' as the username and 'open sesame' as the password then the header is formed as follows:
Part of my Arduino-WebClient code is: if (client.connect(server, 81)) {
** Serial.println("connected");**
** // Make a HTTP request:**
** //client.println("GET /username:pass HTTP/1.1"); // ???**
** client.println("GET /username/pass HTTP/1.1"); // ???**
You may need to search Google for the make of your web cam to see if there is detailed info on its operation or a user's manual. Make sure you are doing the base64 encoding properly like below (the bottom links have encode and decode for checking). I use something similar to update my no-ip account.
Hi,
thank you everybody by to dispend your time with me!
Hi already did find a solution for my project. It is the following:
On Chrome: http://username:pass@192.168.1.244:81/video/livesp.asp. It is Ok!
On Firefox it is necessary to confirm the login.
On IE dont work!
On Arduino-WebClient: Serial.println("connected");
** // Make a HTTP request:**
** client.print("GET /Authorization: Basic ");**
** client.print("dXNlcm5hbWU6cGFzcw==@192.168.1.244:81");**
** client.println("/video/livesp.asp HTTP/1.1");**
** client.println("Host: IPCamera_Web");**
** client.println("Connection: close");**
** client.println();**
** }**
** else {**
** // kf you didn't get a connection to the server:**
** Serial.println("connection failed");**
** }**
Hallo,
even old topic... I solve similar problem.
Solution with: http://username:pass@10.20.0.6/monitor2.htm works on browser so good.
But I want to access ip camera PTZ by calling: http://10.20.0.6/decoder_control.cgi?command=35
from arduino. Last number in link (35) will be variable and will change according to specific wiev of camera that I want to set.
Any help, please?