How to configure the repeater (LoRaWanRelay)

Dear UGUOC,

The problem I have , I can not flash the code to my Discovery board. Secondly, I have not understand well how to configure the dicovery code. I observed, I have not update my first post, then I resume and continue whit it.

FLASHING THE CODE

I bought the ST B-L072Z-LRWAN1 Discovery kit and I did the following step:

  1. We dowloaded this (for Mac) to ~/Download
  2. I dowloaded this and copy the files to /usr/local/gcc_arm
  3. I edited ~/.profile and added the line
  4. export PATH=$PATH:/usr/local/gcc_arm/gcc-arm-none-eabi-8-2018-q4/bin
  5. I cd ~/Download/LoRaWionanRelay-master
  6. I lunched Make from ~/Download/LoRaWanRelay-master
  7. All went fine.

After the Make I got a new folder named ~/Download/LoRaWanRelay-master/build with a lot of different files, with some extention like .lst and .o and .d, and finally a file with .bin extention.

I connected my discobery board to my macbook air with a USB a card and it act as a USB stick. I can past the bin file to the discovery board.

In reality, I can not copy/past the MiniMouse.bin When I try to do it, my Discovery board is unmounted as soon as I past the file. At the end, nothing is copied. Then I wonder if my previous tasks was correct. How would I program the dicovery code?

CONFIGURATION OF THE BOARD

But I am confuse about how to configure the repeater. Here there are some instruction.

I supposed again, I first need to create a new devise (named repeater) in my TTN console and hen I edited the file UserCode/MainRelay.ccp and I have to change the above keys with the keys of my application/devise. It’s what I did yesterday.

I should now compile with make and past the new MiniMouse.bin file to my discovery kit.

In the UserCode/MainRelay.ccp file there are those lines

uint8_t LoRaMacNwkSKeyInit[]      = { 0x22, 0x33, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11};
uint8_t LoRaMacAppSKeyInit[]      = { 0x11, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22};
uint8_t LoRaMacAppKeyInit[]       = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0xBB};
uint8_t AppEuiInit[]              = { 0x70, 0xb3, 0xd5, 0x7e, 0xd0, 0x00, 0xff, 0x50 };
uint8_t DevEuiInit2[]             = { 0x38, 0x35, 0x31, 0x31, 0x18, 0x47, 0x37, 0x51 };
int i;
uint8_t UserRxFport ; 

#ifdef RELAY
    uint32_t LoRaDevAddrInit   = 0x260114FC;
    uint8_t DevEuiInit[]       = { 0x38, 0x35, 0x31, 0x31, 0x18, 0x47, 0x37, 0x57 };    
    sLoRaWanKeys  LoraWanKeys  = { LoRaMacNwkSKeyInit, LoRaMacAppSKeyInit, LoRaMacAppKeyInit, AppEuiInit, DevEuiInit, LoRaDevAddrInit,OTA_DEVICE };
#else
    uint8_t UserFport = 3 ;
    uint32_t LoRaDevAddrInit   = 0x26011695;
    sLoRaWanKeys  LoraWanKeys  = { LoRaMacNwkSKeyInit, LoRaMacAppSKeyInit, LoRaMacAppKeyInit, AppEuiInit, DevEuiInit2, LoRaDevAddrInit,APB_DEVICE };
#endif 

I supposed, I have to modify the key according to my TTN devise, but I am not very sure how to do it.
What I did, is the following.
From my TTN console, I created a new devise I named it ‘repeater’ and I copied the Network session key, the App session key and the address to the above code , I pasted.

But I am really not sure about this steps because if I have two or three nodes ouside of the gateway range (let say node3, node4, node5). How TTN will distinguish the node3 or the node 4 or the node5. I am asking this because the documentation said to create one TTN devise for the repeater. I am a bit surprised because I should create (at TTN consol) a devise for node3, a devise for node 4 and a devise for node5.

This part is a bit vague for me. It the reason why, it would be great if you can tell us, which tasks we should performed. In my case, I have two nodes in the Gateway range and 3 nodes outside of the gateway range. The repeater should be able to transmit the message of node3,4 and 5 to the gateway. But how to configure the repeater (the relay) and how should I create devises in TTN console?

Finally, if you are working with Mac, how to you flash the code?

And last question, what about Node-Red?
I believe, it should be installed on my remote web sever but it’s not necessary needed if we do not need to filter the node transmitting message throuth the repeater (relay)

Thank a lot UGUOC, if you can clarify the step to make it working . That would be great if we could coordinate and write a How to for the community. It would be very helpfully!! :stuck_out_tongue_winking_eye:

(I hope I cleary explain my issue :grinning: )

Tks, Cheers
Pierre