Posts

Showing posts with the label SX127x

SX1278: testing SDRAngel LoRa demodulator

Image
 18.2.2024 SX1278: testing SDRAngel LoRa demodulator Arduino Uno Dragino Lora Shield Semtech SX1278 SDRAngel 7.17.1 SDRAngel LoRa demodulator manages to properly decode TX with spreading factor 12. Spreading factor 11 produces wrong decoding of payload (FEC fix without ok correction)

Inspecting Verto water meter - 2

Image
 4.2.2024 Inspecting Verto water meter - 2 Some Verto water meter collector units use Lora communication at 433 MHz ISM band. Arduino Uno Dragino Lora shield (Semtech SX1278)     #include <SPI.h>   #define SERIAL_SPEED        115200   #define LORA_FREQ           433.300 #define STATE_SLEEP         0 #define STATE_STANDBY       1 #define STATE_FSRX          4 #define STATE_RX            5 #define S_DELAY             10 #define L_DELAY             100 #define RX_BUFFER_LEN       255 #define SX_FREQ          ...

Super simple LoraWAN rx for Arduino/SX127x

Image
 12.4.2021 Super simple LoraWAN rx for Arduino/SX127x #include <SPI.h> #define SERIAL_SPEED        9600 #define LORA_FREQ           869.525 #define STATE_SLEEP         0 #define STATE_STANDBY       1 #define STATE_FSRX          4 #define STATE_RX            5 #define S_DELAY             10 #define L_DELAY             100 #define RX_BUFFER_LEN       255 #define SX_FREQ             "Frequency " #define SX_VERSION          "Chip version " #define PRINT_MODEM_STAT #undef PRINT_MO...

Experimenting with URH sniff protocol + SX1278/Arduino

Image
 12.6.2020 Experimenting with URH sniff protocol + SX1278/Arduino HW: Arduino Due + Dragino Lora Module (Semtech SX1278) SW: Universal Radio Hacker, LoraLib for Arduino 435 MHz FSK 4800 bps 0xAA preamble + 8 sync bytes, no FSK data shaping. URH sniff protocol managed to show correct preamble and sync bytes (almost). Samples per symbol value = 58, 250 000 samples/second / 4800 = 52, but a bit greater values worked better. Bits per symbol = 1 (2-FSK) #include <LoRaLib.h> SX1278 fsk = new LoRa; void setup() {   Serial.begin(9600);   Serial.print(F("Initializing ... "));   int state = fsk.beginFSK();   if (state == ERR_NONE) {     Serial.println(F("success!"));   } else {     Serial.print(F("failed, code "));     Serial.println(state);     while (true);   }   state = fsk.setFrequency(435.0);   state = fsk.setBitRate(4.8);   state = fsk.setFrequencyDeviation(10.0);   state...

Decoding wM-Bus with Arduino/SX1278

Image
5.7.2020 Decoding wM-Bus with Arduino/SX1278 Hardware: Arduino Due & Dragino Lora Module 868 MHz (Semtech SX1278) https://en.wikipedia.org/wiki/Meter-Bus http://uu.diva-portal.org/smash/get/diva2:847898/FULLTEXT02.pdf   #include <SPI.h> #define SERIAL_SPEED        38400 #define S_MODE_BPS          32768 #define T_MODE_BPS          100000 #define R_MODE_BPS          4800 #define C_MODE_BPS          100000 #define S_MODE_FREQ         868.287 // 868.3 #define T_MODE_FREQ         868.95 #define R_MODE_FREQ         868.33 #define C_MODE_FREQ         868.95 #define STATE_SLEEP     ...

Arduino/SX1278 - transmit DTMF

