diff --git a/IOT/Docs/test.plantuml b/IOT/Docs/test.plantuml new file mode 100644 index 0000000..2ecad28 --- /dev/null +++ b/IOT/Docs/test.plantuml @@ -0,0 +1,15 @@ +@startuml + + +class test { + +val:int +} + +class test2 { + +val2:String +} + + + + +@enduml \ No newline at end of file diff --git a/IOT/src/main.cpp b/IOT/src/main.cpp index 4eeb3be..1d2d8d1 100644 --- a/IOT/src/main.cpp +++ b/IOT/src/main.cpp @@ -15,9 +15,9 @@ SoftwareSerial Serial1(6, 7); // RX, TX #endif -char ssid[] = "Clement4G"; // your network SSID (name) -char pass[] = "Clement123"; // your network password -int status = WL_IDLE_STATUS; // the Wifi radio's status +char ssid[] = "Clement4G"; // TODO: mettre id wifi dans config.ini +char pass[] = "***"; // TODO: mettre pass wifi dans config.ini +int status = WL_IDLE_STATUS; // the Wifi radio's status //char server[] = "arduino.tips"; @@ -62,8 +62,17 @@ void setup() { if (client.connectSSL(server, 443)) { Serial.println("Connected to server"); // Make a HTTP request - client.println("GET /api/collections/poubelle_status/records HTTP/1.1"); + // client.println("GET /api/collections/poubelle_status/records HTTP/1.1"); + // client.println("Host: iot2.epi.cb85.software"); + // client.println("Connection: close"); + // client.println(); + String data = "{\"value\": \"test123\"}"; + client.println("POST /api/collections/poubelle_status/records HTTP/1.1"); client.println("Host: iot2.epi.cb85.software"); + client.println("Content-Type: application/json"); + client.println("Content-Length: " + String(data.length())); + client.println(); + client.println(data); client.println("Connection: close"); client.println(); }