Arduino Forum

Using Arduino => Networking, Protocols, and Devices => Topic started by: edugimeno on Mar 20, 2019, 12:31 pm

Title: Issues with LoRa module and library
Post by: edugimeno on Mar 20, 2019, 12:31 pm
Hi There! Im building a LoRa GPS Tracker. This is for a School HAB balloon project I'm helping the students with.
Im using a "BSFRANCE lora32u4" board. This is basically a clone for the Adafruit Lora 32U4 board.
I'm using the LoRa library that comes with the library manager

First issue I have, is that some example sketches try to initialize the LoRa interface with a call to LoRa.Begin(BAND, PABOOST), where there's a second parameter for either activate or deactivate PABOOST. Most of the libraries Im finding don't allow this second parameter, can you confirm if this is needed?

Also, my sketch is getting stuck while sending, after 3 or 4 packets. It gets caught in the middle of the call to LoRa.EndPacket (). This is something that I've found to be reported on some other threads but it looks like there's no solution for this. Some people have suggested to remove the "while..." section at the EndPacket code, but many discourage them to do so.

Has anyone had these issues with this library? Im really stuck and need a working solution to track this thing!!! :)

Thanks in advance!
Eduardo
Title: Re: Issues with LoRa module and library
Post by: pylon on Mar 20, 2019, 03:35 pm
The LoRa (exactly that name) library available in the IDE supports only one parameter (frequency) for it's begin() method. As there are almost a dozen libraries for LoRa available in the IDE, provide it's exact name and maybe the developer to identify.
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 20, 2019, 06:03 pm
Has anyone had these issues with this library? Im really stuck and need a working solution to track this thing!!!
Does rather depend on which library it is ?

If others have had problem with the library, and the author has not posted a fix (nor anyone else), perhaps use another library.

Failing after just sending 3 packets does not sound good.

Once the balloon is launched its kind of important that the code is stable, if its not, you may not get your balloon payload back.
Title: Re: Issues with LoRa module and library
Post by: Riva on Mar 20, 2019, 07:02 pm
For what it's worth I use the Sandeep Mistry LoRa library here (https://github.com/sandeepmistry/arduino-LoRa) with both LoRa32u4 and Heltech ESP32Lora modules and find it works well for my needs.
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 20, 2019, 08:19 pm
I've reverted to using this one:
http://bsfrance.fr/documentation/11355_LORA32U4II/BSFrance.zip (http://bsfrance.fr/documentation/11355_LORA32U4II/BSFrance.zip)
For some reason this one allows the use of the PABOOST additional parameter during Begin method. Not sure what I get here.

Quote
Once the balloon is launched its kind of important that the code is stable, if its not, you may not get your balloon payload back
Believe me this thing is not being released until I have a trustworthy sketch sending tracking updates for 6-8h at least...:)

I tried the Sandeep library too with similar results. I'm starting to suspect maybe the board is not very reliable

Also this is another SILLY issue. I have lots of antennas at home which I've been buying for years. Right now it's hard for me to tell which ones are 900Mhz or 2.4GHz... Because I've also read about people having the "stuck into EndPacket" call when the antena is missing or is not well matched....
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 20, 2019, 11:51 pm
I've reverted to using this one:
http://bsfrance.fr/documentation/11355_LORA32U4II/BSFrance.zip (http://bsfrance.fr/documentation/11355_LORA32U4II/BSFrance.zip)
For some reason this one allows the use of the PABOOST additional parameter during Begin method. Not sure what I get here.
For what reason do you 'think' you need to use PABOOST in the first place ?

The PABOOST, for modules that support it,  only 'boosts' the power from 17dBm to 20dBm, not a lot of a boost really.

Do you need such a high power as 20dBm (100mW) ?

