zhgzhg / LoRaPacketForwarder

LoRa single channel packet forwarder based on the Semtech UDP protocol v2
27 stars 12 forks source link

RFM96: "LoRa chip setup failed, code 65520" #8

Closed dogefreak closed 3 years ago

dogefreak commented 3 years ago

I'm currently using this code on my RbPI together with an RFM96, configured the pins correctly, updated WiringPi ect... Getting error code "65520" (LoRa chip setup failed, code 65520). Any suggestions on what this could be?

zhgzhg commented 3 years ago

Error 65520 indicates unsuccessful SPI write operation. Please check the SPI MISO and MOSI pins. Connecting them in reverse can cause such an issue.

Also be aware that the version of WiringPi supplied by this project is compatible with the Orange Pi platform only. For Raspberry Pi the WiringPi supplied by Raspbian or its package manager have to be used.

zhgzhg commented 3 years ago

@dogefreak did you manage to resolve the problem?

dogefreak commented 3 years ago

@zhgzhg I double-checked everything, including the pins. Everything seems to be right. It'd be useful to know what the error codes actually mean. For instance, I've had 65520 but now I have 65524.

zhgzhg commented 3 years ago

I'll certainly improve that part.

Error 65524 indicates bad frequency - perhaps your config's _carrier_frequencymhz value has it set outside the supported for RFM96 range,

dogefreak commented 3 years ago

Yepp I got it. Some dodgy vendor sold me the wrong RFM module. I suggest, if you have time to implement readable error codes you definitely should. Thanks for the great project & support, closing the issue now.