{"id":1850,"date":"2015-10-05T13:36:53","date_gmt":"2015-10-05T13:36:53","guid":{"rendered":"http:\/\/www.daveakerman.com\/?p=1850"},"modified":"2016-02-01T23:09:39","modified_gmt":"2016-02-01T23:09:39","slug":"lora-lora-packets","status":"publish","type":"post","link":"http:\/\/www.daveakerman.com\/?p=1850","title":{"rendered":"LoRa LoRa Packets"},"content":{"rendered":"<p>One of the reasons for me experimenting with LoRa modules was that they are transceivers and should allow uplinks from the ground to a balloon, or communications between balloons. \u00a0Uplinks I will try on another flight, but for now I&#8217;m working on inter-balloon communications. \u00a0The eventual aim for this is to fly a series of balloons across Europe, with data passing from balloon to balloon, thus considerably extending the radio range which would otherwise be limited by the Earth&#8217;s curvature:<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/LOS.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-large wp-image-1872\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/LOS-1024x263.jpg\" alt=\"LOS\" width=\"640\" height=\"164\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/LOS-1024x263.jpg 1024w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/LOS-300x77.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>On previous flights my LoRa trackers have transmitted continuously, but this obviously won&#8217;t work if they are meant to listen to other trackers. \u00a0I opted for a very simple and widely used technique called <a href=\"https:\/\/en.wikipedia.org\/wiki\/Time_division_multiple_access\">TDMA<\/a> (Time Division Multiple Access), with\u00a0all trackers taking turns to transmit on the same frequency. \u00a0Timing was taken from the GPS which every tracker has anyway. \u00a0Time slots are static and written into the code for each tracker; during non-Tx periods, each tracker listens for packets from other trackers.<\/p>\n<p><a href=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/f\/f9\/Tdma-frame-structure.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/f\/f9\/Tdma-frame-structure.png\" alt=\"\" width=\"657\" height=\"456\" \/><\/a><\/p>\n<p>I set the frame time to 20 seconds, which conveniently divides exactly into 1 minute, making it much simpler to mentally convert from a time to a slot number. \u00a0Within those 20 seconds there are 10 usable 1-second slots and 10 1-second guard periods (to prevent transmissions from overlapping). \u00a0The frame\u00a0begins on the minute, and there are 3\u00a0frames per minute.<\/p>\n<p>I programmed\u00a03 trackers for the flights, with each tracker having 1 slot to transmit its own position, and 2 slots to re-transmit packets from the other 2 trackers. \u00a0So together they can use\u00a0up to 9 slots (3 direct, 6 repeats) out of the 10 available.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1851\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Slots.png\" alt=\"Slots\" width=\"652\" height=\"94\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Slots.png 652w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Slots-300x43.png 300w\" sizes=\"(max-width: 652px) 100vw, 652px\" \/><\/p>\n<p>Here&#8217;s an SDR screenshot showing packets being transmitted every 2 seconds; the packets occupy\u00a0a bit less than 1 second so there is slightly more than 1 second between packets:<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image11.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1865\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image11.png\" alt=\"Image1\" width=\"940\" height=\"546\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image11.png 940w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image11-300x174.png 300w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/p>\n<p>On my previous LoRa flights the packets have taken rather more than 1 second. \u00a0This time I opted for a wider bandwidth (62.5kHz instead of my usual 20.8kHz) to reduce the packet time to about 1\/3rd.<\/p>\n<p>There&#8217;s another reason for going to 62.5kHz. \u00a0The LoRa modules that I&#8217;ve used have been offset from each other up to 4kHz which, if using a 20.8kHz bandwidth, is enough to stop packets being received. \u00a0Since the allowed offset is a proportion of the bandwidth, then using a wider bandwidth reduces or eliminates the problem.<\/p>\n<p>The downside of using any bandwidth &gt; 20.8kHz, on the 434MHz band in the UK at least, is that transmissions must be\u00a0limited to a duty cycle of 10%; at least it is according to my reading of <a href=\"https:\/\/www.google.co.uk\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0CCAQFjAAahUKEwjGhIjDravIAhXK0xoKHW0yAow&amp;url=http%3A%2F%2Fstakeholders.ofcom.org.uk%2Fbinaries%2Fspectrum%2Fspectrum-policy-area%2Fspectrum-management%2Fresearch-guidelines-tech-info%2Finterface-requirements%2FIR_2030.pdf&amp;usg=AFQjCNGGZouK-ttrmCmaw0ia6jmRlJefGg&amp;sig2=Atgd8LZbluyEcC0_1qzQoQ&amp;bvm=bv.104317490,d.bGQ\">IR2030<\/a>. \u00a0I measured the Tx time of my tracker&#8217;s transmissions and, with 3 slots in 20 seconds, it works out at a duty cycle of just over 8%, so comfortably the right side of legality.<\/p>\n<p>Another downside is that the available power is now spread across a wider bandwidth, so reducing the S\/N ratio at the receiver, and thus the link budget. \u00a0Whether this is an issue or not would become clear during the flights.<\/p>\n<p>For the flights, I programmed 3 trackers provided by <a href=\"http:\/\/ava.upuaut.net\/\">Anthony Stirk<\/a>. \u00a0Each has an ATmega 328P, UBlox MAX M8Q, HopeRF RFM98W, \u00a0and cutdown circuitry (not used this time).<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/tracker.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1853\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/tracker.jpg\" alt=\"tracker\" width=\"450\" height=\"182\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/tracker.jpg 450w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/tracker-300x121.jpg 300w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>Each ran the same code but with different settings for payload ID, primary slot number, and secondary (repeater) slot numbers. \u00a0Each went into a <a href=\"http:\/\/www.hobbycraft.co.uk\/hobbycraft-polystyrene-split-egg-160mm\/591578-1000\">Hobbycraft foam egg<\/a>, total weight with a plastic Estes 18&#8243; parachute was about 70 grams.<\/p>\n<p>LORA1 went up with a 500g balloon. \u00a0I then watched the incoming packets and saw that is was still happily repeating LORA2\/3. \u00a0At about 4km altitude the first of the other ground stations (<a href=\"https:\/\/philcrump.co.uk\/Main_Page\">Phil Crump<\/a>&#8216;s LoRa gateway at his WebSDR site) started to receive LORA1 directly, and LORA2\/3 indirectly; in fact the first packet received there was LORA2 &#8211;&gt; LORA1 &#8211;&gt; Phil&#8217;s gateway:<\/p>\n<pre>11:52:31 $$LORA2,161,11:52:27,51.95024,-2.54456,00141,0,0,12*C46E\r\n11:52:35 $$LORA3,161,11:52:33,51.95029,-2.54451,00142,0,0,11*9985\r\n11:52:41 $$LORA1,164,11:52:41,51.96063,-2.57614,03953,7,0,12*99C2<\/pre>\n<p>Next up was LORA2 under a 350g balloon. \u00a0Very impressively, this\u00a0was received by Phil&#8217;s gateway when\u00a0at just over 1.1km altitude, which is rather below his radio horizon:<\/p>\n<pre>12:23:47 $$LORA2,255,12:23:47,51.94375,-2.53650,01190,1,0,12*2AA3<\/pre>\n<p>I think that pretty much puts to bed any worries about LoRa range at this bandwidth.<\/p>\n<p>I then\u00a0checked my LCARS LoRa receiver, which was happily showing the position of both airborne trackers as well as LORA3 (still on the bench):<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-large wp-image-1869\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/P1110168-1024x768.jpg\" alt=\"P1110168\" width=\"640\" height=\"480\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/P1110168-1024x768.jpg 1024w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/P1110168-300x225.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Finally, I launched LORA3, again under a 350g balloon. \u00a0The planned burst altitude for this one was about 28.5km but, as sometimes Chinese latex completely\u00a0ignores specifications and goes rather higher. \u00a0Usually that&#8217;s just an extra 2km or so, but this time it was 10km higher than calculated!<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/lora3_altitude.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1870\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/lora3_altitude.jpg\" alt=\"lora3_altitude\" width=\"199\" height=\"247\" \/><\/a><\/p>\n<p>After the flight I received several receiver log files, and so far I&#8217;ve only had time to do some analysis on Phil&#8217;s. \u00a0From that file, the following chart shows the altitude plots for LORA1 and 2 (100 on the chart = max altitude for LORA1) and fraction of packets received (10 on the chart = 100%) directly from LORA1, or indirectly via LORA2:<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image7.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-large wp-image-1854\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image7-1024x611.png\" alt=\"Image7\" width=\"640\" height=\"382\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image7-1024x611.png 1024w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image7-300x179.png 300w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image7.png 1073w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>During the portion of the flight where both LORA1 and LORA2 were high enough to be in range of Phil&#8217;s gateway, 82% of LORA1&#8217;s packets were received directly, and 58% were received indirectly via LORA2.<\/p>\n<p>LORA1 was heading for a field as it came into land. \u00a0Now, normally the actual landing position isn&#8217;t known because the range of a landed tracker is typically about 1 mile. \u00a0There have been exceptions, where either the chase car is close or the payload lands in a tree or on the side of a hill, but for the vast majority of flights the actual landing position is not known till later when the chase car arrives (and then only if the car receiver is uploading via GSM). \u00a0One of my aims, or at least hopes, for these flights was for one or both of the still-flying trackers to continue to repeat packets from the remaining tracker after it has landed.<\/p>\n<p>So as LORA1 approached that field, all eyes were on the telemetry to see &#8220;how low can we go?&#8221;. \u00a0As the flight gets lower, static receiving stations start to drop out because the tracker is below their line-of-sight, till finally the closest station gets the last packet when the flight altitude is at maybe 500 metres or so (LORA3 for example was lost at 998m). \u00a0Of course this time we also had 2 mobile repeater stations in the form of LORA2 and LORA2, in good position to relay LORA1&#8217;s telemetry. \u00a0Here&#8217;s part of the conversation on our IRC channel which, to me at least, felt like waiting for Apollo 13 to come out of radio blackout!<\/p>\n<pre>[15:14] &lt;daveake&gt; 861 repeated \r\n[15:15] &lt;daveake&gt; 639m repeated \r\n[15:15] &lt;daveake&gt; suspense is killing me lol\r\n[15:17] &lt;daveake&gt; 344m repeated \r\n[15:17] &lt;fsphil&gt; .... \r\n[15:17] &lt;Upu&gt; go on :) \r\n[15:17] &lt;fsphil&gt; *tension* \r\n[15:17] Action: fsphil puts on dramatic music \r\n[15:17] &lt;Upu&gt; jcoxon - LORA1 is about to get repeated\r\n              on the ground from a flying balloon \r\n[15:17] &lt;daveake&gt; this is like watching apollo 13 re-enter \r\n[15:17] &lt;daveake&gt; we hope \r\n[15:17] &lt;daveake&gt; 146m \r\n[15:17] &lt;Upu&gt; haha \r\n[15:17] &lt;Upu&gt; nice \r\n[15:17] &lt;Laurenceb__&gt; woot \r\n[15:18] &lt;jcoxon&gt; Upu oooo thats amazing \r\n[15:18] &lt;Upu&gt; nice one daveake \r\n[15:18] &lt;Upu&gt; have a beer :) \r\n[15:18] &lt;craag&gt; 80 \r\n[15:18] &lt;daveake&gt; 80m WOOOO \r\n[15:18] &lt;fsphil&gt; lol \r\n[15:18] &lt;craag&gt; next one will be ground \r\n[15:18] &lt;craag&gt; 46!!! \r\n[15:18] &lt;Laurenceb__&gt; yes \r\n[15:18] &lt;daveake&gt; Exccellent :) \r\n[15:20] &lt;craag&gt; and another to confirm! awesome work \r\n[15:20] &lt;jcoxon&gt; the dream of hunting payloads with other payloads\r\n[15:20] &lt;fsphil&gt; hah, that was definitly on the ground \r\n[15:20] &lt;DL1SGP&gt; Lora1 still being rxed \r\n[15:20] &lt;craag&gt; getting repeated by both too it seems \r\n[15:21] &lt;daveake&gt; hah \r\n[15:21] &lt;daveake&gt; Wow, this is great :) \r\n[15:21] &lt;daveake&gt; Can anyone confirm defintely repeated by both ? \r\n[15:22] &lt;craag&gt; I've received two copies of the same sentence... \r\n[15:22] &lt;dbrooke&gt; me too \r\n[15:22] &lt;daveake&gt; excellent \r\n\r\n<\/pre>\n<p>And just to prove it, here&#8217;s a screenshot from the tracking map, showing a large list of receivers all receiving LORA1 after the latter has landed:<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/lora1_landed.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1856\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/lora1_landed.jpg\" alt=\"lora1_landed\" width=\"750\" height=\"276\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/lora1_landed.jpg 750w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/lora1_landed-300x110.jpg 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/p>\n<p>Back to Phil&#8217;s gateway&#8217;s log, here&#8217;s the section before and after LORA1 (altitude in red) lands. \u00a0The direct packets (yellow) stop before landing, but the repeated packets (blue) continue until shortly before LORA2 lands (green):<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image8.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1857\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image8.png\" alt=\"Image8\" width=\"996\" height=\"625\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image8.png 996w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2015\/10\/Image8-300x188.png 300w\" sizes=\"(max-width: 996px) 100vw, 996px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Not shown here, but LORA3 also repeated the landing position. \u00a0An excellent result. \u00a0And even better, the same happened when LORA2 landed &#8211; it was repeated by LORA3.<\/p>\n<p>Well, I say &#8220;landed&#8221;, but LORA2 managed to stop on the edge of an office roof, where it currently remains until I can organise recovery:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/pbs.twimg.com\/media\/CQZ1az8WoAEZ5hd.png\" alt=\"\" width=\"599\" height=\"323\" \/><\/p>\n<p>LORA3 landed without airborne support of course, but was easily picked up from the chase car from over a mile away &#8211; a similar result to that which I&#8217;m used to with RTTY.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/pbs.twimg.com\/media\/CQd4X57XAAAtmZB.jpg\" alt=\"\" width=\"600\" height=\"800\" \/><\/p>\n<p>LORA1 however is missing &#8211; no signal and no payload at the landing position. \u00a0Hopefully whoever found it will get in touch.<\/p>\n<p>UPDATE 1: LORA2 now recovered. \u00a0The payload was exactly where the GPS reported (see satellite image above), with the line\/chute\/balloon dangling down to about head height. \u00a0Thanks to helpful people at the site it was recovered in minutes.<\/p>\n<p>UPDATE 2: LORA1 now recovered. \u00a0I received a phone call several weeks after the flight, from the landowner who found the payload in a field. \u00a0I think a sheep must have been holding it hostage when I looked for it, as the aerial had obviously been chewed!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the reasons for me experimenting with LoRa modules was that they are transceivers and should allow uplinks from the ground to a balloon, or communications between balloons. \u00a0Uplinks I will try on another flight, but for now I&#8217;m working on inter-balloon communications. \u00a0The eventual aim for this is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1850"}],"collection":[{"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1850"}],"version-history":[{"count":16,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1850\/revisions"}],"predecessor-version":[{"id":2434,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1850\/revisions\/2434"}],"wp:attachment":[{"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1850"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}