FOSSASystems / FOSSASAT-1

GNU General Public License v3.0
536 stars 106 forks source link

RTTY support in KiteLib #1

Closed jgromes closed 5 years ago

jgromes commented 6 years ago

Hi @Bambofy, did you know that KiteLib supports RTTY directly? You don't have to implement it yourself ;)

All you have to do to change from LoRaLib to KiteLib is to replace the included file

#include <KiteLib.h>

and the constructor

SX1278 lora = new Module(cs, dio0, dio1);

Because KiteLib is built on top of LoRaLib, nothing in the API changes, so those two things are literally the only two lines of code you have to change.

After that, you can use the RTTY just as easily as Arduino Serial port:

RTTYClient rtty(&lora);

rtty.begin(freq, shift, baudRate, dataBits, stopBits);
rtty.println("Hello World!");
Bambofy commented 6 years ago

Very nice, how so I do I switch between lora mode, fsk packet mode and afsk direct rtty with kitelib?

jgromes commented 6 years ago

Exactly the same way as in LoRaLib:

#include <KiteLib.h>

SX1278 lora = Kite.ModuleA;
RTTYClient rtty(&lora);

void setup() {

}

void loop() {
  // send LoRa packet
  lora.begin();
  lora.transmit("Hello World!");
  delay(1000);

  // send FSK packet
  lora.beginFSK();
  lora.transmit("Hello World!");
  delay(1000);

  // begin RTTY at 434 MHz, 183 Hz shift, 45 baud, 8 data bits, 1 stop bit
  rtty.begin(434, 183, 45);

  // idle condition lead-in for 500 ms
  rtty.idle();
  delay(500);

  // send RTTY data "Hello World!\r\n"
  rtty.println("Hello World!");

  // turn off transmitter
  lora.standby();
  delay(1000);
}