Cumulocity tracker-agent stuck at "Start bootstraping" - cumulocity

I have trouble with one of my devices (Tracker dongle) communicating with Cumulocity. I used the Device Registration interface to register its IMEI. Then I accepted it in the same interface when it first connected. But now the tracker-agent I deployed is continually logging:
c.t.d.DeviceBootstrapProcessor : Start bootstrapping:
(DEVICE_IMEI)
And I got nothing arriving on Cumulocity. So I'm guessing it's stuck trying to retreive the device credentials? (Cf. DeviceBootstrapProcessor.tryAccessDeviceCredentials). I have another device of the same type which worcks just fine in the same configuration and I can't tell what's the difference between the two. Is there a step I'm missing to correctly register a device?

The tracker-agent has an additional registration for itself. It is once per tenant and automatically triggers after registering the first tracker device.
What you need to do is register the agent (via device registration) with the following ID:
tracker-agent-{tenant}
(replace {tenant} with the tenant you want do register the agent). This needs do be done once per tenant to allow the tracker agent to create devices and data.

Related

Cumulocity - managedObject Event - detect device first connection

Looking to understand whether there is a a bulletproof event from the namagedObject side of c8y where we know the device has just connected.
I have a microservice that listens for events in real time and I want to trigger a process once we know a device has connected to send its payload.
We have used:
"c8y_Connection": {"status":"CONNECTED"}
We have had the microservice log to Slack all events from managedObjects where we saw for three days the "status":"CONNECTED" value in the payload of our demo devices at reporting times.
But after three days, we see no more this "CONNECTED" state (all payloads showing "DISCONNECTED").
What I am trying to achieve from the inventoryObject event is to understand when a device had connected and sent payload to know when data had arrived. I then go get the data and process it externally. This is post registration and as part of the daily data send cycle for my type of device.
What would be the best way to understand when a device has sent payload in a microservice? I want to notify an external application with either “data is arriving for id 35213” or even better, “data has arrived for device 35213, and here’s the $payload”.
Just as a general information ahead:
The c8y_Connection fragment showing connected shows an active MQTT connection or an active long polling connection and it is only evaluated once every minute.
So if the client is just sending data and immediately disconnecting afterwards this might not picked up.
If you want to see the device having send something to Cumulocity maybe the c8y_Availability fragment is a better as it holds the timestamp when the device last send something.
{ "lastMessage": "2022-10-11T14:49:50.201+09:00", "status": "UNAVAILABLE"}
Also here the evaluation (or better the update to database) only happens every minute.
Both c8y_Availability and c8y_Connection however are only generated if the availability monitoring has been activated for the device (by defining a required interval for the device).
So if you have activated the availability monitoring and you see a "lastMessage" you can reliably say that the device has already send something to Cumulocity.

Writing data to Azure Iot hub device

I am currently doing a POC where I would like to know if this is possible using Azure Services. I get certain data from Iot hub in my Event hub which triggers a logic app, and based on the message received from Event hub, My logic app would send a message to IoT Edge device. i would like to know if it is possible to send message to IoT hub device from logic app? and if yes how can we do that?
I am more looking Yes or No answer to my question and If I get the services to be used to achieve this.. It will be great
Yes, this is possible. Logic Apps have an Event Hub connector that you can use to start your app when a message comes in.
To send a message to your Azure IoT Edge device from a logic app, you could use the REST API. It allows you to send a direct method to a specific module on the device. The device needs to be online for it to receive the message, otherwise, the REST call will result in an error.
The challenge is that you will need to get a valid security token to complete this call, you could certainly add this to your app as a variable, but you shouldn't. You also run the risk of exposing this secret value in your run history. You could write an Azure Function to generate this security token and retrieve it with the Logic App. At this point you're writing code anyway, the problem you're trying to solve with a Logic App would be a better fit for an Azure Function.

JTAPI - How to intercept a call from CUCM

I want to write an easy as short as possible java program using JTAPI, that connects to the CUCM and gets a notification when a call is done by the user.
In other words, i want to make a journal live journal for the user showing who making the calling (always the user) who is being called, and the duration.
JTrace application (with source code) is part of Cisco JTAPI installation. Using this application you can observe all the call activity of the user. You need to enable/configure the user for CTI Application on CUCM admin and use those credentials to start JTrace.

WSO2 EMM: Delete device from Device Management

I successfully registered an Android device to EMM.
Then I did a factory reset and registered it again.
Now I have the same device listed twice in my Device Management.
First thing: Is this behaviour wanted? I think there should be a rule that checks the IMEI and replaces the old object with the newly registered one.
Second thing: How do I get rid of the old object?
What if a phone gets destroyed and I can't unregister it unit-side?
Thanks in advance for any reply.
Conrad
We cann't replace the old device object with the new one because it might cause issues in shared-device scenarios (mostly COPE devices) where several users have access to the same device. So current user of the device must be able to login to EMM without removing the other owners' data. However I think this behavior must be changed to detect the Active device instance / owner from the same device instances and show it instead of showing multiple instances of the same device.
You can not delete the device from the EMM server by removing the registration from the client side. Only way to remove it would be manually removing the database table entry in the "devices" table of EMM database.
I had this problem, and found a (complicated) way to remove these zombie devices.
First of all stop your EMM server with a command like :
# /opt/wso2emm-1.1.0/bin/wso2server.sh stop
Then backup your databases:
# tar -zcvf /root/emm_db_backup.tar.gz /opt/wso2emm-1.1.0/repository/database/
Then start the H2 RDBMS:
java -cp /opt/wso2emm-1.1.0/repository/components/plugins/h2*.jar org.h2.tools.Server -web -webAllowOthers
Now, point your browser to http://YOUR_SERVER_IP:8082
Load the database with the JDBC URL:
jdbc:h2:/opt/wso2emm-1.1.0/repository/database/WSO2EMM_DB
(default User Name and Password are both wsocarbon)
You can list the devices with SELECT * FROM DEVICES
Delete the device by ID with: (change the 1 to whatever zombie device you want to get rid of)
DELETE FROM DEVICES
WHERE ID=1;
You're done! (well, after you stop H2 and start your server again)

Android C2DM Source Code or Implementation

I have a requirment to use Android C2DM functionality.
However, the restriction is that there should be no data that goes outside organization network.
Does the server side implementation send data to Google servers?
Is there an option to implement C2DM service within a closed network, where the data is not sent to Google servers?
Thanks,
RR
The purpose of C2DM is that you "Notify" the device that new data is available, and then your application is starting a sync (or something else, eg showing a message).
In general you don't submit the data (sometimes called payload) using C2DM. It is limited to 1024 chars only.
This way no "company" data is sent to Google.