chandrawi / LoRaRF-Python

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

spi.open FileNotFoundError #10

Open mgh2010 opened 1 year ago

mgh2010 commented 1 year ago

hi, I installed latest version of LoRaRF with pip on raspberry pi Zero 2 w and i have Lora Ai-Thinker Ra-02 with SX1278. I did enabled the SPI as well. but keep getting this error. what is Wrong?

image

and using this example code:

https://github.com/chandrawi/LoRaRF-Python/blob/main/examples/SX127x/transmitter.py

chandrawi commented 1 year ago

If you sure you have enabled SPI, FileNotFound error happen because the problem in Linux kernel, or you used wrong SPI bus you already enabled. Please note that if SPI is enabled and no issue in Linux kernel, this error is not going to happen even the SPI pin does not connect to the LoRa module. So, it is not caused by wrong wiring connection.

I guess the error happen because you enable SPI bus 0 and you did not change the SPI bus id in the example from 1 to 0. Also make sure you connect CS pin correctly.

chandrawi commented 1 year ago

This error happen because the SPI port is not enabled yet for selected SPI bus. If you used SPI port 1, add this line in /boot/config.tx

  1. dtoverlay=spi1-3cs

On Sat, Feb 18, 2023, 8:24 PM mgh2010 @.***> wrote:

hi, I installed latest version of LoRaRF with pip on raspberry pi Zero 2 w, and did enabled the SPI. but keep getting this error. what is Wrong.

[image: image] https://user-images.githubusercontent.com/55698586/219868173-6cf8d94f-2f84-4576-8f5c-75367b7bcef1.png

— Reply to this email directly, view it on GitHub https://github.com/chandrawi/LoRaRF-Python/issues/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR5MCKTXJY4BD5DHZPLN63DWYDEPNANCNFSM6AAAAAAVALC6XI . You are receiving this because you are subscribed to this thread.Message ID: @.***>