Project Curacao2 – Part 4 – Initial LoRa Range Results

Project Curacao2 – Part 4 –  Initial LoRa Range Results

Project Curacao2 is a redesign and rebuild of the Project Curacao environmental monitoring system that was running down on the island nation of Curacao in 2014 and 2015.   It finally died after a loose wire in the solar panel assembly (not in the panels, but in the internal wiring) finally came completely loose.   We are now using a LoRa WXLink wireless transmitters for data collection.

We have one more step to do before we start building the base Raspberry Pi Zero Project Curacao2 base unit and that is testing the LoRa radio data range.

The LoRa Range Test Setup

Project Curacao2 has two LoRa WXLink remote stations.  One on a tower located about 30 meters away from the base unit and one located about 0.5Km away from the base unit (the Ridge antenna for those familiar with the world famous Amateur Radio Station, PJ2T).  We felt it would be interesting to get the two sets of wind speed, humidity and wind direction from both sites, hence Project Curacao2 was designed to receive information from two remote, identical LoRa WXLink units.  We added one more device to the setup, a Grove Buzzer, so we could hear when the test setup received a packet without having to look at a screen.

 

 

Project Curacao2

The Software

The LoRa Range test software consists of two major parts.  First is the software used to decode the WXLink packets coming in across the LoRa link.   You can find the software that does that job in GroveWeatherPi and the Arduino code that generates and decodes the packets here:

 

# Listen on port 2947 (gpsd) of localhost
session = gps.gps("localhost", "2947")
session.stream(gps.WATCH_ENABLE | gps.WATCH_NEWSTYLE)

# home location
coords_1 = (47.676841667, -117.135241667)

everyHowManySeconds = 2
print "GPS Loop"
while True:
        try:

                report = session.next()
                # Wait for a 'TPV' report and display the current time
                # To see all report data, uncomment the line below
                #print report
                seconds=int(time.time())

                if report['class'] == 'TPV':
                        if (seconds % everyHowManySeconds ) == 0:
                                returnList = readWXLink(block1, block2)

                                #print report
                                if hasattr(report, 'time'):
                                        print report.time


                                if hasattr(report, 'lat'):
                                        #GPS location
                                        coords_2 = (report.lat, report.lon)
                                        distance = geopy.distance.vincenty(coords_1, coords_2).km
                                        print "distance in km = %0.3f"% distance

                                if (WXLink_Data_Fresh):
                                        LoRaReceived=1
                                        WXLink_Data_Fresh = False
                                        LoRaMessID = returnList[14]
                                        // do a double beep
                                        GPIO.output(4,1)
                                        time.sleep(0.10)
                                        GPIO.output(4, 0)
                                        time.sleep(0.10)
                                        GPIO.output(4,1)
                                        time.sleep(0.10)
                                        GPIO.output(4, 0)
                                        time.sleep(0.10)


                                else:
                                        LoRaReceived = 0
                                        LoRaMessID = 0


                                if hasattr(report, 'time'):
                                        logValue = "no Data"
                                        if hasattr(report, 'lat'):
                                                logValue = "%s, %f, %f, %0.2f, %0.2f, %i, %i %0.3f\n" % (report.time, report.lat, report.lon,report.alt, report.speed,LoRaReceived, LoRaMessID, distance)
                                        fo.write(logValue);
                                        fo.flush()

        except KeyError:
                pass
        except KeyboardInterrupt:
                quit()
        except StopIteration:
                session = None
                print "GPSD has terminated"
fo.close()
# Close opened file


You can find all the test software for the LoRa/GPS Test up on GitHub.

Here is how we start the software running for the test.

Check out this link to install the GPS software and get it to work on the Raspberry Pi 3:

sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock

nohup sudo python LogGPS.py /dev/null 2>&1 &

The Results

LoRa WXLink BoxWe strapped the Raspberry Pi GPS/LoRa test jig (in a cardboard box, no less) on to the top of a car and prepared to drive around (video below).   We put the  LoRa solar powered WXLink up on top of the roof to get more of an unobstructed range.   Note:   This test isn’t really a “free air” or “line of sight” test.  We want to get a reasonable number out of this test that we can use on the Ridge antenna down in Curacao which is not a line of site connection.

We met with Dr. Geoff Howard (owner of the PJ2T station in Curacao) and found out that the direct “crow flight” from the main station to the Ridge antenna is only about 450m, not the 2,000m distance that we thought.  He pointed out that you have to walk and climb about that far to climb up to the ridge antenna, but the direct distance is much less.

We ran this test twice with our GPS/LoRa test unit with two different antennas.   First we used the dipole antenna (pictured to the right) on the transmission unit and ran out test.  We drove around until we couldn’t hear the beeps from the unit anymore (and learned that we should have run a wire down inside the car for the beeper as we had to keep the windows open to hear it!).  We then went back to the lab and logged into the Raspberry Pi and got the results.

 

Test 1 – Dipole Antenna – Transmission Unit on Roof – Suburban Residential Area

While we are planning to use a Yagi Antenna for the base unit (to get higher gain in the direction towards the Ridge antenna in Curacao), we wanted to get the baseline from the simple dipole antenna.  The pertinent results from our gpslog.ext:

