cancel
Showing results for 
Search instead for 
Did you mean: 

Change transmit (Tx) interval for LoRaWAN software

Albin1
Associate II

Hello!

I have a NUCLEO-L073RZ development board, with the SX1272MB2DAS LoRa RF expansion board (from Semtech). I have downloaded code for it here at ST at: https://my.st.com/content/my_st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/i-cube-lrwan.license=1554282163016.product=I-CUBE-LRWAN.version=1.2.1.html

I have managed to get the code running, and I get contact with a gateway and can upload data to the server I want. The problem I have is that I can't find where I tell the board how often it should transmit the data. Currently the board transmit the data at the start when it get a connection to the gateway, and then 150 seconds later. After that it follows the pattern +165s in, +25s in, which repeats over and over. I wish to transmit the data to the gateway once an hour. How do I change this?

I have managed to find a constant that tells the board how often it should save data to AppData.Buff, which is the buffer that LoRa transmits. No matter how long or short that constant is it still transmits the data at the ~150 seconds interval.

If anything is unclear I can try to clarify further.

Kind regards,

Albin

9 REPLIES 9
OCumm.1
Associate II

Hi Albin,

I realise this is quite an old topic now, but did you ever resolve this? I am currently looking for the same thing.

Thank you,

Odhran

Hey Odhran!

I’m glad that someone else needed to use the card in a similar way as I did, when no one answered here I assumed my problem was something you �?shouldn’t do�? on the card.

I did manage to come up with a solution, a really simple one really. But hey, it works. Almost at the start of the main.c file there’s a defined dutycycle:

#define APP_TX_DUTYCYCLE x   // x = time in ms

If I remember correctly, when that dutycycle number has been reached a flag will be raised which allows the circuit to make a transmission. So my solution was to change that number to however long I wanted it to wait. The shortest time that worked fine for me was 165 000 ms because of the pattern I wrote about in the post. I did try times up to 1 hour successfully, which is the time I needed, but it will most likely work with longer times as well.

I hope this solution can help you as well!

Kind regards,

Albin

Fde W.1
Associate II

Hi Albin,

I am currently still having this problem. I tried to set APP_TX_DUTYCYCLE to 5000ms.

This doesn't change a thing for me, i still get the 150 second waiting time between my two packages.

Do you have any other idea to fix this.

Looking forward to your response,

Kind regards,

Frank

Hello Frank!

As I wrote to Odhran previously the shortest time that worked 100% of the time for me was 165 000 ms, so 165 seconds. Maybe 150 seconds also works fine, I never tested it that much since I just needed to be able to choose a time at all. I never found any way to get it to transfer packages more often though sadly.

Good luck,

Albin

Hello Albin,

I did now tried every 5 min so 300 000 ms. But after like 3 sends the software is resetting, did you also had this problem?

My goal is to sent data once every hour or even bigger time gap between the sending.

Hey!
That’s odd. I only tried with 165 seconds and made that run 10 times for a test I was doing. Sadly I don’t know why your software is resetting. When I had problems like that I put out break points in the code to try and pinpoint where the unwanted behaviour started. It was tedious and annoying though since the code is basically �?spaghetti code�? that goes from file to file, pointers to functions and is just a mess in general. Which made the code really hard to understand.
Since I never got any answer on this post I had to waste a lot of time trying to understand the code, and in the end I barely understood the very basics of how it works. Once the code was running the way I wanted it to I just accepted it and didn’t dare alter anything else. So sadly I can’t help you more with your project... :\
Fde W.1
Associate II

Hey,

Thank you for your quick replies.

Too bad that nobody have some knowledge about this.

I put the time to 3 600 000 ms. and around every 15 min the code sent's a new message:

The counter is also 1 again at the TTN server so it looks like a reset of the code. (last post i said 3 times 5 min = 15min is the same.

I guess there is like a hard reset after 15 min using this software.

Could you maybe test this if your project is doing the same, if you still have it ofcourse.

Otherwise thank you for your help!

Kind Regards,

Frank

Hey,
Sadly I don’t have the board anymore so I cannot test that on my project. When the board is connected to the computer with the USB cable it should be printing information to the computer that you can read with a program like Tera Term (maybe you already know that if you’ve managed to connect LoRa). You could write some print functions in the code to try to figure out what is happening with different variables? They should appear in the Tera Term program like the LoRa information did.
The test I ran took about 28 minutes, and it worked fine for me. So there shouldn’t be any such software reset in the code. Sadly without the board I can’t help any more.
Good luck!
Albin

Hey,

Thanks,

And yes i used TeraTerm to see the prints, but after 15 it looks like the connection with the teraterm is gone also.. dont see any new prints.

Thank you for your help, maybe somebody else will answer this, but i have a bad feeling since nobody replied to your case since 1 year.

Frank