This means the web host has not responded yet or at all. There are 0 bytes and available and in that case, trying the read returns -1 meaning no data.
You donât need two TCPClientâs so delete TCPClient client;
Try something like this:
...
myTCP.flush(); // start from your current flush() command:
delay(2000); // just wait 2 sec for an answer for now
unsigned long nbytes = myTCP.available();
while(nbytes--) {
Serial.print(myTCP.read()); }
Serial.println();
...
Also, you may want to add short delays between some of your TCP commands. We have a development server at work running a really old version of Apache that is cantankerous with rapid-fire TCP commands without short delays between them (10-100 ms).
Just be sure: you are replacing the âMyDevidâ with your actual devid which looks like âv0123456789abcdâ. You have to get that from the pushing box web site, right?
I ask because this is almost exactly the code I used successfully.
I am glad that sendmail has worked for you on Sakura!
Just be sure: you are replacing the "MyDevid" with your actual devid which looks like "v0123456789abcd". You have to get that from the pushing box web site, right?