2017-04-12T16:03:48.000Z, 47.671465, -117.131488, 628.50, 9.36, 0, 0 0.661
2017-04-12T16:03:50.000Z, 47.671442, -117.131300, 628.60, 5.48, 0, 0 0.669
2017-04-12T16:03:52.000Z, 47.671393, -117.131237, 628.50, 1.78, 1, 379 0.676
2017-04-12T16:03:54.000Z, 47.671387, -117.131237, 628.50, 0.00, 0, 0 0.677
2017-04-12T16:03:56.000Z, 47.671388, -117.131243, 628.60, 0.00, 0, 0 0.677
2017-04-12T16:03:58.000Z, 47.671388, -117.131243, 628.60, 0.00, 1, 380 0.677
2017-04-12T16:04:00.000Z, 47.671388, -117.131243, 628.60, 0.00, 0, 0 0.677
2017-04-12T16:04:02.000Z, 47.671388, -117.131243, 628.60, 0.01, 0, 0 0.677
2017-04-12T16:04:04.000Z, 47.671388, -117.131245, 628.60, 0.00, 1, 381 0.677
2017-04-12T16:04:06.000Z, 47.671388, -117.131245, 628.60, 0.00, 0, 0 0.677
2017-04-12T16:04:08.000Z, 47.671388, -117.131245, 628.60, 0.00, 0, 0 0.677
2017-04-12T16:04:10.000Z, 47.671388, -117.131245, 628.60, 0.00, 1, 382 0.677
2017-04-12T16:04:12.000Z, 47.671388, -117.131245, 628.60, 0.00, 0, 0 0.677
2017-04-12T16:04:14.000Z, 47.671388, -117.131245, 628.60, 0.00, 0, 0 0.677
2017-04-12T16:04:16.000Z, 47.671388, -117.131245, 628.60, 0.04, 1, 383 0.677
2017-04-12T16:04:18.000Z, 47.671368, -117.131223, 628.70, 3.27, 0, 0 0.679

The last number is the distance in kilometers. So, we got a range of about 677m (with one outlier at 792m!) from test 1 with the elevated dipole antenna in one area of the drive. The more reliable (more points) range was about 450m – 550m. Free Air measurements are always easier to do since you don’t have to deal with reflections and differing number of houses in the way. You can tell from the MessageIDs from the base unit (the second from the last number on each line) that we have a good reliable connection here.

 

 

Test 2 – Yagi Antenna – Transmission Unit on Ground – Suburban Residential Area

We got our first Yagi antenna delivered last week. It was delivered without the proper adapter cables and plugs. Our fault, we didn’t order them. We have a second Yagi coming in

433MHz Yagi Antenna

next week with the proper cables to hook it up to the test unit right on the LoRa PCB board. We had to stuff some wires in the antenna and wrap grounds around the antenna connect to get it to work. This was a terrible job and the resulting system was so unstable and fragile that we just placed it at ground level on a bench to run a quick test. We will try this whole test again with the Yagi antenna wired into the unit correctly and placed on the roof as in Test 1. But, here are the results from our quick Yagi test:

2017-04-15T00:25:24.000Z, 47.675585, -117.146873, 609.40, 2.58, 0, 0 0.885
2017-04-15T00:25:26.000Z, 47.675537, -117.146850, 611.20, 3.87, 0, 0 0.884
2017-04-15T00:25:28.000Z, 47.675483, -117.146733, 612.10, 6.44, 1, 223 0.876
2017-04-15T00:25:30.000Z, 47.675462, -117.146543, 612.50, 8.10, 0, 0 0.862
2017-04-15T00:25:32.000Z, 47.675462, -117.146305, 612.60, 9.48, 0, 0 0.845
2017-04-15T00:25:34.000Z, 47.675465, -117.146033, 612.90, 10.48, 0, 0 0.825
2017-04-15T00:25:36.000Z, 47.675467, -117.145745, 613.20, 10.73, 0, 0 0.803
2017-04-15T00:25:38.000Z, 47.675468, -117.145457, 613.40, 10.35, 0, 0 0.782
2017-04-15T00:25:40.000Z, 47.675468, -117.145187, 613.80, 9.69, 1, 225 0.762
2017-04-15T00:25:42.000Z, 47.675470, -117.144925, 614.10, 10.09, 0, 0 0.743

Remember, this is NOT good data, nor is it a fair comparison to Test 1. We need to rerun this next week.

However, that being said, we did still get a longer range in the direction the Yagi was pointing as expected. 876m. Since we missed the beep, we didn’t stop at that location to see how reliable the signal was.

Nevertheless, we are much more comfortable in making the 400m range up to the Ridge antenna. We will bring the Yagi in any case. We are going to mount the Yagi antenna on the base unit (since receiving and transmitting gain are symmetrical) so we should be able to aim it toward the Ridge antenna with good accuracy.

 

Test 3 and 4 – 4096

Next Up?

We run the Yagi antenna test again and now we start building the base unit for Project Curacao2 using the Raspberry Pi Zero.     It is only now 5 weeks to deployment!   We need to get the base unit finished and out in the weather for testing.

 

2 Comments

  1. If this range is not enough. You can try the new RFM95PW 868/915MHz Enhanced Power RF LoRa Transceiver Module NEW! Range up to 2.5 miles +30dBm output power. Its a 5V module.

  2. Malcolm,

    Very cool. That is software compatible with ours. We are only using +25dBm at 5V.

    We received a production Yagi unit yesterday and are planning to try it tonight.

    We have tried to use the 4096 symbol mode (to test the absolute farthest range), but couldn’t get it to work reliably. We are guessing that it requires a bit more of a processor than it actually has.

    Since the 4096 mode takes too long to transmit for US Law, we are sticking with the 512M.

    We will have to test some 868MHz units also.

1 Trackback / Pingback

  1. Project Curacao2 - Part 5 - Final LoRa Range Results - SwitchDoc Labs

Comments are closed.