Image
31.7.2020 Arduino/SX1278 - transmit DTMF Arduino Uno Dragino Lora Module (SX1278) https://www.arduinolibraries.info /libraries/tone-library https://github.com/jgromes/LoRaLib   Quick and dirty. Better with some components, e.g. capacitors. Dragino Lora Module DIO2 (DCLK) is connected to pin 6. #include <Tone.h> #include <LoRaLib.h> #define DTMF_PIN1 3 #define DTMF_PIN2 4 SX1278 fsk = new LoRa; Tone freq1; Tone freq2; const int16_t DTMF_freq1[] = {1336, 1209, 1336, 1477, 1209, 1336, 1477, 1209, 1336, 1477}; const int16_t DTMF_freq2[] = {941, 697, 697, 697, 770, 770, 770, 852, 852, 852}; void setup() {   Serial.begin(9600);   freq1.begin(DTMF_PIN1);   freq2.begin(DTMF_PIN2);   Serial.print(F("Initializing ... "));   int16_t state = fsk.beginFSK();   if (state == ERR_NONE) {     Serial.println(F("success!"));   } else {     Serial.print(F("failed, code "));     Serial.println(state);  ...

SX1278 OOK waveform view with C# chart control - 4

Image
2.2.2020 SX1278 OOK waveform view with C# chart control - 4 Oscilloscope "moving effect" lookalike         private void timer1_Tick(object sender, EventArgs e)         {             if (_run)             {                 for (int i = _index; i < _xValues.Count; i++)                 {                     chart1.Series[0].Points.AddY(_xValues[i]);                     if (chart1.Series[0].Points.Count > 100)           ...

SX1278 OOK waveform view with C# chart control - 3

  19.1.2020 SX1278 OOK waveform view with C# chart control - 3 https://github.com/OH1GIU-P/SxWavePlot Without datasource. Add new received values to chart         private bool _run = false;         private ArrayList _xValues = new ArrayList();         private int _val = 1; // add this:         private int _index = 0; private void buttonStart_Click ...                 _xValues.Clear();                 _index = 0;                 chart2.DataSource = null; ... private void buttonStop_Click ...             _run = false;          ...

SX1278 OOK waveform view with C# chart control - 2

Image
  sunnuntai, 19. tammikuu 2020 SX1278 OOK waveform view with C# chart control - 2 Dragino Lora Shield (Semtech SX1278) Arduino Due Visual Studio, C# Chart cannot be updated in serial port datareceived event (Collection was modified; enumeration operation may not execute). One solution is updating chart data in timer ontick event or in separate thread.   using System; using System.Collections; using System.Threading.Tasks; using System.Threading; using System.Windows.Forms; using System.IO.Ports; using System.Windows.Forms.DataVisualization.Charting; namespace SxWavePlot {     public partial class FormMain : Form     {         private bool _run = false;         private ArrayList _xValues = new ArrayList();         private int _val = 1;         public FormMain()         { ...

SX1278 OOK waveform view with C# chart control

Image
12.1.2020 SX1278 OOK waveform view with C# chart control Dragino Lora Shield (Semtech SX1278) Arduino Due Visual Studio, C#   Arduino code #include <SPI.h> #define SERIAL_SPEED        57600 #define BPS                 1200 #define FREQ                433.9855 #define STATE_SLEEP         0 #define STATE_STANDBY       1 #define STATE_FSRX          4 #define STATE_RX            5 #define S_DELAY             10 #define L_DELAY             100 #define CH_FILTER_BW        B000...

Decoding Silvercrest wireless doorbell with SX1278/Arduino

Image
  24.5.2019 Decoding Silvercrest wireless doorbell with SX1278/Arduino Equipment used: Dragino Lora Shield (Semtech SX1278 chip) https://wiki.dragino.com/index.php?title=Lora_Shield Arduino Due (Digital pin 7 [DIO2/Data] used for IRQ, so e.g. Arduino Uno cannot be used) Rc-switch library https://github.com/sui77/rc-switch SX1278 datasheet: https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1278 Speed (BPS) must be set, it does not need to be exact. Bit sync off, continuous rx mode (demodulator raw data out from pin 7 [DIO2/DATA]), rx channel filter bandwidth between 75 - 100 kHz, sync detect off, DC free decoding = none. Mode: OOK #include <SPI.h> #include <RCSwitch.h> RCSwitch rcs = RCSwitch(); #define SERIAL_SPEED        9600 #define FREQ                433.946 #define BPS            ...