Open MLopezJ opened 1 year ago
{
"deviceId": "urn:imei:351358815340515",
"etag": "AAAAAAAAAAE=",
"deviceEtag": "MTU3MDQyODA2",
"status": "enabled",
"statusUpdateTime": "0001-01-01T00:00:00Z",
"connectionState": "Disconnected",
"lastActivityTime": "0001-01-01T00:00:00Z",
"cloudToDeviceMessageCount": 0,
"authenticationType": "sas",
"x509Thumbprint": {
"primaryThumbprint": null,
"secondaryThumbprint": null
},
"modelId": "",
"version": 2,
"properties": {
"desired": {
"$metadata": {
"$lastUpdated": "2023-02-27T11:56:04.1648972Z"
},
"$version": 1
},
"reported": {
"$metadata": {
"$lastUpdated": "2023-02-27T11:56:04.1648972Z"
},
"$version": 1
}
},
"capabilities": {
"iotEdge": false
}
}
{
"deviceId": "urn:imei:351358815340515",
"etag": "AAAAAAAAAAE=",
"deviceEtag": "Mzc1Njc1NjAx",
"status": "enabled",
"statusUpdateTime": "0001-01-01T00:00:00Z",
"connectionState": "Disconnected",
"lastActivityTime": "0001-01-01T00:00:00Z",
"cloudToDeviceMessageCount": 0,
"authenticationType": "sas",
"x509Thumbprint": {
"primaryThumbprint": null,
"secondaryThumbprint": null
},
"modelId": "",
"version": 2,
"properties": {
"desired": {
"$metadata": {
"$lastUpdated": "2023-02-28T13:16:00.2070304Z"
},
"$version": 1
},
"reported": {
"$metadata": {
"$lastUpdated": "2023-02-28T13:16:00.2070304Z"
},
"$version": 1
}
},
"capabilities": {
"iotEdge": false
}
}
Previous template name is Template without Telemetry
and objects described there were related to expected objects in Anjay-client. Current firmware used is Asset Tracker v2
.
{
"deviceId": "urn:imei:351358815340515",
"etag": "AAAAAAAAAAE=",
"deviceEtag": "ODg2NDE0NDQ3",
"status": "enabled",
"statusUpdateTime": "0001-01-01T00:00:00Z",
"connectionState": "Disconnected",
"lastActivityTime": "0001-01-01T00:00:00Z",
"cloudToDeviceMessageCount": 0,
"authenticationType": "sas",
"x509Thumbprint": {
"primaryThumbprint": null,
"secondaryThumbprint": null
},
"modelId": "",
"version": 2,
"properties": {
"desired": {
"$metadata": {
"$lastUpdated": "2023-02-28T13:35:18.7804381Z"
},
"$version": 1
},
"reported": {
"$metadata": {
"$lastUpdated": "2023-02-28T13:35:18.7804381Z"
},
"$version": 1
}
},
"capabilities": {
"iotEdge": false
}
}
In all the last approaches, the device twin contains this value: "connectionState": "Disconnected",
. This approach is about follow AV System tutorial with Anjay-client and see if that value is returned too.
{
"deviceId": "aa",
"etag": "AAAAAAAAAAE=",
"deviceEtag": "MjMzNTE0Njg4",
"status": "enabled",
"statusUpdateTime": "0001-01-01T00:00:00Z",
"connectionState": "Disconnected",
"lastActivityTime": "0001-01-01T00:00:00Z",
"cloudToDeviceMessageCount": 0,
"authenticationType": "sas",
"x509Thumbprint": {
"primaryThumbprint": null,
"secondaryThumbprint": null
},
"modelId": "",
"version": 2,
"properties": {
"desired": {
"$metadata": {
"$lastUpdated": "2023-02-28T14:40:39.0837179Z"
},
"$version": 1
},
"reported": {
"$metadata": {
"$lastUpdated": "2023-02-28T14:40:39.0837179Z"
},
"$version": 1
}
},
"capabilities": {
"iotEdge": false
}
}
Thingy91 credentials:
- endpoint: urn:imei:351358815340515
- psk: 000102030405060708090a0b0c0d0e0f
Tried to use the last credentials but anjay complain about long in psk. "aa" and "aa" were used instead.
Connection between device and Coiote dashboard is not persistent.
In the attempt, the connection only established first time but after that data were not sent to Coiote Dashboard.
This situation was already described here:
Create new device on environments and test flow
It is interesting how the connection between Thingy:91 and Coiote sometimes is not working as expected. In the attempt that was made to create a new environment, this step fails and was needed to use the previous device connection
Receive data in Coiote Dashboard from Thinghy:91
- Use already generated firmware
- Update Thingy config using anjay
- Result: Not able to connect to Coiote after some tries
- Re write firmware with Programmer
- Turn off and on the Thingy
- Update Thingy config using anjay
- After try again result was the same
- Update Thingy config with already connected device info
It is not the main objective of this project so no effort is going to be made in this concern.
Originally posted by @MLopezJ in https://github.com/MLopezJ/asset-tracker-cloud-coiote-azure-converter-js/issues/8#issuecomment-1429342996
In the current case, the connection was failing. I stopped and started the client several time but same behavior keep repeating. I let it fail for 1 hour and after that, I stopped the client and relaunch,and then it works!
However, Device twin is not updated with expected data
ls /dev/serial/by-id/ -ls
minicom --device /dev/ttyACM0 --baudrate 115200
Data is been sending to Coiote properly but it is not reflected in device twin. Connection state of device twin is disconnected
Same result as previous try.
Same situation described here: https://github.com/MLopezJ/nRF-Asset-Tracker-through-Coiote-flow/issues/5#issuecomment-1448466044
Same result than previously.
How can I see device twin logs?
Device Activity log is not providing useful information.
It is the most realistic scenario in order with what it is needed.
[00:08:11.352,386] <inf> app_event_manager: CLOUD_EVT_CONNECTION_TIMEOUT
[00:08:11.352,966] <inf> net_lwm2m_rd_client: Start LWM2M Client: urn:imei:351358815340515
[00:08:11.352,996] <wrn> cloud_module: Cloud connection establishment in progress
[00:08:11.352,996] <wrn> cloud_module: New connection attempt in 512 seconds if not successful
[00:08:11.990,356] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:351358815340515' with client lifetime 43200
[00:08:12.027,099] <dbg> lwm2m_security: load_credentials_to_modem: Existing credentials found on modem
[00:08:12.676,422] <inf> net_lwm2m_engine: Connected, sock id 0
[00:08:12.857,482] <err> net_lwm2m_rd_client: Failed with code 4.0 (Bad Request). Not Retrying.
[00:08:12.859,252] <wrn> lwm2m_integration: LWM2M_RD_CLIENT_EVENT_REGISTRATION_FAILURE
[00:08:12.859,344] <inf> app_event_manager: CLOUD_EVT_DISCONNECTED
LwM2M client
sampleConnection works. Data is been sending from thingy to Coiote properly but it is not reflected in device twin. Connection state of device twin is disconnected
Connection was not possible
[00:01:48.519,592] <inf> app_event_manager: CLOUD_EVT_CONNECTION_TIMEOUT
[00:01:48.520,172] <inf> net_lwm2m_rd_client: Start LWM2M Client: urn:imei:351358815340515
[00:01:48.520,202] <wrn> cloud_module: Cloud connection establishment in progress
[00:01:48.520,202] <wrn> cloud_module: New connection attempt in 128 seconds if not successful
[00:01:49.311,096] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:351358815340515' with client lifetime 43200
[00:01:49.357,391] <dbg> lwm2m_security: load_credentials_to_modem: Existing credentials found on modem
[00:01:49.913,879] <inf> net_lwm2m_engine: Connected, sock id 0
[00:01:50.090,057] <err> net_lwm2m_rd_client: Failed with code 4.0 (Bad Request). Not Retrying.
[00:01:50.091,949] <wrn> lwm2m_integration: LWM2M_RD_CLIENT_EVENT_REGISTRATION_FAILURE
[00:01:50.092,071] <inf> app_event_manager: CLOUD_EVT_DISCONNECTED
LwM2M client
sample+CSCON: 0
+CSCON: 1
[00:00:43.043,243] <inf> app_event_manager: CLOUD_EVT_CONNECTION_TIMEOUT
[00:00:43.043,823] <inf> net_lwm2m_rd_client: Start LWM2M Client: urn:imei:351358815340515
[00:00:43.043,853] <wrn> cloud_module: Cloud connection establishment in progress
[00:00:43.043,853] <wrn> cloud_module: New connection attempt in 64 seconds if not successful
[00:00:43.821,472] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:351358815340515' with client lifetime 43200
[00:00:43.856,201] <dbg> lwm2m_security: load_credentials_to_modem: Existing credentials found on modem
[00:00:44.520,996] <inf> net_lwm2m_engine: Connected, sock id 0
[00:00:44.621,551] <err> net_lwm2m_rd_client: Failed with code 4.0 (Bad Request). Not Retrying.
[00:00:44.623,504] <wrn> lwm2m_integration: LWM2M_RD_CLIENT_EVENT_REGISTRATION_FAILURE
[00:00:44.623,596] <inf> app_event_manager: CLOUD_EVT_DISCONNECTED
+CSCON: 0
Existing credentials found on modem
cloud_connect failed, error: -119
appears as part of the logs but I was not able do identify what the error code -119
means.
Knows it could give a little bit of context about the issue.
[00:00:10.160,919] <inf> lwm2m_security: Modem connection restored
[00:00:10.169,311] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTED
[00:00:10.170,135] <err> cloud_module: cloud_connect failed, error: -119
[00:00:10.170,166] <wrn> cloud_module: Cloud connection establishment in progress
[00:00:10.170,166] <wrn> cloud_module: New connection attempt in 32 seconds if not successful
[00:00:10.739,868] <inf> net_lwm2m_engine: Connected, sock id 0
[00:00:10.856,262] <err> net_lwm2m_rd_client: Failed with code 4.0 (Bad Request). Not Retrying.
[00:00:10.858,215] <wrn> lwm2m_integration: LWM2M_RD_CLIENT_EVENT_REGISTRATION_FAILURE
[00:00:10.858,306] <inf> app_event_manager: CLOUD_EVT_DISCONNECTED
Remove
Existing credentials found on modem
AT%CMNG=1
# example output
%CMNG: 0,6,"0606060606060606060606060606060606060606060606060606060606060606"
%CMNG: 42,0,"56AE01E6773BDAEC4BFB216D4005ADB06E4F680BD8BFB8BE4C683CE921681897"
%CMNG: 42,1,"320E7F17AB1C7B8E35851862DE358A0D3FDD770C4A26DA7AC29B63EBB201F710"
%CMNG: 42,2,"3A78F6F7C2297288FFEB3E53ED9D92963D32A6BA1288011EA4A3DCC0033F28DD"
%CMNG: 35724861,3,"D65DF89F702EEC58CA3C7BF2001C9FFC7CD80553AE01D42A799BA26756142D96"
%CMNG: 35724861,4,"3F89EB2281D1A29137E6D5AE2A4F0F1D04E6688E72083938C2E8983F522DE00E"
%CMNG: 35724862,3,"D65DF89F702EEC58CA3C7BF2001C9FFC7CD80553AE01D42A799BA26756142D96"
%CMNG: 35724862,4,"3F89EB2281D1A29137E6D5AE2A4F0F1D04E6688E72083938C2E8983F522DE00E"
%CMNG: 4294967293,10,"2C43952EE9E000FF2ACC4E2ED0897C0A72AD5FA72C3D934E81741CBD54F05BD1"
%CMNG: 4294967294,6,"7EA0BF5A4A79790D538EF211AFFDC723FF3D402D51A4EC29064155A4658529EE"
%CMNG: 4294967292,11,"B2C46C2AE7C81943A8BD6DD4ED2A50B659A225A098A177BACB575459CD57CAEF"
tag 42 refers to AWS, 11 to Azure.
AT%CMNG=3,TAG-ID,CONTENT-TYPE
example: AT%CMNG=3,35724862,4
nrf/samples/nrf9160/at_client
edit build configuration
and then click in Build Configuration
the SIM CARD used is the same than used in tests with the Thingy:91
I will push a button from mRF9160 DK device. I'm expecting to see the event in the minicom console, then see the "5500 Digital input state" from "3347 Push button" object change to true and same in the device twin.
firmware used will be LwM2M-client sample
nRF Connect
CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP
to n
in overlay-lwm2m.conf
asset_tracker_v2
folder as application to nRF Connect
overlay-lwm2m.conf
as Kconfig fragments
thingy91_nrf9160_ns
as boardVersion used was 2.0.2
but newest is 2.3.99
. There is not any reason to use 2.0.2
and not the newest version. 2.3.0
is the version than is going to be installed.
Change done following the next link: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html
For the connection, the same steps described here were followed. https://github.com/MLopezJ/nRF-Asset-Tracker-through-Coiote-flow/issues/5#issuecomment-1457941208
Connection with Coiote was established. 50009 - Configuration
object was updated with new props as 8 - Accelerometer inactivity threshold
and 9 - Accelerometer inactivity timeout
.
Push button is not updated when button in the device is pushed.
Device twin is not updated.
Device twin is not updated.
Max size of device twin object could be the reason why device twin is not updated.
More info here: Implications in order with Azure definitions
is desired to see all the integration working in the complete flow. Update a value in the device, pushing button for example, see it change in the Coiote Dashboard and reflect it in the device twin as well.
Originally posted by @MLopezJ in https://github.com/MLopezJ/asset-tracker-cloud-coiote-azure-converter-js/issues/3#issuecomment-1446051154
Right now it is not possible to see this behavior.