Tutorial 8 built one line of telemetry a second and printed it down a USB cable. A CanSat has no USB cable. This tutorial sends that same line through the air to a second radio on the ground, which is the last piece of the primary mission.
Tutorials 1 to 8 use an Arduino Uno because it is cheap and hard to break. The radios here run at 3.3 volts and will be damaged by the Uno's 5 volt pins, so this tutorial switches to a Raspberry Pi Pico, which is 3.3 volts throughout.
You can follow it in either language. Arduino C++ carries straight on from the first eight tutorials. MicroPython is Python on the board, and plenty of CanSat teams prefer it. Every code block below has a tab for each, the page remembers which one you pick, and the radio ideas are identical in both.
You need two of everything: one radio in the CanSat, one on the ground. Two Picos and two radios is roughly £50 to £70 for the pair of each.
The radio
What LoRa does, and what it does not
LoRa is a way of sending small amounts of data a long way on very little power. It gets that range by sending slowly. How slowly is a setting you choose, and choosing it is the main decision in this tutorial.
| LoRa is | LoRa is not |
|---|---|
| Two radios talking directly to each other | Wi-Fi. There is no network and no router. |
| A few dozen bytes at a time | A way to stream anything large. |
| Good for several kilometres in open air | Good through buildings or hills. |
| Yours to configure: frequency, speed, power | Automatic. Both ends must be set the same by hand. |
Search for LoRa and most of what you find will be about LoRaWAN: gateways, network servers, The Things Network, device keys. That is a whole internet-connected system built on top of LoRa radios, and none of it applies to a CanSat. You want plain point to point LoRa: two modules, same settings, talking to each other and nothing else. If a tutorial mentions a gateway, it is answering a different question.
Before you order
The catches with these modules
These modules are cheap and capable, and a few things about them are easy to get wrong. Read this before you order. The first three affect what you buy, and the rest affect how you wire it up.
| The catch | What it means for you |
|---|---|
| They come in different bands | The same board is sold as 433, 868 and 915 MHz, and the chip inside is different. For UK CanSat use you want 433 MHz, and both of your radios must match. A 915 MHz module is the United States part: it will appear to work on the bench and is not legal to use here. Check the silkscreen or the box before you build anything around it. |
| A bare module does not fit a breadboard | Raw modules have pins on a 2 mm grid. Breadboards are 2.54 mm. The pins do not line up, and forcing them bends them. Buy a breakout board, or a ready-made Pico board like the Waveshare one, which needs no wiring at all. |
| Never power it up without an antenna | Transmitting with nothing attached reflects the power back into the amplifier and can destroy it. Fit the antenna before the first upload. |
| 3.3 volts, with no tolerance | Not one pin will survive 5 volts, which rules out a direct connection to an Uno. This is why the tutorial uses a Pico. |
| About 120 mA while transmitting | Short bursts, but real. The Pico's 3.3 volt output can supply it. A tired battery or a long thin wire cannot, and the symptom is a board that resets in the middle of a packet. |
| You get raw packets and nothing else | No addresses, no acknowledgements, no retries, no checking that anything arrived. Every radio listening on your settings hears every packet. Anything cleverer than that, you write yourself. |
This is an easy way to destroy a module you have just paid for. There is no visible damage and the board still powers up, so for a long time the fault looks like a software problem and nobody suspects the radio. Fit the antenna first.
Setup
Getting a Pico ready
Arduino C++
Add the Pico to the Arduino IDE
Open Tools › Board › Boards Manager, search for
pico, and install Raspberry Pi Pico/RP2040/RP2350 by Earle Philhower. It is a large download. Then pick your exact board under Tools › Board.The first upload is different
A brand new Pico has no port until you put it in bootloader mode: hold the BOOTSEL button down, plug the USB cable in, then let go. After that first upload the IDE resets it for you and it behaves like any other board.
Install the LoRa library
Tools › Manage Libraries, search for
LoRa, and install LoRa by Sandeep Mistry. Several libraries share that name, so check the author. You also need Adafruit BMP280 from tutorial 7.Set the Serial Monitor to 115200
The sketches below assume it.
MicroPython
Put MicroPython on the Pico
Download the
.uf2firmware for your exact board from micropython.org/download. Hold BOOTSEL, plug the Pico in, let go, and it appears as a USB drive. Drag the.uf2onto it. The drive disappears and the Pico reboots running Python.Install Thonny
thonny.org. Open it, and in the bottom right corner choose MicroPython (Raspberry Pi Pico) as the interpreter. The shell at the bottom is now running on the board itself. Type
print(1 + 1)into it to prove it.Copy the radio driver onto the board
The SX1262 needs a driver file. Get
sx1262.pyand the files it imports from your module's wiki or from themicropySX126Xproject, then in Thonny use File › Save as › Raspberry Pi Pico to put them on the board alongside your code.Name your program main.py
A file saved on the board as
main.pyruns automatically whenever the Pico gets power, with no laptop attached, which is what a sealed CanSat needs.
Every Pico pin has two numbers: where it sits on the board counting from the corner, and what the chip calls it. Your code always uses the GP number. GP18 is the 24th pin along. Print a pinout diagram and keep it next to you, because guessing this wastes an afternoon.
Wiring
Connecting the radio
Arduino C++
Six wires for the radio, two for power. The three marked as your choice can move to other pins if you change the sketch to match. The three SPI lines cannot: they have to be pins the Pico's SPI0 hardware can reach.
| RFM95W pin | Pico GP | Physical pin | What it is |
|---|---|---|---|
VIN or 3V3 | 3V3(OUT) | 36 | Power. Never 5 volts. |
GND | GND | 38 | Ground |
SCK | GP18 | 24 | SPI clock |
MOSI | GP19 | 25 | Data out to the radio |
MISO | GP16 | 21 | Data back from the radio |
CS or NSS | GP17 | 22 | Your choice. Picks this radio out of everything on the bus. |
RST | GP20 | 26 | Your choice. Lets the sketch reset the radio. |
G0 or DIO0 | GP21 | 27 | Your choice. The radio raises this when a packet arrives. |
ANT | 173 mm of wire | Fit this first. Bench length, see below. |
MicroPython
If you have the Waveshare Pico-LoRa-SX1262 board, there is no wiring at all: the Pico plugs straight into it and the pins below are already connected. They are listed so you can check them against the numbers in the code, because a different Waveshare board uses different ones.
| SX1262 signal | Pico GP | In the code | What it is |
|---|---|---|---|
SCK | GP10 | clk=10 | SPI clock, on SPI1 |
MOSI | GP11 | mosi=11 | Data out to the radio |
MISO | GP12 | miso=12 | Data back from the radio |
NSS | GP3 | cs=3 | Chip select |
RESET | GP15 | rst=15 | Resets the radio |
DIO1 | GP20 | irq=20 | The radio raises this when something happens |
BUSY | GP2 | gpio=2 | The radio holds this high while it is working |
ANT | 173 mm of wire | Fit this first. Bench length, see below. |
A quarter wave at 433 MHz is 173 mm. The competition allows an antenna of 30 mm outside the can, and the whole can is only 115 mm tall, so the ideal antenna is half as long again as your entire CanSat. You cannot have it.
Real CanSats wind the antenna into a coil, called a helical, which fits the space and loses some efficiency in exchange. Work on the bench with the straight 173 mm wire so the link is never your problem, and treat the flight antenna as its own design job with its own test.
Wire both sets identically. Having the flight radio and the ground radio on the same pins means one file change swaps a board between the two jobs, and on launch day you will be glad of that.
The code
A sender and a receiver
Two programs, one for each board. Start the receiver first so there is something listening before the sender starts talking.
Arduino C++
// Ground station. A second Pico and a second RFM95W, set up the same way.
// Prints every packet it hears, plus how strong the signal was.
#include <SPI.h>
#include <LoRa.h>
const int CS_PIN = 17;
const int RST_PIN = 20;
const int DIO0_PIN = 21;
const long FREQUENCY = 433.3E6; // must match the sender
const int SPREADING = 7; // must match the sender
const long BANDWIDTH = 125E3; // must match the sender
void setup() {
Serial.begin(115200);
delay(2000);
SPI.setRX(16);
SPI.setTX(19);
SPI.setSCK(18);
SPI.begin();
LoRa.setPins(CS_PIN, RST_PIN, DIO0_PIN);
if (!LoRa.begin(FREQUENCY)) {
Serial.println("# LoRa did not start");
while (1) {
delay(100);
}
}
LoRa.setSpreadingFactor(SPREADING);
LoRa.setSignalBandwidth(BANDWIDTH);
// Two extra columns the CanSat does not have to send.
Serial.println("packet,time_ms,temp_C,pressure_Pa,rssi,snr");
}
void loop() {
int packetSize = LoRa.parsePacket();
if (packetSize > 0) {
while (LoRa.available()) {
Serial.print((char)LoRa.read()); // the line the CanSat sent
}
Serial.print(",");
Serial.print(LoRa.packetRssi()); // signal strength in dBm
Serial.print(",");
Serial.println(LoRa.packetSnr(), 1); // signal to noise in dB
}
}
// CanSat telemetry over LoRa. Raspberry Pi Pico plus an RFM95W at 433 MHz.
// This is tutorial 8's sketch with one function rewritten.
#include <SPI.h>
#include <LoRa.h>
#include <Wire.h>
#include <Adafruit_BMP280.h>
const int CS_PIN = 17; // these three are your wiring choices
const int RST_PIN = 20;
const int DIO0_PIN = 21;
const long FREQUENCY = 433.3E6; // 433.3 MHz. Both radios must match.
const int SPREADING = 7; // see the airtime table below
const long BANDWIDTH = 125E3; // 125 kHz
const int TX_POWER = 10; // dBm. 10 dBm is 10 mW.
const unsigned long SEND_EVERY_MS = 1000;
Adafruit_BMP280 bmp;
unsigned long lastSend = 0;
unsigned long packet = 0;
void setup() {
Serial.begin(115200);
delay(2000); // let the USB serial port wake up
if (!bmp.begin(0x76)) {
Serial.println("# BMP280 not found");
while (1) {
delay(100);
}
}
// Tell the Pico which pins carry SPI, then start it.
SPI.setRX(16);
SPI.setTX(19);
SPI.setSCK(18);
SPI.begin();
LoRa.setPins(CS_PIN, RST_PIN, DIO0_PIN);
if (!LoRa.begin(FREQUENCY)) {
Serial.println("# LoRa did not start. Check the wiring and the CS pin.");
while (1) {
delay(100);
}
}
LoRa.setSpreadingFactor(SPREADING);
LoRa.setSignalBandwidth(BANDWIDTH);
LoRa.setTxPower(TX_POWER);
Serial.println("# sender ready");
}
void loop() {
unsigned long now = millis();
if (now - lastSend >= SEND_EVERY_MS) {
lastSend = now;
packet++;
sendTelemetry(packet, now);
}
}
// The same job as tutorial 8. Only the four Serial calls became LoRa calls.
void sendTelemetry(unsigned long number, unsigned long timeMs) {
float tempC = bmp.readTemperature();
float pressurePa = bmp.readPressure();
LoRa.beginPacket();
LoRa.print(number);
LoRa.print(",");
LoRa.print(timeMs);
LoRa.print(",");
LoRa.print(tempC, 2);
LoRa.print(",");
LoRa.print(pressurePa, 0);
LoRa.endPacket(); // this is the line that actually transmits
Serial.print("sent "); // so you can watch it over USB as well
Serial.println(number);
}
MicroPython
# Ground station. Pico 2 W plus a Waveshare SX1262 LoRa module.
# Save this on the receiving Pico as main.py.
from sx1262 import SX1262
import time
FREQUENCY = 433.3 # MHz. Must match the sender.
BANDWIDTH = 125.0 # kHz. Must match the sender.
SPREADING = 7 # Must match the sender.
CODING = 5 # 5 means 4/5
# Pin numbers for the Waveshare Pico-LoRa-SX1262 board.
# Check yours against its wiki page before you trust them.
sx = SX1262(spi_bus=1, clk=10, mosi=11, miso=12,
cs=3, irq=20, rst=15, gpio=2)
sx.begin(freq=FREQUENCY, bw=BANDWIDTH, sf=SPREADING, cr=CODING,
syncWord=0x12, power=10, currentLimit=60.0,
preambleLength=8, implicit=False, implicitLen=0xFF,
crcOn=True, txIq=False, rxIq=False,
tcxoVoltage=1.6, useRegulatorLDO=False, blocking=False)
print("packet,time_ms,temp_C,rssi,snr")
while True:
message, err = sx.recv()
if len(message) > 0:
line = message.decode().strip()
print("%s,%d,%.1f" % (line, sx.getRSSI(), sx.getSNR()))
time.sleep_ms(10)
# CanSat telemetry over LoRa. Pico 2 W plus a Waveshare SX1262 module.
# Save this on the flight Pico as main.py.
#
# This reads the temperature sensor built into the Pico's own chip, so it
# runs with no sensor wired up at all. Swapping in a BMP280 is one function.
from sx1262 import SX1262
from machine import ADC
import time
FREQUENCY = 433.3 # MHz
BANDWIDTH = 125.0 # kHz
SPREADING = 7
CODING = 5
TX_POWER = 10 # dBm. 10 dBm is 10 mW.
SEND_EVERY_MS = 1000
sx = SX1262(spi_bus=1, clk=10, mosi=11, miso=12,
cs=3, irq=20, rst=15, gpio=2)
sx.begin(freq=FREQUENCY, bw=BANDWIDTH, sf=SPREADING, cr=CODING,
syncWord=0x12, power=TX_POWER, currentLimit=60.0,
preambleLength=8, implicit=False, implicitLen=0xFF,
crcOn=True, txIq=False, rxIq=False,
tcxoVoltage=1.6, useRegulatorLDO=False, blocking=True)
adc = ADC(4) # channel 4 is the on-chip temperature sensor
def read_temperature():
# The chip reports a voltage that falls as it warms. This is the
# conversion from the RP2040 and RP2350 datasheets.
volts = adc.read_u16() * 3.3 / 65535
return 27 - (volts - 0.706) / 0.001721
def send_telemetry(number, time_ms):
line = "%d,%d,%.2f" % (number, time_ms, read_temperature())
sx.send(line.encode())
print("sent", line)
packet = 0
last_send = time.ticks_ms()
while True:
now = time.ticks_ms()
if time.ticks_diff(now, last_send) >= SEND_EVERY_MS:
last_send = now
packet += 1
send_telemetry(packet, now)
time.sleep_ms(10)
The MicroPython sender reads the temperature sensor built into the Pico's own chip, so it runs with nothing else wired up. That sensor measures the silicon, not the air, so it reads a few degrees warm. Replace read_temperature() with a BMP280 reading when you are ready, and the rest of the program does not change. That is the same point tutorial 8 made about sendTelemetry().
Open the Serial Monitor, or Thonny's shell, on the receiving board. Within a second or two you should see lines like this, one per second:
packet,time_ms,temp_C,pressure_Pa,rssi,snr
1,2043,21.44,100873,-37,9.8
2,3043,21.45,100871,-38,9.5
3,4043,21.44,100874,-37,9.8
rssi is how strong the signal was, in dBm, and it is always negative: -37 is very strong, -120 is barely there. snr is how far above the noise it was. Neither costs the CanSat anything, because the receiver measures them. Plot rssi against time on a real flight and you have a graph of your radio link as the can descends, which is a useful extra result for very little work.
Reference
The new lines, explained
Line by line
SPI.setRX(16), orclk=10, mosi=11- Both languages make you say which pins carry SPI, because on a Pico you get to choose. Leave them out and the program runs, reports no error, and never talks to the radio.
LoRa.begin(433.3E6), orsx.begin(freq=433.3, ...)- Starts the radio on 433.3 MHz. C++ wants hertz, so
433.3E6means 433.3 million. MicroPython wants megahertz. Same number, different units, and mixing them up is a popular mistake. setSpreadingFactor(7), orsf=7- How slowly to send. 7 is the fastest, 12 the slowest and longest range. Read the next section before you change it.
setSignalBandwidth(125E3), orbw=125.0- How wide a channel to use. C++ in hertz, MicroPython in kilohertz. Both ends must agree.
setTxPower(10), orpower=10- Transmit power in dBm. 10 dBm is exactly 10 mW. Both libraries will happily go higher, so this line is doing real work. Read the limit carefully though: the rules cap radiated power, and your antenna adds to what the transmitter puts out.
LoRa.beginPacket()...endPacket()- C++ builds a packet piece by piece, then transmits.
endPacket()waits until the transmission has finished, which at spreading factor 7 is about 60 milliseconds of doing nothing else. sx.send(line.encode())- MicroPython sends the whole thing in one call.
.encode()turns text into the raw bytes a radio deals in. LoRa.parsePacket(), orsx.recv()- On the receiver: has anything arrived? C++ hands back the size, MicroPython hands back the message and an error code.
(char)LoRa.read()- Takes one byte and tells the compiler to treat it as a character. Without the
(char)you print the number 55 where you wanted the digit 7. MicroPython's.decode()does the same job for a whole message. packetRssi(), orsx.getRSSI()- Signal strength of the packet just received, in dBm. The SNR call beside it is the signal to noise ratio in dB.
syncWord=0x12- MicroPython only. A byte both ends must share, which stops your radio bothering to decode packets from unrelated LoRa gear nearby. Leave it alone unless both ends change together.
The important bit
Airtime: the number that decides your design
The spreading factor is where a radio setting becomes a design decision. The time a packet spends in the air depends almost entirely on it, and it changes by a factor of twenty across the range.
The mission asks for one packet per second. The rules also limit how much of the time you may transmit. So work out what fraction of each second your radio is busy.
| Spreading factor | Time in the air | At one packet a second | Verdict |
|---|---|---|---|
| 7 (fastest) | 62 ms | 6.2% of the time | Works. Inside the 10% allowance with room to spare. |
| 8 | 113 ms | 11.3% | Fits in the second, but over the 10% allowance. |
| 9 | 206 ms | 20.6% | Twice the allowance. |
| 10 | 371 ms | 37% | No. |
| 11 | 823 ms | 82% | No. |
| 12 (longest range) | 1483 ms | 148% | Will not even fit inside one second. |
Figures for a 24 byte packet at 125 kHz bandwidth and coding rate 4/5. Your packet length changes them, so work yours out rather than copying these.
There are two separate things to check, and they give different answers. One is whether a packet finishes before the next one is due. The other is whether you are inside the 10% airtime allowance. Spreading factor 8 passes the first and fails the second: 113 ms is comfortably inside one second, and 11.3% is over the limit.
A team that checks only the clock will find spreading factor 8 works on the bench, and will be over the airtime limit on launch day with nothing visibly going wrong to warn them.
Spreading factor 7 is the setting to start from. At 10 mW it should reach several kilometres in open air, and your CanSat is released at 300 to 400 metres, so range is unlikely to be what limits you. That is a prediction though, so range-test it.
A second option
Route B: trade channel width for unlimited airtime
Everything above assumes one set of rules. There is more than one way to be legal at 433 MHz, and the second way is worth knowing because it lifts the limit that was blocking you.
| Route A | Route B | |
|---|---|---|
| The rule | IR2030/1/10 | IR2030/1/12 |
| Frequencies | 433.05 to 434.79 MHz | 434.04 to 434.79 MHz |
| Power | 10 mW e.r.p. | 10 mW e.r.p. |
| How much of the time you may transmit | 10% | As much as you like |
| Channel width | Anything | 25 kHz or narrower |
| Allowed in the air | Yes | Yes |
Route B is a trade. You give up the wide channel, and the airtime limit goes away. That matters because the airtime limit was the only thing stopping you using a slower, longer-range spreading factor.
A narrow channel also lets in less noise, so the receiver can decode weaker signals. On paper that gives you two improvements at once: a slower spreading factor and a more sensitive receiver.
| Route A at its best | Route B at its best | |
|---|---|---|
| Channel width | 125 kHz | 20.8 kHz |
| Best spreading factor you may legally use | 7 | 8 |
| Time in the air | 62 ms | 680 ms |
| Fraction of each second transmitting | 6.2% | 68%, and allowed |
| Weakest signal the receiver can decode | -124.5 dBm | -134.8 dBm |
| Difference on paper | 10.3 dB, for three changed numbers |
Ten decibels is a large difference. In free space it works out at roughly three times the range, and it costs you three changed numbers and no extra hardware. Whether you get three times the range in a real field is a different question, and the caveat at the end of this section is about exactly that.
Arduino C++
// Route B. Three lines change, and all three must change at both ends.
const long FREQUENCY = 434.4E6; // inside 434.04 to 434.79 MHz
const long BANDWIDTH = 20.8E3; // narrow channel, 25 kHz limit
const int SPREADING = 8; // the slower setting Route A could not afford
// ...then, in setup(), exactly as before:
LoRa.begin(FREQUENCY);
LoRa.setSignalBandwidth(BANDWIDTH);
LoRa.setSpreadingFactor(SPREADING);
LoRa.setTxPower(10);
MicroPython
# Route B. Three values change, and all three must change at both ends.
FREQUENCY = 434.4 # MHz, inside 434.04 to 434.79
BANDWIDTH = 20.8 # kHz, under the 25 kHz limit
SPREADING = 8 # the slower setting Route A could not afford
sx.begin(freq=FREQUENCY, bw=BANDWIDTH, sf=SPREADING, cr=5,
syncWord=0x12, power=10, currentLimit=60.0,
preambleLength=8, implicit=False, implicitLen=0xFF,
crcOn=True, txIq=False, rxIq=False,
tcxoVoltage=1.6, useRegulatorLDO=False, blocking=True)
A LoRa receiver only copes with the transmitter being off-frequency by about a quarter of the channel width. On Route A that is ±31 kHz, which is 72 parts per million at 433 MHz: very forgiving. On Route B it is ±5.2 kHz, which is 12 parts per million. Much tighter.
Why that matters for a CanSat specifically: the quartz crystal that sets the radio's frequency drifts as it changes temperature, and your CanSat is carried to 400 metres through cold air and then falls back. If the two ends drift apart by more than 5 kHz, the link stops. So Route B needs a temperature-stable crystal, or a test in a freezer, or both.
The two checks from the last section swap places on Route B. On Route A the airtime allowance was the limit. On Route B the clock is: spreading factor 9 is legal on airtime, but one packet takes 1.48 seconds, so it cannot send once a second. You still have to run both checks.
Route A is simpler and more forgiving, and it is what most teams use. Route B should reach further, and it adds a way to fail that Route A does not have. Either choice is defensible. Which one you pick, and the reason you give for it, is the sort of decision a design review rewards. Write the reason down, then test the choice.
The airtime figures come from the published LoRa formula, so they are dependable: a given packet really does take that long to send. The sensitivity and range figures are a different kind of number. They assume a perfect antenna, nothing in the way, no interference and no reflections, which is not a field in March.
Real links are worse than the arithmetic, sometimes by a lot. Antenna length, how the antenna is mounted, which way up the can is at the time, other teams transmitting, damp ground and even your own electronics all take decibels away. None of that is in the table above.
So treat Route B as something to test rather than an upgrade you can assume. Set up both routes, measure the range of each with the same antennas on the same afternoon, and keep whichever one your own results support. A measured range test with a real number in it carries more weight in your report than the arithmetic does. It is also the only way to find out whether crystal drift matters on your own hardware.
The rules
Staying legal, and changing channel
Two competition rules land directly on this tutorial, and the code answers both.
| Rule | The line that handles it |
|---|---|
| Your frequency must be changeable | LoRa.setFrequency(), or calling sx.begin() again with a new freq, changes channel while the program is running. Put it behind a command from the ground, or a button press at power up, and you can change channel with the can sealed. |
| You must stay within UK regulations | setTxPower(10) holds the transmitter at 10 mW, and the route you picked above sets your frequency and airtime budget. |
Every entry in the UK interface requirements says whether that equipment may be used in the air, and a great many say it may not. A CanSat is airborne by definition, so this is the first thing to check about a band, ahead of power and duty cycle.
433 MHz is fine on both routes above. Some nearby bands are not, and nothing about the module would tell you. If a team is tempted by 868 MHz for the higher power allowance, read that entry carefully, because it carries extra conditions about listening before transmitting.
Several teams will be transmitting on launch day. Agreeing different frequencies beforehand, and being able to change yours without opening the can, is a problem to solve in the workshop. There is room for several channels: at 125 kHz spacing them 400 kHz apart keeps them clear of each other.
Band, power and duty cycle figures here come from the UK interface requirements document IR 2030 and the CanSat competition briefing. Radio rules change, so check the current version before launch day rather than trusting this page.
Troubleshooting
If no packets arrive
| What you see | What to check |
|---|---|
| The radio does not start | Wiring, and the chip select pin above all. Then check the SPI pin lines are present and match your wiring. The library cannot tell a missing radio from a wrong pin. |
| It starts, but nothing is ever received | The two radios disagree. Frequency, spreading factor and bandwidth must be identical at both ends. One different digit is enough. |
| Packets arrive with characters missing | Usually the receiver printing more slowly than packets arrive. Use 115200 at both ends. |
rssi around -120 on the same desk | An antenna problem. Check the wire is fitted and is roughly 173 mm. A module that has been powered without an antenna may already be damaged. |
| The board resets while transmitting | Power. 120 mA on transmit is more than a weak supply or a long breadboard wire will carry. Power the Pico over USB while testing. |
| Packet numbers skip | Normal. That is the packet counter from tutorial 8 earning its place. Note the loss rate, because the reviewers will ask. |
| It worked, then stopped after you changed the bandwidth | On a narrow channel the two ends have far less room to drift apart. Check both ends really did change, and see the Route B catch above. |
| Everything works at one metre and fails at fifty | Antenna orientation. Two quarter wave wires work best parallel to each other, and worst pointing at each other end on. |
Now change it
Change one thing at a time, upload, and watch what the board does.
- Run the two boards a metre apart and write down the typical
rssi. Walk to the far end of the building and write it down again. - Change the spreading factor to 12 on both boards. Time how long a packet takes, and check it against the table above.
- Change the spreading factor on only one board. What does the receiver show, and how quickly could you have diagnosed that on launch day?
- Work out the airtime for your own packet length at spreading factor 7. Is your duty cycle still under 10%?
- Switch both boards to Route B. Does the range improve as much as the 10 dB suggests? What else changed?
- Add a command: when the ground station sends the character
F, the CanSat moves to a different frequency. What happens to the link while it changes, and how would you get it back? - Log the ground station output to a file, then look for gaps in the packet numbers. What percentage arrived?
- Both radios hear every packet on their settings. If two teams use the same frequency, what would each ground station record, and what could you add to the packet to tell them apart?
- Put the sending board in a freezer for ten minutes with the link running. Does anything change? Now predict what Route B would do.