brocaar / chirpstack-network-server

ChirpStack Network Server is an open-source LoRaWAN network-server.
https://www.chirpstack.io
MIT License
1.49k stars 546 forks source link

LinkCheckAns #30

Closed athtest800 closed 8 years ago

athtest800 commented 8 years ago

Hi! I am new to lorawan and i have a device that makes LinkCheckReq. Is it possible to implement it with LinkCheckAns on the loraserver for automatic reply-answer to the device?

brocaar commented 8 years ago

This part belongs to the responsibility of a network-controller, which is (currently) not part of LoRa Server. See also: http://docs.loraserver.io/loraserver/network-controller/. Keeping the network-controller part outside of LoRa Server enables you to add your own business logic to it :-)

athtest800 commented 8 years ago

i use node-red, mqtt output with this topic application/0000000000000000/node/0102030405060708/mac/tx and this function var dd = {"reference": "abcd1234", "devEUI": "0102030405060708", "frmPayload": false, "macCommand": "Ag==" , //is this write for LinkCheckAns (0x02)?? "data": "//8=" //here i use pre encoded base64 ?? } return { payload:dd }

But i get "unmarshal mac command error: lorawan: invalid CID 2e" dev_eui=0102030405060708 reference=abcd1234

Thank you

brocaar commented 8 years ago

There is no data field: http://docs.loraserver.io/loraserver/network-controller/#sending-data

The full mac-command (including CID) needs to be base64 encoded and put into macCommand

athtest800 commented 8 years ago

Thank you! Fixed