void TestConnect()
{
SetupRemotePort("80"); //change for your needs
SetupRemoteHost("myarduino.info"); //change for your needs
RemoteConnect(); //establish connection
//RemoteCRLFSendPacket("GET /Whatever"); //removed
}
basically this is where the magic happens, it seems to work fine /sending/ packets but when you send data back to the arduino
it buffers, eg if you send
'123'
delay(1000);
'456'
you'll see this happen... 123 delay... 456
if you send
'123'
'456'
the result will be 123456 (not separate data strings) because it stacks on the data at the end, in TCP IP i think they call this chunking
on my client, i can get around that by looking for $$ and && and removing a bit at time getting the right
data i need.
same needs to be done via the C++ source but i'm not that good ![]()
So
SetupRemotePort("80"); //change for your needs
SetupRemoteHost("myarduino.info"); //change for your needs
RemoteConnect(); //establish connection
//RemoteCRLFSendPacket("GET /Whatever"); //removed
first instructs the client to setup a remote port for 80
then the server myarduino.info
then the packet to make a connnection
then the actual command, you could change it to post data to your own server and send sensor info
i totally agree, the client side is not yet finished, but it's working, i need to add support for disconnection
and other stuff, but until i sort out the buffering issue over serial on arduino side, it's kinda pointless and
i may need to add more complex protocol to deal with the packet chunking..
the delay(5000) in the loop, well that's there because i wanted to give it enough time to recv the data
but problem is TOO much data and the data well goes missing because the client is sending more data
than the code can handle, so remove the delay, fix the way it reads the data?.. and check for buffering.
if you're not too fussed about getting data from a server, it works quite well, or you'll need to modify it
and show the rest of us ![]()
How to use.
- run ArduinoClient.exe
- hit the button "Establish Connection" change the com port box from 4 to your port before pressing the button
- done
(the 2 send buttons, it simply sends data down the com port to your arduino board) i used it to trigger off a test connection, you can modify it to happen on a button press or an event etc. 1st "waskeup" you'll
see arduino side that simply instructs the client on windows to make a connection to a specified port/server the other Send button sends the specified string to the remote server.All source code attached, any questions or modifications i need to make, just let me know and i'll recompile and upload. increasing the version by .1 eg v1.1, v1.2 , v1.3 so no mistakes are made.
Other than that, i got it connecting to my own little server and i was able to recv/send data providing the delay(5000) is removed and you buffer the data properly, not done... (god knows how either right now)
Arduino Internet AccessV1.zip (195 KB)