A lower power of 14dBm (25mW) of LoRa will get you 700km+ range, ground to high altitude balloon, do you really need  more ?

   
Title: Re: Issues with LoRa module and library
Post by: freaklabs on Mar 21, 2019, 08:40 am
I would say if the full power is available (20 dBm), might as well crank it up there. As long as you have good power management, the additional energy it takes is not so much.
Title: Re: Issues with LoRa module and library
Post by: Riva on Mar 21, 2019, 08:56 am
I tried the Sandeep library too with similar results. I'm starting to suspect maybe the board is not very reliable

Also this is another SILLY issue. I have lots of antennas at home which I've been buying for years. Right now it's hard for me to tell which ones are 900Mhz or 2.4GHz... Because I've also read about people having the "stuck into EndPacket" call when the antena is missing or is not well matched....
I may be miss representing this but I feel I have read somewhere that powering LoRa without an antenna (or the wrong frequency) damages them very easily.
Powering any transmitter without a matched antenna can cause problems/damage but maybe LoRa takes it hard.
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 21, 2019, 09:26 am
I would say if the full power is available (20 dBm), might as well crank it up there. As long as you have good power management, the additional energy it takes is not so much.
If you only need 1dBm for an application, then use that.

Using excess power, whether legal or not, causes unecessary interferance, being considerate to other users of the spectrum is surely a good idea ?

In the UK LoRa is now often used for tracking high altitdude balloons, we are restricted by regulation to 10mW, but with LoRa no more than that is required, its good for many hundreds of km.
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 21, 2019, 09:32 am
I may be miss representing this but I feel I have read somewhere that powering LoRa without an antenna (or the wrong frequency) damages them very easily.
Powering any transmitter without a matched antenna can cause problems/damage but maybe LoRa takes it hard.
No its true.

I have damadged quite a few in my time, I dont think they are more likley to be damadged than other RF modules, but they dont like transmitting with no\poor antennas. 
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 21, 2019, 12:26 pm
For what reason do you 'think' you need to use PABOOST in the first place ?

The PABOOST, for modules that support it,  only 'boosts' the power from 17dBm to 20dBm, not a lot of a boost really.

Do you need such a high power as 20dBm (100mW) ?

A lower power of 14dBm (25mW) of LoRa will get you 700km+ range, ground to high altitude balloon, do you really need  more ?

   
I've used LoRa may times in different projects, I've always used base power and SF=6 or 7.
If there's a project where I believe that full power is required is this one. This balloon may travel 150-250Km assuming normal weather conditions. We may lose its signal during "landing" and may have to search it again when it's already on the ground, starting from a distance that might be far away. And this project will only last 4-6h in total, that its full life, so that's the maximum time it will intefere with the rest of the world. After we recover the payload, it won't transmit again.

Believe me this is the only situation when I would go for the max power available. Those extra db may make the difference between losing the payload forever or recovering it
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 21, 2019, 12:35 pm
I may be miss representing this but I feel I have read somewhere that powering LoRa without an antenna (or the wrong frequency) damages them very easily.
Powering any transmitter without a matched antenna can cause problems/damage but maybe LoRa takes it hard.

That's absolutely true, I am also a radio amateur and have worked a lot with SWR and antenna matching, ham radios get their final transistors destroyed in seconds while transmitting with a unmatched antenna or without antenna. TBH smaller power radios are less prone to failing in these conditions, but there's still a probability.

In my case, I know that I've had the Tx section ON for some small time and so far I've been lucky and not destroyed any.

In any case, it would destroy the RF-Out section for the module, but I believe the logic that "talks" to the library would still be alive.

These modules in particular do work, I upload the basic Lora_Send and Lora_receive, take them apart several hundred meters and they work flawlesly. It's when I make my program more complicated when things start to work randomly...
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 21, 2019, 04:48 pm
Problem with high altitude balloons is the size of interference foot print they can create. Use full power and the signal will cover an area of around 1 million square kilometers. The same transmitter on the ground would only cause same issues over maybe 5 square kilometres.

