Skip to content

Implementation of radio sender and receiver for Perun Rockets

Notifications You must be signed in to change notification settings

perunrockets/perun-lora-arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Perun LoRa (Arduino)

Repository consists of two projects:

  • PERUN_ROCKET
  • PERUN_BASE

Pinout

LoRa pins can be changed in LoRa_Base.ino file (for PERUN_BASE) and LoRa_Rocket.ino (for PERUN_ROCKET). LoRa SPI pins (SCK, MOSI, MISO) should be connected to corresponding SPI pins on the Arduino board (usually respectively 18,23,19 for ESP32 boards). LORA_SS_PIN - Slave Select pin. LORA_RESET_PIN - LoRa reset pin.

startLoRa function initializes LoRa radio with specified hardcoded frequency on specified hardcoded pins

Data packet

Before any data there should be LORA_PACKET_MAGIC string to make sure we are not processing garbage.

Types of data:

  • LORA_PACKET_TELEMETRY_TYPE (0x01) Telemetry from the rocket
  • LORA_PACKET_STATUS_TYPE (0x02) Status of the rocket
  • LORA_PACKET_COMMAND_TYPE (0xA1) Command from the base

PERUN ROCKET

Sends telemetry to the base and listens to commands.

Functions:


PERUN BASE

Sends commands from Serial and receives telemetry from the rocket.

LoRa_Base functions:

  • sendCommand - sends (binary) command to the rocket (LORA_START_CMD_CODE(0x41) for ignition, LORA_DEPLOY_CMD_CODE(0x42) for parachute deployment)
  • parseLoRaData - parses PR packet and prints received telemetry or rocket status

Perun_SerialCmd functions:

  • executeCommand - executes specified function based on data received from Serial
  • checkForCommand - checks if there are any commands on Serial

Available commands:

  • PR (should print "OK\n")
  • PR+START (starts rocket)
  • PR+DEPLOY (deploys parachute)
  • PR+LORA (dumps LoRa registers)

All functions save data to Stream specified as an argument (eg. Serial or SD).


Example usage gif Live demo of actual working modules (left: Base; right: Rocket).

Libraries

Code uses Arduino LoRa library, which is licensed under the MIT Licence.

About

Implementation of radio sender and receiver for Perun Rockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%