-
Notifications
You must be signed in to change notification settings - Fork 27
More issues with the Arduino Serial example #74
Comments
Drilling into the Arduino Sample I can see that: The json sent for this is ````{"desired":{"sample_rate":9000,"$version":7},"reported":{"$version":1}}``` If I do a property set from IoT Explorer the payload is as at PnP_ProcessTwinData is: So it seems that property updates are not making through the bridge to the Arduino device. The relevant code in config.json is
and in the schema:
|
Current Bridge output:
|
Drilling in further, I can see that the Callback is reached in Bridge code:
... but the function in the Arduino is not called. (I have a debug message there that does not get displayed.) The name of the Callback function in the Arduino code is correct in the LOC above. Nb: It does return though after that LOC. |
In deeper: So we have the name, value, version all OK. Must be something wrong with the userContextCallback, Nb: userContextCallback is not NULL. |
The Description request gets to the Arduino device at the start but subsequent property set and conmand packets do not. |
Drilling in deeper to where the Property Update is to be actioned in the Bridge Console app ... The following call in PnpAdapterManager_RoutePropertyCallback( ) in
with PnP_ProcessTwinData( ) in which then calls VisitDesiredObject( ) in same file. This then calls
... This gets called with componentName as NULL as per the call So the if branch in:
... doesn't get entered and so the PropertyUpdate doesn't happen! ========================= Back in VisitDesiredObject(), that was called with a list of components,
... Third line added. So ...
... becomes:
... The
All parameters as well as Outcome |
Questions form the previous post are:
Info: Callback
|
Plugging away at this some more. Re: processPropertyUpdate()SETTING The Callback Info:
... gets called from SerialPnp_CreatePnpComponent() in 2nd line in:
** Bridge actioning a Callback:**
So want SerialPnp_PropertyUpdateHandler() That's in FINALLY some Serial Transmit code!
** Followed by, this should send the Property Update back to the device:**
|
HEY I FINALLY GOT THE PROPERTY UPDATE TO WORK. |
THIS WORKS\iot-plug-and-play-bridge\pnpbridge\src\pnpbridge\common\pnp_protocol.c In This call fails with NULL. Need a Component:
(1) Line 238 Change NULL to component:
Then get the component from the componentsInModel parameter passed to the function (2) Insert after line 218 \iot-plug-and-play-bridge\pnpbridge\src\adapters\src\serial_pnp\serial_pnp.c In Function ``SerialPnp_PropertyUpdateHandler() (3)Change
To:
|
Next: Commands still don't work. |
RAN into similar problem getting Commands to work.In pnpadapter_manager.c
... returns a NULL componentName So Simple FixI know my single component name is samplepnp
More detailed solutionUsing g_PnpBridge->PnpMgr->ComponentsInModel _but still incomplete
** This does work but probably do want to search for the method in all adapters. |
Thank you for your interest in the IoT Plug and Play bridge, unfortunately due to new innovations in Azure IoT and changes in product strategy we have come to the decision to deprecate the IoT Plug and Play bridge. Thank you to the community for your support on this journey. The repo is planned to be archived as a read-only repository on November 30th 2023. Thank you to everyone who contributed bug fixes and new adapters for connecting devices with IoT Plug and Play. You can find the latest IoT innovations at https://techcommunity.microsoft.com/t5/internet-of-things-blog/bg-p/IoTBlog. Please note that any use of archived repositories introduces more risks from a security standpoint and should be done with caution. |
Following on from the closed issue Getting Arduino Example to work .. Specifying the COM Port #66
I've created a public repository just for the Arduino Serial sample : djaus2/ArduinoSerialPnPExample
I can't get the modeling to work.
The overall aim there is to implement a PnP component that handles the Grove Beginner Kit for Arduino functionality.
Currently:
Q What needs to change with the config.json and the Schema files to get this all to work properly when exercised from Azure IoT Explorer?:
The text was updated successfully, but these errors were encountered: