Hi all,
I'm currently working on developing a server for testing things with LoRa. So far I have managed to receive and parse data from a mote.
However, I want to be able to send a message back to the mote. Using the semtech iot website I am able to get a mac_rx 3 but I am not able to create the same dataframe myself. I have tried several methods of encrypting the payload but the format does not look similar to what I'm getting back from Semtech.
Semtech: oPh6GwAgAAQDNricc8/5dFC20I9dM93WhAh7gA
Mine: cgQejHfk
Which should obviously be the same format.
Flow I'm using now (pseudo)
String to base64 (using new Buffer("string", 'base64');
Ai = [0x01, 0x00, 0x00, 0x00, 0x00, 1, devAddr[0], devAddr[1], devAddr[2], devAddr[3], fCntDown[0], fCntDown[1], fCntDown[2],fCntDown[3], 0x00, i]
i = 1 > Data is 16 bytes
iv = 00000000000000000000000000000000;
Si = CryptoJS.AES.encrypt(A, AppSKey, {mode: CryptoJS.mode.ECB, iv:iv, padding: CryptoJS.pad.NoPadding});
result = String XOR Si
Does anyone have a flow or example code (preferably javascript) to encode a text string for sending downstream?
Thanks!