sono ad un punto morto ... fino ad ora sono riuscito a trovare e modificare questo.... cosa potri fare per farlo funzionare??
#include <WiServer.h>
#define WIRELESS_MODE_INFRA 1
#define WIRELESS_MODE_ADHOC 2
unsigned char local_ip[] = {192,168,1,2}; // IP address of WiShield
unsigned char gateway_ip[] = {192,168,1,1}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"ASYNCLABS"}; // max 32 bytes
unsigned char security_type = 0; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"12345678"}; // max 64 characters
// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, // Key 0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3
};
// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;
unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------
Server server(5000);
Client client;
unsigned long last_serial;
void setup()
{
Serial.begin(9600);
WiFi.begin(local_ip, gateway_ip, subnet_mask);
server.begin();
Serial.begin(9600);
}
void loop()
{
Serial.println("connecting...");
//If the server is available send it the data from the RFID card
if (client.connect())
{
Serial.println("connected");
client.println("POST /Api/AddParking/3 HTTP/1.1");
client.println("");
}
else
{
Serial.println("connection failed");
}
//Give the server 3 seconds to send acknowledgement
delay(3000);
while (client.available())
{
char c = client.read();
Serial.print(c);
}
if (!client.connected())
{
Serial.println("disconnecting.");
client.stop();
}
else
{
Serial.println("Server still connected?");
client.stop();
}
}