Procedure to configure TTN network server for HummBox solution
Please note that the following data are necessary for the procedure :
- AppEUI : To be find on your provision file
- AppKey : To be find on your provision file
Application registration
- Login to TTN console: https://console.thethingsnetwork.org with your credentials
- Click on “Applications”
- Click on “add application”
- Fill in information and click Add application to create a new application
ApplicationID: Application ID (This id is used to create DL links)
Description: Application description
Application EUI: Default. It should be left as default, and can be modified later in application setting
Handler registration: Choose correct regional handler
- Go to settings, and click on “EUIs” tab. Then remove the current EUI by clicking “remove”
- Click on “add EUI” to add a new one
- Type: AFBECD5647382910, and click “Add EUI” AppEUI : AFBECD5647382910
- Now the application has the correct AppEUI (Expected AppEUI).
- Add Decoder, and Encoder for “Payload Formats” in order to decode and encode messages from Base64 <-> Hexa for ULs, and DLs. Click on “Payload Formats”
- Paste correct snippets of code for each section, and click “save payload functions” to save them.
Decoder
/// function Decoder(bytes, port) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var decoded = {};
var msgLength = bytes.length;
var rawMessage = '';
for(var i = 0; i<msgLength; i++){
rawMessage = rawMessage+ ("0" + bytes[i].toString(16)).slice(-2);
}
decoded.payload_hex = rawMessage;
return decoded;
}
Encoder
function Encoder(object, port) {
var msgLength = object.payload_hex.length; //16
var payload_base64=[];
for(var i =0; i< msgLength; i=i+2){
var temp= object.payload_hex[i] + object.payload_hex[i+1];
payload_base64.push(parseInt(temp, 16));
}
return payload_base64;
}
- Add a new integration to send ULs to HummBackend. Click on “add integration”, and choose “HTTP Integration”.
ProcessID: Process ID
Access Key: Choose the default one
URL: https://backend.humm-box.com/lorattn?key=1aef640e33ec760b5032ed72dfb5c586
Leave Authorization, Custom Header Name, and Custom Header Value blank.
Click on Add integration to finish.
Device registration
- Click on “Devices”, and “register device” after.
Fill device information and click “Register” to add new devices to the application
DeviceID: Same as Device EUI but in lower case letter.
Example: 0004a30b0021f932
Device EUI: 0004A30B0021F932 (Example)
App Key: AFBECD56473829100192837465FAEBDC (Mandatory)
- Make sure Device setting is in OTA mode. This can be checked in Device Settings tab
- After creating device successfully, it will be shown in the device list.
- Press the button of the HummBox to get the get the uplink message
Downlink configuration
- Choose a device from ‘Devices’
- Use ‘DOWNLINK’ section to schedule a downlink
Scheduling: replace
FPort: 0
Check Confirmed
Payload: bytes
Put hexa DL message and click Send
- Scheduled DL message will be sent back to device when the device sends an UL
- The DL message can be observed and checked in ‘Data’
Commentaires
0 commentaire
Vous devez vous connecter pour laisser un commentaire.