eni diamantis
eni diamantis

Reputation: 1

Problem transferring sensor data with LoRa sx1262 + Raspberry Pi Pico

I am new to the micro-controller game and I ran into some issues trying to send data from one Pi Pico to another one using the SX1262 LoRa module by Waveshare.

Basically what I eventually want to do is make a sensor network and send all the data that I am going to gather from the sensors to a gateway and through there to a server for further development.

The first step is to send a simple string from one Raspberry Pi Pico to the other one, so I can understand the driver a little bit better and eventually make any modifications needed to create my project.

The driver that I found for the SX1262 is this one.

When I try to run the code on my Pico using the Thonny IDE, I get the following errors:

Traceback (most recent call last):

  File "< stdin >", line 11, in <module>

  File "sx1262.py", line 27, in begin

  File "sx126x.py", line 115, in begin

  File "sx126x.py", line 240, in reset

  File "sx126x.py", line 389, in standby

  File "sx126x.py", line 1270, in SPIwriteCommand

  File "sx126x.py", line 1287, in SPItransfer

TypeError: object with buffer protocol required

Those errors happen both on the TX and TX (non blocking), which are in the examples folder.

Can someone help me with this and hopefully explain some things to me? Because as long as I get the driver running fine I can continue with my project.

Upvotes: 0

Views: 1226

Answers (1)

dda
dda

Reputation: 6213

TypeError: object with buffer protocol required means that you are trying to send something that's neither a string nor a byte array. Check your code, and convert your data to a proper type.

Upvotes: 0

Related Questions