Closed maxdonadio closed 7 years ago
I'm getting a 400 error from the "hello-time" example, here's my code, I just changed my IP and the port:
#include "SocketIOClient.h" #include "Ethernet.h" #include "SPI.h" SocketIOClient client; byte mac[] = { 0xAA, 0x00, 0xBE, 0xEF, 0xFE, 0xEE }; char hostname[] = "10.114.80.107"; int port = 80; extern String RID; extern String Rname; extern String Rcontent; unsigned long previousMillis = 0; long interval = 10000; void setup() { Serial.begin(9600); Ethernet.begin(mac); if (!client.connect(hostname, port)) Serial.println(F("Not connected.")); if (client.connected()) { client.send("connection", "message", "Connected !!!!"); } else { Serial.println("Connection Error"); while(1); } delay(1000); } void loop() { unsigned long currentMillis = millis(); if(currentMillis - previousMillis > interval) { previousMillis = currentMillis; //client.heartbeat(0); client.send("atime", "message", "Time please?"); } if (client.monitor()) { Serial.println(RID); if (RID == "atime" && Rname == "time") { Serial.print("Time is "); Serial.println(Rcontent); } } }
Here's the message:
Please help :(
It was my network
I'm getting a 400 error from the "hello-time" example, here's my code, I just changed my IP and the port:
Here's the message:![2017-08-15 1](https://user-images.githubusercontent.com/31046194/29330512-c641c322-81cf-11e7-8d3c-ab77493242dc.png)
Please help :(