Closed manekinekko closed 4 years ago
Try working outside of your office, mobile hot-spot for instance, might be firewall issue, happened to me...
Try working outside of your office, mobile hot-spot for instance, might be firewall issue, happened to me...
I'm having this exact same issue as well, I've tested on my mobile hot-spot and I've worked from home today to test on my home connection.
I haven't tested with an older version of the SDK to build an API but @manekinekko had and he confirmed that the problem appeared in v1.6.1 and v1.6.2 of the SDK which would tend to indicate it's not a network issue.
I've had other messages being sent to the Azure Hub (the get started project sends messages that I can monitor on the Hub) but what wasn't working was the Device Twin functionality with the temperatureAlert property, it seems like the report state to the Device Twin functionality in the SDK is failing.
Same here, not a network issue,
If anybody else comes across this issue, i tried looking at other files and use some newer methods, following seems to work and state updates are successfully sent. You need to edit DevKitState.ino file according to the following :
// Old Code - Does not work
// char state[500];
// snprintf(state, 500, "{\"firmwareVersion\":\"%s\",\"wifiSSID\":\"%s\",\"wifiRSSI\":%d,\"wifiIP\":\"%s\",\"wifiMask\":\"%s\",\"macAddress\":\"%s\",\"sensorMotion\":%d,\"sensorPressure\":%d,\"sensorMagnetometer\":%d,\"sensorHumidityAndTemperature\":%d,\"sensorIrda\":%d}", firmwareVersion, wifiSSID, wifiRSSI, wifiIP, wifiMask, macAddress, sensorMotion, sensorPressure, sensorMagnetometer, sensorHumidityAndTemperature, sensorIrda);
// DevKitMQTTClient_ReportState(state);
// delay(600000);
// New Code, Does work
char* state;
JSON_Value* root_value = json_value_init_object();
JSON_Object* root_object = json_value_get_object(root_value);
// Only reported properties:
(void)json_object_set_string(root_object, "firmwareVersion", firmwareVersion);
(void)json_object_dotset_string(root_object, "wifi.wifiSSID", wifiSSID);
(void)json_object_dotset_number(root_object, "wifi.wifiRSSI", wifiRSSI);
(void)json_object_dotset_string(root_object, "wifi.wifiIP", WiFi.localIP().get_address());
(void)json_object_dotset_string(root_object, "wifi.wifiMask", WiFi.subnetMask().get_address());
(void)json_object_dotset_string(root_object, "wifi.macAddress", macAddress);
(void)json_object_dotset_number(root_object, "sensor.sensorMotion", sensorMotion);
(void)json_object_dotset_number(root_object, "sensor.sensorHumidityAndTemperature", sensorHumidityAndTemperature);
(void)json_object_dotset_number(root_object, "sensor.sensorMagnetometer", sensorMagnetometer);
(void)json_object_dotset_number(root_object, "sensor.sensorPressure", sensorPressure);
(void)json_object_dotset_number(root_object, "sensor.sensorIrda", sensorIrda);
state = json_serialize_to_string(root_value);
json_value_free(root_value);
DevKitMQTTClient_ReportState(state);
delay(600000); //adjust according to your preferences.
Hi, we have released workbench 0.10.15 and fixed the bug. You can create a new sample project and check it.
Hi,
I'd like to report a weird behavior.
I was recently trying to upgrade our DevKitState workshop, and I stumbled upon an issue. After investigations, it turns out the DevKitSDK versions 1.6.1 and 1.6.2 are triggering the following issue, making the device unable to sync with the IoT Hub:
Switching back to v1.6.0 fixed those errors.
How to reproduce
Here is the current version log from the board
and the error message:
Cheers.