Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

device twin for azure-iot-arduino #62

Closed
MehranMazhar opened this issue Aug 15, 2017 · 8 comments
Closed

device twin for azure-iot-arduino #62

MehranMazhar opened this issue Aug 15, 2017 · 8 comments
Assignees

Comments

@MehranMazhar
Copy link

i need to use device twin in azure-iot-ardunio simplesample_mqtt example .but when i use this line of codes : (devicetwin_simplesample in azure-iot-c-sdk )

DECLARE_STRUCT(Maker,
ascii_char_ptr, makerName, /*Fabrikam, Contoso ... */
ascii_char_ptr, style, /sedan, minivan .../
int, year
);

DECLARE_STRUCT(Geo,
double, longitude,
double, latitude
);

DECLARE_MODEL(CarState,
WITH_REPORTED_PROPERTY(int32_t, softwareVersion),
WITH_REPORTED_PROPERTY(uint8_t, reported_maxSpeed),
WITH_REPORTED_PROPERTY(ascii_char_ptr, vanityPlate)
);

DECLARE_MODEL(CarSettings,
WITH_DESIRED_PROPERTY(uint8_t, desired_maxSpeed, onDesiredMaxSpeed),
WITH_DESIRED_PROPERTY(Geo, location)
);

DECLARE_DEVICETWIN_MODEL(Car,
WITH_REPORTED_PROPERTY(ascii_char_ptr, lastOilChangeDate), /this is a simple reported property/
WITH_DESIRED_PROPERTY(ascii_char_ptr, changeOilReminder),

WITH_REPORTED_PROPERTY(Maker, maker), /*this is a structured reported property*/
WITH_REPORTED_PROPERTY(CarState, state), /*this is a model in model*/
WITH_DESIRED_PROPERTY(CarSettings, settings) /*this is a model in model*/

);

Arduino: 1.8.3 (Windows 10), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, 115200, 4M (3M SPIFFS)"
Build options changed, rebuilding all
In file included from C:\Users\mehran-pc\Documents\Arduino\libraries\AzureIoTHub\src/AzureIoTHub.h:9:0,
from sketch\simplesample_mqtt.c:15:
C:\Users\mehran-pc\Documents\Arduino\libraries\AzureIoTHub\src/sdk/serializer.h:226:67: error: expected ')' before '(' token
#define WITH_REPORTED_PROPERTY(type, name) MODEL_REPORTED_PROPERTY(type, name)
sketch\simplesample_mqtt.c:63:5: note: in expansion of macro 'WITH_REPORTED_PROPERTY'

WITH_REPORTED_PROPERTY(ascii_char_ptr, lastOilChangeDate), /this is a simple reported property/

exit status 1
Error compiling for board NodeMCU 0.9 (ESP-12 Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@JetstreamRoySprowl
Copy link

@MehranMazhar : this question was a bit too big for a quick answer, so we're looking at the possibility of adding device twin support to the Arduino libraries; I'll keep you posted.

@JetstreamRoySprowl
Copy link

@MehranMazhar : unfortunately, figuring this one out would require much of the work of actually adding device twin support for Arduino, and that is beyond what I'm able to do for now. I've put it in front of our PM, who seemed excited about adding the device twin support, so this picture may change at some point.

@JetstreamRoySprowl
Copy link

@MehranMazhar : I think John answered this one here, which seems to be a duplicate. If you're covered, will you please close this issue?

@MehranMazhar
Copy link
Author

@JetstreamRoySprowl I still could not do it with John's method.
So should we wait for support device twin on ardunio with mqtt ?

@JetstreamRoySprowl
Copy link

@MehranMazhar : I'm afraid I don't have any useful info for you at this point. I don't have a timeline for device twin support, nor do I know if such a timeline will ever exist.

@MehranMazhar
Copy link
Author

@JetstreamRoySprowl
Can I Ask you where is this feature supported?
I saw on this issue you said that it will be released soon

@JetstreamRoySprowl
Copy link

JetstreamRoySprowl commented Dec 19, 2017

@MehranMazhar
When the (edit 1.0.44) Arduino release comes out (I'm working on it now) it will work with this sample

@JetstreamRoySprowl
Copy link

@MehranMazhar The 1.0.44 Azure IoT Arduino libraries are out including twin support. You'll need the 2.4.0 ESP8266 Arduino package as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants