Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5391

Troubleshooting • OSError 16 When Attempting to Use CE1

$
0
0
Hi, I'm attempting to test my LoRa 95 radios from Adafruit by connecting one pi to each.

I'm using the following program, loaded onto each pi:

Code:

import timeimport busiofrom digitalio import DigitalInOut, Direction, Pullimport board# Import the SSD1306 module.# Import the RFM9x radio module.import adafruit_rfm9x# Configure RFM9x LoRa RadioCS = DigitalInOut(board.CE1)RESET = DigitalInOut(board.D25)spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, 915.0)rfm9x.tx_power = 23prev_packet = Nonewhile True:    """ packet = None    if packet is None:        print("Awaiting packet")    else:        # Display the packet text and rssi        prev_packet = packet        packet_text = str(prev_packet, "utf-8")        print(f'RX: {packet_text}')        time.sleep(1) """            rfm9x.send(bytes("Test success\r\n","utf-8"))    time.sleep(1)
This seemed to run fine on my Pi4, but when using my Pi5 for the other radio, I kept getting the error message:

Code:

Traceback (most recent call last):  File "/home/quincy/Desktop/LoRaTesting.py", line 21, in <module>    CS = DigitalInOut(board.CE1)         ^^^^^^^^^^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/dist-packages/digitalio.py", line 187, in __init__    self.direction = Direction.INPUT    ^^^^^^^^^^^^^^  File "/usr/local/lib/python3.11/dist-packages/digitalio.py", line 217, in direction    self._pin.init(mode=Pin.IN)  File "/usr/local/lib/python3.11/dist-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod/libgpiod_pin_1_x.py", line 92, in init    self._line.request(OSError: [Errno 16] Device or resource busy
I've tried the following in attempt to remedy it:
  • Changing the pin from CE1 to CE0
  • Changing the pin to an empty GPIO pin (GPIO 17 for example)
  • Swapping the radios (still issue, must be the pi)
  • Swapping out the wires
  • Doing a clean raspbian lite install ...three times.
  • Ensuring SPI is enabled
  • Checking the wiring like a billion times
Not quite sure where to go from here, this issue doesn't seem to be well documented.

Statistics: Posted by AppleByter — Thu Mar 21, 2024 3:41 am



Viewing all articles
Browse latest Browse all 5391

Trending Articles