computenodes / dragino

LoRaWAN implementation in python
GNU Affero General Public License v3.0
27 stars 11 forks source link

Compatibility with Adafruit RFM95W? #8

Closed RaghavRao closed 3 years ago

RaghavRao commented 3 years ago

Hey,

The original project claimed this worked with an RFM95, is there any way this code might work too?

When running test.py I get:


Mode <- SLEEP
Mode <- FSK_STDBY
Traceback (most recent call last):
  File "./test.py", line 13, in <module>
    D = Dragino("dragino.ini", logging_level=logging.DEBUG)
  File "/home/pi/LoRaWAN/dragino/dragino.py", line 56, in __init__
    super(Dragino, self).__init__(logging_level < logging.INFO)
  File "/home/pi/LoRaWAN/dragino/SX127x/LoRa.py", line 100, in __init__
    self.rx_chain_calibration(calibration_freq)
  File "/home/pi/LoRaWAN/dragino/SX127x/LoRa.py", line 854, in rx_chain_calibration
    self.set_mode(op_mode_bkup)
  File "/home/pi/LoRaWAN/dragino/SX127x/LoRa.py", line 221, in set_mode
    sys.stderr.write("Mode <- %s\n" % MODE.lookup[mode])
KeyError: 0

I'm guessing this is due to using a different hat?

BNNorman commented 3 years ago

Sorry to see no-one has replied to this, so here goes.

The Dragino I have has a Hope RFM95 pcb soldered on it so it should work. The W postfix simply means Worldwide distribution IIRC.

You should check the Dragino schematic to see what RPi pin/wiring is used.

The keyerror simply says that the value of 'mode' in MODE.lookup[mode] in the function set_mode() does not exist. Which I think is odd since there are two mode changes earlier.

I don't have time to look through LoRa.py today to see if I can work out what the problem is. Check your wiring first because this code works just fine on the Pi Dragino HAT.

RaghavRao commented 3 years ago

Hi thanks for your response. I found this library which does exactly what I was looking for:

https://github.com/ryanzav/LoRaWAN

On Fri, May 28, 2021, 03:38 Brian @.***> wrote:

Sorry to see no-one has replied to this, so here goes.

The Dragino I have has a Hope RFM95 pcb soldered on it so it should work. The W postfix simply means Worldwide distribution IIRC.

You should check the Dragino schematic to see what RPi pin/wiring is used.

The keyerror simply says that the value of 'mode' in MODE.lookup[mode] in the function set_mode() does not exist. Which I think is odd since there are two mode changes earlier.

I don't have time to look through LoRa.py today to see if I can work out what the problem is. Check your wiring first because this code works just fine on the Pi Dragino HAT.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/computenodes/dragino/issues/8#issuecomment-850217195, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUBDUYP3OT53ZXRSEYM4JTTP5B6DANCNFSM42RLATPQ .