laskee ihmisiä

Dependencies:   Adafruit-GFX-MbedOS6 Adafruit_SSD1331_MbedOS6

Files at this revision

API Documentation at this revision

Comitter:
koodimuikku
Date:
Tue Oct 20 09:19:09 2020 +0000
Parent:
14:7e18419e3bc2
Commit message:
jee

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed_app.json Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Oct 20 08:02:51 2020 +0000
+++ b/main.cpp	Tue Oct 20 09:19:09 2020 +0000
@@ -76,7 +76,7 @@
     counter = 0;
     
     char buffer[64];
-    sprintf(buffer, "{'Count': %d}", counter);
+    sprintf(buffer, "{\"Count\": \"%d\"}", counter);
     printf("\n[MQTTBroker] Buffer: %u", buffer);
  
     MQTT::Message msg;
@@ -111,11 +111,11 @@
     while(true) {
         if (alarm){
             counter++;
-            printf("\nToimii! Jippii! '%d' \r\n", msg);
+            printf("\nToimii! Jippii! '%d' \r\n", counter);
             OLED.fillScreen(Black);
             OLED.setCursor(30,25);
             OLED.printf("%d", counter);
-            sprintf(buffer, "{'Count': %d}", counter);
+            sprintf(buffer, "{\"Count\": \"%d\"}", counter);
             msg.payload = (void*)buffer;
             msg.payloadlen = strlen(buffer);
             ThisThread::sleep_for(1000);
--- a/mbed_app.json	Tue Oct 20 08:02:51 2020 +0000
+++ b/mbed_app.json	Tue Oct 20 09:19:09 2020 +0000
@@ -18,7 +18,7 @@
         },
         "mqtt-id": {
             "help": "MQTT Client id",
-            "value": "\"projektilaskinihminen\""
+            "value": "\"d:elogu0:MQTTClient:projekti\""
         },
         "mqtt-broker-ip": {
             "help": "MQTT Broker host ip.",
@@ -26,7 +26,7 @@
         },
       "mqtt-broker-hostname": {
             "help": "MQTT Broker resolvable hostname.",
-            "value": "\"test.mosquitto.org\""
+            "value": "\"elogu0.messaging.internetofthings.ibmcloud.com\""
         },
         "mqtt-broker-port": {
             "help": "MQTT Broker port",
@@ -34,7 +34,7 @@
         },
         "mqtt-topic": {
             "help": "MQTT topic to publish",
-            "value": "\"Muikku/json\""
+            "value": "\"iot-2/evt/Test/fmt/json\""
         },
         "mqtt-username": {
             "help": "MQTT messages username. To be used in the *USER_PASSWORD* tests. See also tests-username-always",
@@ -42,7 +42,7 @@
         },
         "mqtt-password": {
             "help": "MQTT messages password. To be used in the *USER_PASSWORD* tests. See also tests-username-always",
-            "value": "\"TOKEN_PROVIDED\""
+            "value": "\"unvirtautua\""
         }
     },
     "target_overrides": {