Hi,
How do I pass on business data from the device to the AiKaan dashboard?
Hi,
How do I pass on business data from the device to the AiKaan dashboard?
Steps to generate Business Telemetry
Create a scripts/telemetry directory in /opt/aikaan folder
Write the shell script inside the /opt/aikaan/scripts/telemetry folder
Provide executable permission (chmod +x businessTele.sh)
Now select the proper telemetry in the Visualization sub-tab of the devices page
Ref: https://gitlab.com/AiEdge/AiCon/-/blob/develop/ReleaseNotes.md (Version 2.25.1)
Sample Shell Script:
businessTele.sh
#!/bin/bash
echo fieldkey=test1
x=$(shuf -i 0-30 -n 1)
echo value=$x
echo unit=t
I followed the above steps, but Business Telemetry still shows no sufficient data. Am I missing something here?
Hi @Priya,
Verify whether the script file (businessTele.sh) is executable. You can check it by executing the command /opt/aikaan/scripts/telemetry/businessTele.sh
@Priya, As communicated over mail, the script file should contain 3 keys
@shreeram, thanks it worked. However, when I pass multiple (fieldkey, value, unit) pairs in a single script I see only the first telemetry data getting updated. Is this an intended behaviour? Also, is it possible to execute the script at user defined intervals say, 1 min instead of 3 min.
@siddharthmunot @shreeram Would be grateful, if you could provide some clarity on the same. Also is there any documentation available for reference?
@Priya,
Apologies for the delayed response.
Hi,
Continuing on this topic, would it be possible to send business telemetry
Thanks,
Varshini
Hi @varshmail7,
The interface for the business telemetry is text. We do not accept binary, hence we can not accept objects. You can use Python script for example. The script when executed must generate 2 key-value pairs, ref How to pass business data from the device to AiKaan dashboard
@chetansk, thank you for your reply
Here’s my simple python script:
#!/usr/bin/python
fieldkey='battery'
value= 10
unit='percentage'
I do not see any data under business telemetry. (I tried with a bash script, and that works)
Is there something wrong with the python script?
Hi @varshmail7,
This should definitely work. In order to debug, can you please confirm you are able to run this script on the device and you get the results? Sometimes the interpreter (#!/bin/… ) path might be different on the device vs your dev environment.
Thanks
C
Hi @chetansk
Yes, I can run the script on my device. It is executable and is located in the /opt/aikaan/scripts/telemetry folder.
Hi @varshmail7,
As mentioned in the sample shell script, the 3 keys are echoed finally. Please use the same format of echoing keys and their respective values in your python script as shown below:
#!/usr/bin/python
fieldkey='battery'
value=10
unit='percentage'
print ("fieldkey="+fieldkey);
print ("value="+str(value));
print ("unit="+unit);