chandrawi / LoRaRF-Python

Python library for basic transmitting and receiving data using LoRa and FSK modem
MIT License
29 stars 15 forks source link

Execution error #5

Closed victorfmin66 closed 1 year ago

victorfmin66 commented 1 year ago

Hello and thank you for maintaining this repository and the library.

I'm having some issues trying the examples for SX127x called receiver and transmitter. Both of them have the following error:

Begin LoRa radio
Traceback (most recent call last):
  File "/home/pi/receiver.py", line 13, in <module>
    if not LoRa.begin(busId, csId, resetPin, irqPin, txenPin, rxenPin) :
  File "/usr/local/lib/python3.9/dist-packages/LoRaRF/SX127x.py", line 193, in begin
    self.setSpi(bus, cs)
  File "/usr/local/lib/python3.9/dist-packages/LoRaRF/SX127x.py", line 251, in setSpi
    spi.open(bus, cs)
FileNotFoundError: [Errno 2] No such file or directory

Seems the error is in the busId or the csId but I'm not sure why this error appears. I'm using a raspberry pi 3b+ and SPI is enabled.

This are my variable values I have on the code for the LoRa.begin function:

busId = 1; csId = 0
resetPin = 17; irqPin = -1; txenPin = -1; rxenPin = -1

Thank you!

Victor

victorfmin66 commented 1 year ago

I made a mistake on the code and I had to modify the variable busId to 0 instead of 1 that was written by default.