Arduino Wifi data transmission with proxy connection


hi, trying , post data on proxy. using wifi connect 1 wifi hotspost has proxy

this code far :

code: [select]
#include <spi.h>
#include <wifi.h>

char ssid[] = "ssidname"; //  network ssid (name)
//char pass[] = "secretpassword";    // network password (use wpa, or use key wep)
int keyindex = 0;            // network key index number (needed wep)

int status = wl_idle_status;
// if don't want use dns (and reduce sketch size)
// use numeric ip instead of name server:
//ipaddress server(74,125,232,128);  // numeric ip google (no dns)
char server[] = "proxy.tcs.com";    // name address google (using dns)

// initialize ethernet client library
// ip address , port of server
// want connect (port 80 default http):
wificlient client;

void setup() {
  //initialize serial , wait port open:
  serial.begin(115200);
  while (!serial) {
    ; // wait serial port connect. needed leonardo only
  }
 
  // check presence of shield:
  if (wifi.status() == wl_no_shield) {
    serial.println("wifi shield not present");
    // don't continue:
    while(true);
  }

  string fv = wifi.firmwareversion();
  if( fv != "1.1.0" )
    serial.println("please upgrade firmware");
 
  // attempt connect wifi network:
  while (status != wl_connected) {
    serial.print("attempting connect ssid: ");
    serial.println(ssid);
    // connect wpa/wpa2 network. change line if using open or wep network:   
    status = wifi.begin(ssid);
 
    // wait 10 seconds connection:
    delay(10000);
  }
  serial.println("connected wifi");
  printwifistatus();
 
  serial.println("\nstarting connection server...");
  // if connection, report via serial:
  if (client.connect(server, 8080)) {
    serial.println("connected server");
client.println("user: india%5c12345"); //%5c hex "/" character
client.println("password: anupam123%23%23%24%24"); //%23%23%24%24 hex ##$$ characters
        client.println("get www.google.com http/1.1");
    client.println("host: www.google.com");
    client.println("connection: close");
    client.println();
  }
}

void loop() {
  // if there incoming bytes available
  // server, read them , print them:
  while (client.available()) {
    char c = client.read();
    serial.write(c);
  }

  // if server's disconnected, stop client:
  if (!client.connected()) {
    serial.println();
    serial.println("disconnecting server.");
    client.stop();

    // nothing forevermore:
    while(true);
  }
}


void printwifistatus() {
  // print ssid of network you're attached to:
  serial.print("ssid: ");
  serial.println(wifi.ssid());

  // print wifi shield's ip address:
  ipaddress ip = wifi.localip();
  serial.print("ip address: ");
  serial.println(ip);

  // print received signal strength:
  long rssi = wifi.rssi();
  serial.print("signal strength (rssi):");
  serial.print(rssi);
  serial.println(" dbm");
}


but unable get, response getting :

attempting connect ssid: ssidname
connected wifi
ssid: ssidname
ip address: xxx.xxx.xxx.xxx
signal strength (rssi):-59 dbm

starting connection server...
connected server
<head><title>unknown host</title></head>
<body bgcolor="white" fgcolor="black"><h1>unknown host</h1><hr>
<font face="helvetica,arial"><b>
description: unable locate server named "<em>india%5c12345</em>" --- server not have dns entry.  perhaps there misspelling in server name, or server no longer exists.  double-check name , try again.</b></font>
<hr>
<!-- default "unknown host" response (504) -->
</body>

can please guide me .

hi,

have implemented connecting internet through proxy ? if yes please let me know process of implementing it. trying implement same.


Arduino Forum > Topics > Home Automation and Networked Objects > Arduino Wifi data transmission with proxy connection


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code