How to query tektelic Kona Home Sensor

I know about gRPC and RESTfull API,but how do I retrieve temperature, humidity, etc from kona home sensor. What cmd and how do I send cmd to the sensor to change how often to deliver such information? Link where I can read about it would be great.

you can make integration with application which will process retrieved data. it could be your own app which retrieve json data via http post, or influx + grafana, or my devices, or things board cloud apps.

this is a manufacturer specific, ask them directly.

1 Like

@eugenev
it could be your own app which retrieve json data via http post

how do I do it? Can I read about it?

are you experienced in http web servers, java script, html, php or other programming languages? without this knowledge, further conversation does not make sense. Read the corresponding manuals,doc’s and make decisision for yourself which way to chose.

@eugenev

are you experienced in http web servers, java script, html, php or other programming languages?
[alex]-> yes

so what’s the problem? in this case, you should know how to handle the POST method in different programming languages.
make your choice and start writing code :slight_smile:
why you ask obvious things without bothering to carefully study the documentation provided on the main site?
did you read this?: https://www.chirpstack.io/application-server/integrate/sending-receiving/

@eugenev
yes i read the link and could not determine any useful info

so what’s the problem? in this case, you should know how to handle the POST method in different programming languages.
make your choice and start writing code :slight_smile:
[ALEX]->I am glad to write but none of the links contains code the uplink data from device.I captured one of the lora packets for my application and device ID. I do not find in the uplink message(below json format) the information I am looking for( temperature, humidity, etc). It does not contain object with fields as per example)
[
{
“uplinkMetaData”: {
“rxInfo”: [
{
“gatewayID”: “ZH/a//4AiME=”,
“time”: null,
“timeSinceGPSEpoch”: null,
“rssi”: -51,
“loRaSNR”: 13,
“channel”: 7,
“rfChain”: 0,
“board”: 0,
“antenna”: 0,
“location”: {
“latitude”: 41.03760692191608,
“longitude”: -73.9416790008545,
“altitude”: 25,
“source”: “UNKNOWN”,
“accuracy”: 0
},
“fineTimestampType”: “NONE”,
“context”: “K0/pXA==”,
“uplinkID”: “yZ7oMnYURKGNRCKNht5nAQ==”,
“crcStatus”: “CRC_OK”
}
],
“txInfo”: {
“frequency”: 903700000,
“modulation”: “LORA”,
“loRaModulationInfo”: {
“bandwidth”: 125,
“spreadingFactor”: 10,
“codeRate”: “4/5”,
“polarizationInversion”: false
}
}
},
“phyPayload”: {
“mhdr”: {
“mType”: “UnconfirmedDataUp”,
“major”: “LoRaWANR1”
},
“macPayload”: {
“fhdr”: {
“devAddr”: “01b2fbcb”,
“fCtrl”: {
“adr”: true,
“adrAckReq”: false,
“ack”: false,
“fPending”: false,
“classB”: false
},
“fCnt”: 250,
“fOpts”: null
},
“fPort”: 10,
“frmPayload”: [
{
“bytes”: “PLu0Tp1XmYgkp7w=”
}
]
},
“mic”: “2eb3a0e5”
}
}
]

that is your encrypted and base64 data
you are can not find all the data in live frame tab, data in this tab is intedend for debugging only.
when you get the full json in your app via post method or any other way, you will see more.

here is Kona home sensor tech. reference manual
that will help you to form the DL payload correctly.
I checked - it works
P.S.
be careful, changes form factory defaults will impact to battery life.

how do I get a full json uplink? I do not see it in the documentation

in the application, which you will need to create and make integration with it, in the Chirpstack GUI.
anyway you will need to apply the codec function to the data byte sequence, also.

I created HTTP integration.In the Device Data screen i got one uplink and one error as you said on the hour. In the uplink,i decoded data attribute using bas64: A2cA0gRoWwD/ATI=

Decoded packet

      Message Type = Join Request
        PHYPayload = 036700D204685B00FF0132

      ( PHYPayload = MHDR[1] | MACPayload[..] | MIC[4] )
              MHDR = 03
        MACPayload = 6700D204685B
               MIC = 00FF0132

      ( MACPayload = AppEUI[8] | DevEUI[8] | DevNonce[2] )
            AppEUI = FF005B6804D20067
            DevEUI = 3201
          DevNonce = 

However objectJSON attribute in the uplink message is empty.What do I need to decode to get sensor data(temperature,humidity,etc)?

because you don’t apply any codec to decode byte sequence at the app server side, object will apear after.
you have 2 ways

  1. write your own JS codec
  2. use Cayenne LPP if your device support this format

or do it directly in the application, operating with pure byte sequence from bytes field to determine data types and get the values

@eugenev
I decoded data in LORA frame and got data from it using custom JS code.I want to implement application to read this data. When I selected application, i get


I then select HTTP integration and enter uplink URL starting with http://
my script is a PHP file that outputs to a temp file. When uplink message is triggered nothing is being written to a temp file.How do I debug this?

apache access log for example.
and simple php script.

<? $data = file_get_contents('php://input').PHP_EOL; $file = 'homesensor.json'; file_put_contents($file, $data, FILE_APPEND | LOCK_EX); ?>

that should be enough to check.

@eugenev

it indicated the script was running in access.log and no pertinent lines in error.log


the script file is:

but the file is still empty

Does your HTTP integration points to this script? Is it accessible from browser? check the file permissions, owner/group etc.

HTTP integration points to a script


the script permissions

i copied URL as indicated above in HTTP integration and paste into a browser without any issues reported in access.log or error.log