Developer Portal
[/color]Sending downlink messages
All downlink messages should be sent to:
https://loradeveloper.mendixcloud.com/rest/sendkpnloramessage
and contain the following query parameters:
- DevEUI of your device
- FPort used within LoRa (developer portal only allows port 1)
- Payload formatted as hex
- AS_ID that identifies you. You can find your AS_ID at you profile in the developer portal.
- Timestamp formatted as ISO time
Example
DevEUI=000000000F1D8693&FPort=1&Payload=00&AS_ID=app1.sample.com&Time=2016-01-11T14:28:00
Also a token should be added by computing it from SHA-256
SHA 256(DevEUI=000000000F1D8693&FPort=1&Payload=00&AS_ID=app1.sample.com&Time=2016-01-11T14:28:0046ab678cd45df4a4e4b375Eacd096acc)
Remember that the can be found at you user profile in the developer portal and is 46ab678cd45df4a4e4b375Eacd096acc in this example.
The resulting is encoded as an hex string (e.g. b5a84fe9c8921e9de359e3041a37b76c4b122f6f9b83577b5596c842052f7e62) AND added at the end of the query parameters line
Complete example
https://loradeveloper.mendixcloud.com/rest/sendkpnloramessage?DevEUI=000000000F1D8693&FPort=1&Payload=00&AS_ID=app1.sample.com&Time=2016-01-11T14:28:00&Token=b5a84fe9c8921e9de359e3041a37b76c4b122f6f9b83577b5596c842052f7e62
[color=green]
Thingpark
[/color]Developers can send downlink messages using the HTTPS Post API of Thingpark at https://api.kpn-lora.com/thingpark/lrc/rest/downlink.Messages should contain the following query parameters:
- DevEUI of your device
- FPort used within LoRa
- Payload formatted as hex
- AS_ID that identifies you. You can find your AS_ID at you profile.
- Time Time of your server formatted as outlined below
- Token as a SHA 256 signature
The timestamp should be your server time in the following format:
code:
YYYY-MM-DDThh:mm:ss.fff+|-hh:mm (eg 2016-08-01T09:06:06.000+02:00)
Where:
- YYYY = four-digit year
- MM = two-digit month
- DD = two-digit day
- hh = two digits of hour (00 through 23)
- mm = two digits of minute (00 through 59)
- ss = two digits of second (00 through 59)
- fff = three digits of millisecond (000 through 999)
- +|-hh:mm = timezone designator (+hh:mm or –hh:mm)
It appears that there are a few inconsistencies in how Thingpark handles timezones. This will be solved in comming releases. Also the '+' in the querystring is sometimes ignored in some situations, creating problems with the SHA256 generation. The most straightforward method seems to use the UTC or ZULU timezone with this format:
code:
2016-08-01T09:06:06Z
Below is an example of a valid HTTPS POST message, note that you will have to use your own DevEUI and generate your own token with your LRC-AS key
code:
https://api.kpn-lora.com/thingpark/lrc/rest/downlink?DevEUI=0059AC0000178DA0&FPort=1&Payload=beef&AS_ID=example.test&Time=2016-09-02T15:39:01Z&Token=4d745a44312785aacf261a5d3a99cf80a2819c88818def6e5140e78e4e006fd3
When a downlink message is received succesfully, a HTTP response will tell you that the LRC queued your request.
Downlink Queue information
- Messages are queued until next uplink frame, there is no time limit.
- 5 messages can be queued PER DEVICE. The oldest is removed if a new one is queued.
- Queue cannot be changed or viewed by the customer.
Example
The IoT Academy Github contains a step-by-step explanation about how to implement an application server in NodeRed: https://github.com/iotacademy/NodeRed_KPN_LoRa/wiki .
[color=green]
Useful links
[/color]- [color=#094ab1]LoRa:[/color] Starters Guide- [color=#094ab1]LoRa:[/color] Forum and Manuals
- [color=#094ab1]LoRa:[/color] Geolocation
- [color=#094ab1]LoRa:[/color] Dictionary & Definitions
- [color=green]FAQ:[/color] Frequently Asked Questions
- [color=green]Tools:[/color] www.LoRaTools.nl