RADIOLIB_ERR_SPI_WRITE_FAILED (-16) #886
-
Hi all The LoraMesher library currently still uses RadioLib 5.7.0 https://github.com/jgromes/RadioLib/releases/tag/5.7.0 I have a strange error that randomly stops one or more nodes from working. I've been looking for this for ages, it's been very tricky to track down. I have recently implemented logging to SD Card on the nodes, which should have been easy but wasn't, and the fault developed on one of them. The first error is: Which translates to: #define RADIOLIB_ERR_SPI_WRITE_FAILED (-16) After the SPI error, incoming messages to this node show a CRC error and messages transmitted by it show a CRC error on the receiving node. In this case, the node had been online for 40634929 milliseconds and had successfully sent 100s of reliable (confirmed) data packets. Does anyone have any idea what may cause the SPI error? [Edit] I am using the SD MMC library to write to the SD card. I'm hopeful that this is the same error I had before adding logging to the installs, but cannot be certain as there is no data. The SD Card is implemented using this code https://gist.github.com/igrr/82055d824cbbc521932f32217e0710b9 Any ideas gratefully accepted. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
By default, RadioLib is quite paranoid when it comes to the SPI devices, and tries to verify SPI register writes by a subsequent read (where applicable). If the value did not change in hte expected way, it will return SPI failed error. In your case, I would do a reset of the radio and then reconfigure the radio by calling the appropriate begin method. I don's think there's a need to reboot the node itself. Or, if you're feeling lucky, you can disable the SPI checking. |
Beta Was this translation helpful? Give feedback.
By default, RadioLib is quite paranoid when it comes to the SPI devices, and tries to verify SPI register writes by a subsequent read (where applicable). If the value did not change in hte expected way, it will return SPI failed error.
In your case, I would do a reset of the radio and then reconfigure the radio by calling the appropriate begin method. I don's think there's a need to reboot the node itself.
Or, if you're feeling lucky, you can disable the SPI checking.