Trying to get NodeMCU ESP8266 using SPI working with Qwiic AS3935 Lightning Detector (SPX-15057)

I’m trying to run Example2_More_Lightning_features running correctly with a NodeMCU style ESP8266 connecting via SPI to the Qwiic AS3935 Lightning Detector (SPX-15057) and am getting incorrect output.

I’m using pins (MISO = GPIO12/D6, MOSI = GPIO13/D7, SCLK = GPIO14/D5) and lightningInt = D2 and spiCS = D8.

When I run the example code I’m getting weird output:

AS3935 Franklin Lightning Detector

Schmow-ZoW, Lightning Detector Ready!

Are disturbers being masked: YES

Are we set for indoor or outdoor: 11111

Noise Level is set at: 7

Watchdog Threshold is set to: 15

Spike Rejection is set to: 15

The number of strikes before interrupt is triggerd: 16

Those values don’t make sense because I’ve set maskDisturber(false), OUTDOOR mode, noise=2, lightingThresh=1.

I’m using the current version of the Sparkfun_AS3935 library. This appears to me to be something like a word length of byte order issue, but I don’t know why.

Can anyone confirm that this library does actually work with an ESP8266? I see mention of ESP32 in the code so it appears there were attempts to make it work.

Nothing?

Despite the deafening silence from Sparkfun support I figured it out. If you’re going to use the SPI interface as recommended in the hookup guide you have to solder the jumper bridge to enable SPI. If you don’t the samples appear to work but return the weird results shown above.

Im using I2C on an AS3935 (red board) from an ESP32 (WROOM). I dont seem to have comms issues - the board starts up and if I fake the interrupt by pulling the jumper it responds with max-val numbers.

My problem is the thing doesnt seem to trigger when there is lightning about, I was actually considering switching to SPI to see if it made a difference. I suspect the board is dodgy though - when I simulate lightning by shorting out a mosquito killing tennis racket thingy, I sometimes get the interrupt triggered - although then I get a response code of 15 which does not seem valid.