How to read a specific register using spi_xfer from PIGPIO

2018-06-24 05:44:51

I am building a single channel LoRa gateway using the RFM95W module. I am using this github repo; single_chan_pkt_fwd, as a guide.

However I am not yet using a PCB, even though it is very difficult, but I wanted the practice. So I removed the male ends off these jumper wires and soldered the copper directly to the module, and connected the female ends to the Pi.

I took extra care not to short the board, and I think I've done it correctly.

To verify that though, I wanted to read the contents of the RegVersion register, which is at address 0x42; see page 85 of the data sheet.

I am using the following python code in terminal (over ssh / not over network with daemon -- not sure if that's causing more problems) for testing:

####################################

# running Linux raspberrypi 4.14.34-v7+

####################################

import pigpio

import time

pi = pigpio.pi()

# this is the reset pin

pi.set_mode(17, pigpio.OUTPUT)

# this is the DIO0 pin

pi.set_mode(27