The requirements for in flight tracking are threfore very different to the requirements for ground range searching. When the balloon has stopped moving, flip to higher power (if needed) and SF12, you will then have the range you need for ground searching, without the need for excessive power in flight.
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 21, 2019, 05:21 pm
The requirements for in flight tracking are threfore very different to the requirements for ground range searching. When the balloon has stopped moving, flip to higher power (if needed) and SF12, you will then have the range you need for ground searching, without the need for excessive power in flight.
That's a good idea.
Anyone, I don't have any experience with LoRa out of the Ground-to-Ground scheme. And I'm getting distances of 6-10Km depending on the scenario.
Now talking about Air-to-Ground. Do you know, for a fact, that I will be able to pick these signals with no issue, even when the ballonn has already moved 100 km away, from the ground, at SF=7 with no problem? I don't have any way to test this other than risking to lose all the payload if I happen to actually lose the signal...

Thanks
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 21, 2019, 06:28 pm
Ok there's definitely something different on these boards.
Some days ago I started all my tests again with "basic" parameters, just in case:

SF=7
No CRC
No SyncWord
NO PABOOST

Today I kept experiencing the random loss of signal in the receiving lora device, even at short distances, of 3-5 ft
I added the RSSI measurement to the debug output in the RX. This surprised me:

At 3ft distance between antennas, I was getting RSSI of -125 to -135, and half of the times the payload was garbled

That's why I started suspecting my antennas. Because I have a bunch of them from older projects and I wasn't sure if they were 0.9 or 2.4GHz. So I removed the antennas, and soldered a 8.6cm wire to the ant pad, as this is a method that I've used in the past with very good range results

Still, no change. Same poor RSSI. Tried other BSFrance boards I have at home, both in the Tx and Rx side. No change. Tried these other boards with the wire antenna too. No change

Tried to re-activate PA BOOST.

BIG CHANGE. Rssi came down to -40 at short distance. -70 at opposite ends of the house.
Tried the subber antenna. Same result (So I guess they were valid).
So this makes me wonder why the power on this devices is so low until I activate the PA BOOST parameter.

Can any one explain what it does? Anything else than "unlocking" a higher power? Or does it change anything else?

Anyway I see that Im going to "fly" with this PABOOST parameter ON
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 21, 2019, 06:32 pm
Now talking about Air-to-Ground. Do you know, for a fact, that I will be able to pick these signals with no issue, even when the ballonn has already moved 100 km away, from the ground, at SF=7 with no problem? I don't have any way to test this other than risking to lose all the payload if I happen to actually lose the signal...
I have had two way comms to a LoRa tracker on a foil party balloon @ 240km, @434Mhz, @10mW, @BW41700, @SF8, a record at the time, read about it here;

