wishield socketapp

hello, I wish to connect my arduino to a server on port 9000 and send there some datas that are then stored into a database.

I know how to do it using Ethernet shield (ie: ChatServer), but I can't find and definition of a server port other than 80 and write datas there.

Is it possible to write something similar like ChatServer for wishield?

...
Client client(server, 9000);
void setup() {
  Ethernet.begin(mac, ip);
}
void loop()
{
...
client.print(inChar);
...
}

Thank you! Peter

yes, any port may be used but be aware that many ports have defined meanings. http://www.iana.org/assignments/port-numbers .

e.g. code snippet to fill a form on a webserver on port 8088

...
char buffer[128];
// fill buffer with right content
...
Client client(192.168.1.240, 8088);

if (client.connect()) 
{   
    client.println("POST /processdata.php HTTP/1.1");
    client.println("Host: myhost");                                // 
    client.println("Content-Type: application/x-www-form-urlencoded");
    client.print("Content-Length: ");
    client.println(len);
    client.println("");
    client.println(buffer);
    client.stop();
}

Note a good client should wait for an acknowledge that the form was filled correctly …

Ok. It's good! :-) I can't find any exemple code. Can you sudgest me one please or copy one simple here?

Peter

A telnet server to fetch temperatures http://blog.brachium-system.net/archives/105-Arduino-with-Ethernetshield-Get-temperature-via-telnet.html click on sketch to find http://jonas.genannt.name/tools/arduino/ds1820_ethernet/DS1820_Ethernet.pde

telnet runs on port 23

these two links are for ethernet shield, but I need a code for wishield...

Sorry, my mistake. Could only find these doc / examples. http://asynclabs.com/wiki/index.php?title=AsyncLabsWiki#Documentation https://github.com/asynclabs/WiShield/tree/master/examples/

thank you for the links. a pity there is no wifi client connection to a server or chat exemple as easy it is for the ethernet .

Have you tried to contact the manufacturer, most of them will help. Explain your need and state that it provide them with an extra example in their library showing the versatility of their product. (a win-win :)