Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

rfm9x raspberrypi-issue (check wiring)
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

rfm9x raspberrypi-issue (check wiring)

by pavith on Wed Oct 14, 2020 2:30 am

hi,
Recently i brought RFM9x module from mouser.
i have tried to connect the lora node with raspberrypi but ended with error. i have searched for the solution but i cant find anything.

i have followed this
https://learn.adafruit.com/using-lorawa ... hon/wiring

and run following code

import time
import busio
import digitalio
import board
from adafruit_tinylora.adafruit_tinylora import TTN, TinyLoRa

# Board LED
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)

# RFM9x Breakout Pinouts
cs = digitalio.DigitalInOut(board.D5)
irq = digitalio.DigitalInOut(board.D6)
rst = digitalio.DigitalInOut(board.D4)

# Feather M0 RFM9x Pinouts
# cs = digitalio.DigitalInOut(board.RFM9X_CS)
# irq = digitalio.DigitalInOut(board.RFM9X_D0)
# rst = digitalio.DigitalInOut(board.RFM9X_RST)

# TTN Device Address, 4 Bytes, MSB
devaddr = bytearray([ 0x26, 0x01, 0x17, 0xE4 ])

# TTN Network Key, 16 Bytes, MSB
nwkey = bytearray(
[
0x55, 0xA1, 0x88, 0xA8, 0x3D, 0x93, 0x2F, 0xD3, 0xFC, 0x13, 0xFB, 0x9F, 0x68, 0x60, 0xFD, 0x46
]
)

# TTN Application Key, 16 Bytess, MSB
app = bytearray(
[
0xB9, 0xF1, 0x3E, 0xC4, 0xDE, 0x1A, 0x5A, 0x07, 0x00, 0x2A, 0x49, 0xE3, 0x76, 0x3E, 0x03, 0x11
]
)

ttn_config = TTN(devaddr, nwkey, app, country="EU")



lora = TinyLoRa(spi, cs, irq, rst, ttn_config)

while True:
data = bytearray(b"\x43\x57\x54\x46")
print("Sending packet...")
lora.send_data(data, len(data), lora.frame_counter)
print("Packet sent!")
led.value = True
lora.frame_counter += 1
time.sleep(1)
led.value = False


but ended this error


Traceback (most recent call last):
File "/home/pi/Adafruit_CircuitPython_TinyLoRa/examples/tinylora_simpletest.py", line 44, in <module>
lora = TinyLoRa(spi, cs, irq, rst, ttn_config)
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_tinylora/adafruit_tinylora.py", line 161, in __init__
raise TypeError("Can not detect LoRa Module. Please check wiring!")
TypeError: Can not detect LoRa Module. Please check wiring !

please help me out with this.

thanks in advance

pavith
 
Posts: 2
Joined: Tue Oct 13, 2020 3:58 am

Re: rfm9x raspberrypi-issue (check wiring)

by pavith on Wed Oct 14, 2020 3:44 am

hi guys,
i have solved that issue by changing the pin numbers
# RFM9x Breakout Pinouts
cs = DigitalInOut(board.CE1)
irq = DigitalInOut(board.D22)
rst = DigitalInOut(board.D25)

but now im getting the new timeout error

%Run tinylora_simpletest.py
Sending packet...
Traceback (most recent call last):
File "/home/pi/Adafruit_CircuitPython_TinyLoRa/examples/tinylora_simpletest.py", line 45, in <module>
lora.send_data(data, len(data), lora.frame_counter)
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_tinylora/adafruit_tinylora.py", line 282, in send_data
self.send_packet(lora_pkt, lora_pkt_len, timeout)
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_tinylora/adafruit_tinylora.py", line 328, in send_packet
raise RuntimeError("Timeout during packet send")
RuntimeError: Timeout during packet send

help me out

pavith
 
Posts: 2
Joined: Tue Oct 13, 2020 3:58 am

Please be positive and constructive with your questions and comments.