HAB Tracking at Breakfast (https://github.com/LoRaTracker/Test-Reports/blob/master/HAB%20Tracking%20at%20Breakfast.doc)

Distances of 400km and 500km have been reported in the UK, where we are limited to 10mW.

If you unsure, just arrange to be able to remotly configure the tracker so that you can change the power levels to suit etc.  
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 21, 2019, 06:56 pm
WOW!!! So I'm definitely aiming too high if that's the case.
The thing is, like I said before, once you release the balloon there's no way back (you know this), so if things don't work like you expected, the whole project is gone...

With this I mean that I would try to get the code and everything as simple as I can. I may pick a SF a little above what I would expect to be valid and try to use the best antenna I can.

Now that you've done this before, let me ask you something if you don't mind.

What antenna did you use both for the payload and the chaser?
What GPS module did you use? I'm using for these tests the NEO-6M Ublox GPS but this one doesn't go beyond 18Km in height, so Im awaiting for a NEO-8M to arrive, which does go beyond 18Km.

Any help on this topic would be appreciated, Im a teacher collaborating with 9 kids in this school project and I can't fail with this :)

Thanks in advance
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 21, 2019, 07:11 pm
WOW!!! So I'm definitely aiming too high if that's the case.
The thing is, like I said before, once you release the balloon there's no way back (you know this), so if things don't work like you expected, the whole project is gone...

With this I mean that I would try to get the code and everything as simple as I can. I may pick a SF a little above what I would expect to be valid and try to use the best antenna I can.

Now that you've done this before, let me ask you something if you don't mind.

What antenna did you use both for the payload and the chaser?
What GPS module did you use? I'm using for these tests the NEO-6M Ublox GPS but this one doesn't go beyond 18Km in height, so Im awaiting for a NEO-8M to arrive, which does go beyond 18Km.

Any help on this topic would be appreciated, Im a teacher collaborating with 9 kids in this school project and I can't fail with this :)

Thanks in advance
Balloon tracker uses a 1/4wave vertical (pointing downwards) with 1/4wave radials made out of guitar wire. Ernie ball custom gauge 13.

My base station antenna is a Diamond X50N, its got most of its gain at a low angle to the horizon, which is where you want it.

For a chaser, normally a small mag mount on a car around 5dBi. For ground based searching I use an Arrow satellite 7 element yagi, brillant antenna.

The Ublox GPS should work above 18km, at least the geniune ones should when configured. In the UK the Ublox MAX8Q is common for HAB flights.

There are alternativces to the Ublox GPSs that are heaps cheaper, see this report on GPSs;

GPS Performance Comparisons (https://github.com/LoRaTracker/GPSTutorial/tree/master/GPS%20performance%20comparisons)

Although I have not tested the Quectels at altitude yet.
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 21, 2019, 07:21 pm
I really appreciate all your info about antennas. I will start building them soon.
About the GPS model, why did I read somewhere that the 6M is limited to 18km? Also in the page you point to, it states "all 3 have a high altitude mode allowing operation above 18,000M"
So is this something that can be activated thru serial commands in the module?

The problem is like before...I need to be 100% sure they do work, I can't test before.

The 8M modules are on its way anyway

I get really bad times for first fix (with a partially clear view from a terrace), sometimes above 5mins for first fix, Im using this small rectangular (like 3cm x 1cm) antenna, hopefully the 8M comes with the larger square antenna

Now I realize the guy in the article mentions "No fix" with the 6M module and small antenna. That's my configuration now, no wonder why it takes so long..it didn't even work for him.

Thanks!!
Edit: With the small recxtangular antenna I refer to 3B on this picture, and large square is 3A on this picture:
https://raw.githubusercontent.com/LoRaTracker/GPSTutorial/master/GPS%20performance%20comparisons/Pictures/GPS1A.jpg (https://raw.githubusercontent.com/LoRaTracker/GPSTutorial/master/GPS%20performance%20comparisons/Pictures/GPS1A.jpg)
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 21, 2019, 07:44 pm
The geniune Ublox 6 GPS, and there are fakes out there, should be configuarable by serial command for operation up to 50,000M.

See the 'Navigation Configuration Settings Decription' part of the receiver protocol datasheet.

Extended fix times on the ground are not a show stopper, as soon as the balloon rises a few hundread feet in the air its view of the horizon ands hence GPS normally improves.

The Quectel GPSs had a noticably better signal performance than the equivalent Ubloxes, see the charts and fix times in the report.

Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 21, 2019, 08:01 pm
Ok, yes I read about fake chips. I know there's a program out there to configure the Ublox modules, but mine is already soldered to the LoRa Board, do you know if using a serial-bypass I can configure all the parameters in the GPS?

Yes that's true, once above the ground the GPS will get much better signal, but for these tests at home the fix time is really annoying :)

For now Im sticking to this module, we are planning for a pre-final test launch shortly and purchasing another GPS would probably get into a timing issue.

Thanks!
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 22, 2019, 11:07 am
I can configure all the parameters in the GPS?
Configure it over serial, either from Arduino or using Ubloxes Ucenter utility.

Details of configuration for high altitude mode, are in the navigation configuration part of the GPSs protocol description manual.
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 22, 2019, 12:10 pm
Configure it over serial, either from Arduino or using Ubloxes Ucenter utility.
Ok I uploaded the "SerialPassThru" sketch to my arduino, downloaded the Ucenter tool, and it does connet well to the GPS with the Arduino in between.
All I have to change is in NAV5 switch from Dynamic Model->0-Portable to 6-Airborne<1G?

Is this it? Is there any way to actually confirm that these GPS is fully capable of >18km=

Thanks a lot!!
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 22, 2019, 03:27 pm
Ok I uploaded the "SerialPassThru" sketch to my arduino, downloaded the Ucenter tool, and it does connet well to the GPS with the Arduino in between.
All I have to change is in NAV5 switch from Dynamic Model->0-Portable to 6-Airborne<1G?

Is this it? Is there any way to actually confirm that these GPS is fully capable of >18km=

Thanks a lot!!
See here;

https://ukhas.org.uk/guides:ublox6

Testing the GPS is easy, you put it on a high altitude balloon and if its not configured right it will stop working once it reaches a certain altitude.
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 22, 2019, 04:01 pm
See here;
https://ukhas.org.uk/guides:ublox6
Got it. I changed it and saved it. So it should be ready.

Testing the GPS is easy, you put it on a high altitude balloon and if its not configured right it will stop working once it reaches a certain altitude.
Haha yes I know, but as you know for that I need a permission for each launch, a balloon/parachute, etc...Anyway we're doing our pre-final launch within one month.

I have several types of batteries. I've heard that Li-xxx batteries are the best for cold wetaher. I have lots of LiFePO4 batteries but they are rated at 3.2v and in this board there's a LDO 3.3v regulator which will surely turn off slightly above 3.3, too close to its nominal voltage.

I will probably switch to LiPo batteries, with a nominal voltage of 4.2v. Other option is non-rechargeable batteries like Energizer Lithium 1.5v batteries but I would need at least 3 of these to reach the minumum voltage for the regulator.

Which route did you take on this subject?

Thanks again
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 22, 2019, 04:17 pm
Which route did you take on this subject?

Well, one of the batteries you mentioned is used quite often.

Ideal mini project for class I would have though, which batteries are good in the cold.

Chuck them in the freezer for a while, insulate them so they stay cold, and then measure the voltage under load.
Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 22, 2019, 04:24 pm
Well, one of the batteries you mentioned is used quite often.

Ideal mini project for class I would have though, which batteries are good in the cold.

Chuck them in the freezer for a while, insulate them so they stay cold, and then measure the voltage under load.
Hey I'm not a student, I'm their teacher!! LOL

They are already working on lots of other matters related to this, and they are building an arduino datalogger that stores X/Y, altitude, temperature, pressure and other data in a SD card to get the data when the payload is recovered.

But I offered them to build the gps tracker by myself, it seemed too much for them.
I would test what you are saying, but Im expecting -50->-60ºC up there but freezers here don't usually go under -15..-20ºC...
Title: Re: Issues with LoRa module and library
Post by: srnet on Mar 22, 2019, 07:14 pm
I would test what you are saying, but Im expecting -50->-60ºC up there but freezers here don't usually go under -15..-20ºC...
Sure, and the feeezer in my house only goes down to -17C.

But its a start and -17C is at least an indication of what might happen at much lower temperatures.

Title: Re: Issues with LoRa module and library
Post by: edugimeno on Mar 23, 2019, 08:43 pm
I will probably use 3xAA Li Energizer batteries. I've seen a tutorial (probably yours) where 2xAA batts were used after removing the on board regulator and disabling the low-volt detector, but I don't want to modify this board. 3 batts is only 15 gr more than 2 batts, removing the regulator saves some power but I think this setup would still last several days...all I need is 6-8-h...:)

Working on the diy antennas now

Thanks!