PiInTheSky / lora-gateway

LoRa gateway to Habitat
96 stars 69 forks source link

Gateway Pi showing received data in gibberish #74

Closed jaygould closed 12 months ago

jaygould commented 1 year ago

Hi all, I am sending data from a RFM98 (attached to an ESP32) to the other RFM98 attached to a Raspberry Pi 4b running LoRa gateway. The sending module is using arduino-lora.

The Pi is receiving the data but it's showing an incorrectly formatted string which looks like it's not been decoded correctly:

Screenshot 2023-03-29 at 15 20 14

Not sure what the issue could be. Here's my sending code for reference:

#include <SPI.h>
#include <LoRa.h>

int counter = 0;

void setup() {
  Serial.begin(9600);
  while (!Serial);
  LoRa.setPins(4, 2, 15);
  LoRa.setSignalBandwidth(125E3);
  LoRa.setCodingRate4(7);
  LoRa.setSpreadingFactor(7);
  LoRa.enableCrc();

  if (!LoRa.begin(434E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }
}

void loop() {
  Serial.print("Sending packet: ");
  Serial.println(counter);

  LoRa.beginPacket();
  LoRa.print("$$hadie,");
  LoRa.print(counter);
  LoRa.print(",10:42:10,53.786244,-2.290401,27799.3,1:10\n");
  LoRa.endPacket();

  counter++;

  delay(4000);
}
PiInTheSky commented 1 year ago

I'm not familiar with that library. The HAB gateway doesn't do any decoding; it simply shows the string that the LoRa module has received.

You could try different settings for LoRa; I suggest just setting mode 1 in the gateway and matching those settings at the transmitter.

Other than that I have no suggestions.

Dave

On Wed, 29 Mar 2023 at 16:10, Jay @.***> wrote:

Hi all, I am sending data from a RFM98 (attached to an ESP32) to the other RFM98 attached to a Raspberry Pi 4b running LoRa gateway. The sending module is using arduino-lora https://github.com/sandeepmistry/arduino-LoRa.

The Pi is receiving the data but it's showing an incorrectly formatted string which looks like it's not been decoded correctly:

[image: Screenshot 2023-03-29 at 15 20 14] https://user-images.githubusercontent.com/13678558/228583647-00a344f6-f968-4dcf-93ff-609af6f9aadb.png

Not sure what the issue could be. Here's my sending code for reference:

include

include

int counter = 0;

void setup() { Serial.begin(9600); while (!Serial); LoRa.setPins(4, 2, 15); LoRa.setSignalBandwidth(125E3); LoRa.setCodingRate4(7); LoRa.setSpreadingFactor(7); LoRa.enableCrc();

if (!LoRa.begin(434E6)) { Serial.println("Starting LoRa failed!"); while (1); } }

void loop() { Serial.print("Sending packet: "); Serial.println(counter);

LoRa.beginPacket(); LoRa.print("$$hadie,"); LoRa.print(counter); LoRa.print(",10:42:10,53.786244,-2.290401,27799.3,1:10\n"); LoRa.endPacket();

counter++;

delay(4000); }

— Reply to this email directly, view it on GitHub https://github.com/PiInTheSky/lora-gateway/issues/74, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4ERK5ZTRGQJMALNLHX3DTW6RGE3ANCNFSM6AAAAAAWMB5EGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jaygould commented 1 year ago

@daveake I've been banging my head against the wall since yesterday afternoon and all it took was to change the mode from 0 to 1. Thank you so much! 🙂

daveake commented 1 year ago

Excellent!

On Wed, 29 Mar 2023, 16:38 Jay, @.***> wrote:

@daveake https://github.com/daveake I've been banging my head against the wall since yesterday afternoon and all it took was to change the mode from 0 to 1. Thank you so much! :)

— Reply to this email directly, view it on GitHub https://github.com/PiInTheSky/lora-gateway/issues/74#issuecomment-1488860352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGQ5BPZNQGS456JFYO2UTW6RJQ5ANCNFSM6AAAAAAWMB5EGI . You are receiving this because you were mentioned.Message ID: @.***>