How to configure the repeater (LoRaWanRelay)

Good day,
I am actually trying hard to configure a gateway-relay or repeater.
I tried to follow this LoRaWanRelay documentation and I guess I am close to the result, but I need your help if you have an expertise.

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 ma mac with a USB a card and it act as a USB stick. I can past the bin file to the discovery 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.

That’s correct?
If yes, and supposing, I have 3 nodes out the range of the gateway, and the repeater between my gateway and the 3 nodes, and as I only create a devise (name repeater), how TTN will distinguisg the messages of 3 nodes?

Let say, my nodes 1 and 2 are in the gateway range. In my TTN console I created two devises for node 1 and 2…

My nodes 3,4 and 5 are out the range and in my TTN i created a devise for the repeater.

How will be distinguished my message from node 3,4 and 5?

It’s not clear for me, why we need to create a devise per node, and in the [GatewayRelay doc](http://I supposed again, I first need to create a new devise in my TTN console ) they do not mentionned that?

Some one could clarify me the configuration of the repeater? That would be great!!!

And what about the Node-Red relay manager? It should be installed on my Apache server? or where?
Is mandatory to use it? If someone can explain me how Node Red relay manager works and how it need to be installed/configured, that would be great!! The doc it’s not so clear for me, the novice :slight_smile:

(I hope I was clear and provide you enough information. Feel free to ask more and thank again for your help)

Thank a lot

Do I have chance to meet someone who already configured a LoRaWanRelay with ST LRAN discovery kit and the gitub exemple?
That would be great, I have diffuclties to understand how it make it working.
Many thank

Hi Pierrot10,
I am successfully using STM32 Discovery board for my project

that’s good news ! then you can help pierrot10

thanks

How may I help you?

1 Like

Oh yes, could you share? It would be great if you can describe step by step. In my case, my problem is how to configure and how to flash.
Two day ago, I try to copy past my MiniMouse.bin file, but each time the board was unmounted and nothing was copied.
In any case, when I will complete that task successfully, I will resume and write a short tuto for the novice and make it usefull for the community. Many many thank
PS: I observed, I have not update my post

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

Hi Pierre,
I am very tight with time to meet a deadline but would like to see if I can make some time for you.
First of all I am not using Linux, I use windows but my instructions wont be far from how it is done in Linux.
To start with, i tried to use the source code (I-CUBE-LRWAN) provided by STM without modification. There are 3 different examples of codes ATSLAVE, EndNode and PingPong. The first two can connect to the gateway but PingPong is for 2 end devices. Read these files for directionsExamples of AT commands on I-CUBE-LRWAN - Application note.pdf (631.9 KB)
I also got help from these links.B-L072Z-LRWAN1 Discovery kit · Microshare and https://www.hackster.io/victorffs/environmental-sensing-using-lora-and-stm32-c0136e

Try it and let’s continue. I hope it helps
Thanks

Dear Uguoc, thank for your reply. I also have a PC and I can do it again from start with my PC. I am busy right now as well and my PC is not with me. But I can follow your instruction with my PC. I will read it carefully your comment, later (with my PC), but many thank for any help you can provide within your time. I keep you informed, Cheers and Tks

Hi everyone,
I’m having some problems working on the LoRaWANRelay; I think I succeeded in programming the Discovery Board with the bin file MiniMouse, by copy and paste the file itself; my device seems to communicate with the gateway, since the gateway receives periodically udp packets, but if I send some packets from my device, I’m not sure that they reach the gateway. The other problem is with Node Red, since I have created a virtual gateway as explained on the README but it seems that it is not working: on the Node Red dashboard I don’t have any packet information and on TTN the virtual gateway is not connected. Did anybody succeed in the implementation of this virtual gateway. Thank you in advance.

Hello
I wonder if someone has some new in that topic. I was waiting for Things Conference 2020, hoping I could get help with this topics this week.

To resume my issue, as far as I know.

I suppose, the problem is arond this topic #7.

I am confuse how to configure the /UserCode/MainRelay.ccp and hwo to setup my devise at TTN console

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 

And what about Node-Red?

@UGUOC,
Do you have time now to explain how you did it (step by step :slight_smile: ) ?
That would be very great!!

Thank a lot

Anyone working for this Lorawan relay? I still can’t configure successfully for virtual gateway. I’m having issue with downlink from network server to configure the relay.