Problems setting up a Mikroe Pi 3 Click Shield and AS3935 thunder Click

I meant the Youtube Bass sweep…not an app. Anyway I’ve tried the base sweep video on both my phone and laptop and it didn’t make any lightning. I also tried a lighter with a piezo spark generator but that didn’t do anything either. I’m wondering if neither are sufficiently like a lightning strike to trigger the detector?

Yeah sounds like the Base Sweep won’t work for your lightning detector. I have to place my phone’s speaker about 2 to 3 inches away from the detector antenna to get it to trigger strikes. Your detector’s algorithm is probably way better at filtering out false hits.

Hi,

Sory I’m not able reply, I’m out of action due to covid, back soon

Michael

I hope you’re feeling much better very soon.

Hello again…
I have tried a few times to install the software, but no luck.
What ever I try, I get the same “connack” error, the last attempt was with the Debian Bullseye 32 bit (with all the apt-get updates) and always with the SPI enabled.
But I’m using a RPI 3 so that may be the issue?

The error:

pi@raspberrypi:~ $ sudo systemctl status as3935_monitor.service ● as3935_monitor.service - AS3935 Monitor service Loaded: loaded (/lib/systemd/system/as3935_monitor.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2022-06-15 08:45:05 BST; 22h ago Main PID: 801 (python3) Tasks: 9 (limit: 1598) CPU: 48min 19.306s CGroup: /system.slice/as3935_monitor.service ├─801 /usr/bin/python3 /home/pi/Sensors/as3935_monitor.py ├─802 /usr/bin/python3 /home/pi/Sensors/as3935_monitor.py └─812 /usr/bin/python3 /home/pi/Sensors/as3935_monitor.py

Jun 15 08:45:07 raspberrypi python3[812]: rc = self._packet_read()
Jun 15 08:45:07 raspberrypi python3[812]: File “/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py”, line 2439, in _packet_read
Jun 15 08:45:07 raspberrypi python3[812]: rc = self._packet_handle()
Jun 15 08:45:07 raspberrypi python3[812]: File “/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py”, line 3039, in _packet_handle
Jun 15 08:45:07 raspberrypi python3[812]: return self._handle_connack()
Jun 15 08:45:07 raspberrypi python3[812]: File “/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py”, line 3138, in _handle_connack
Jun 15 08:45:07 raspberrypi python3[812]: on_connect(
Jun 15 08:45:07 raspberrypi python3[812]: File “/home/pi/Sensors/as3935_monitor.py”, line 357, in on_connect
Jun 15 08:45:07 raspberrypi python3[812]: logger.debug("MQTT broker connection failed with result: "+connack_string(rc))
Jun 15 08:45:07 raspberrypi python3[812]: NameError: name ‘connack_string’ is not defined

Is it a 3 or 3B? I think hcorrin had it running on a 3B but I’m not sure if anyone has tried it on a 3.

It’s a 3B, and I had it running for a long time, but a few months ago it started to only run for a few minutes, so I descided to reinstall, and then the error started.

I’ll try to put a debug program together to confirm some settings. I won’t be able to do much until next week though. We’ve got family visitors with us from various parts of the world this week.

Hi All,

I have just about recovered from Covid.

And have been playing again with DFRobot Gravity: Lightning Distance Sensor and using the biffobear_as3935 CircuitPython_AS3935 drivers.
Hopefully it should work with most I2C AS3935, without too much fuss.

Which outputs Nowcast.txt and strike_log.txt, which I store on a raspberry Pi 3A to a folder WxRam, which is a ram folder created by adding
‘tmpfs /home/pi/WxRam tmpfs defaults,noatime,nosuid,mode=0777,size=6M 0 0’, to the end of the fstab file.

I start the script at start up by using CircuitPython_AS3935.service included in the zip.

The CircuitPython_AS3935_v202d.py script has been placed in /home/pi/Lightning/.

Log files are stored in /home/pi/Logs/ .

I suggest you install the biffobear_as3935 CircuitPython_AS3935 drivers from the

I would like to thank biffobear over on github for helping me with a few settings

I have the program working at home, and still produces false strikes, I have a feeking that these maybe caused by local interference.
Here in S.E. England they are forcasting Thunder over the weekind, I hopefully I can put it to the test?

I will keep playing, I as toying with the idea if using a Raspberry Pi Pico or Adafruit Feather to run this project.

Please suggest and post any modications, to help this project along, I’m use there must better programmers than me out there.

I hope some others will have a play!!

Michael


CircuitPython_AS3935.zip (105 KB)

Still no luck.

My 4GB Pi4 is now built using 32-bit Pi OS Lite (Debian Bullseye) and fully patched before I installed the AS3935 software. My previous tests were with Debian Buster so this was a new environment for me. I installed the pre-requisites and enabled the SPI interface using raspi-config, then ran the installer with the ThunderClick in slot 1. The installer ran without errors and correctly identified the ThunderClick on completion. The as3935_monitor service ran without errors and the web page can be accessed. There's no lightning here at the moment but next step is to try the app that was mentioned to see if that generates and clicks for me.

So…it all worked as expected so I’m not quite sure why it’s not working for others. The only thoughts I have at the moment are:

  1. I’ve not tried this on a 64-bit OS so I don’t know if it would work or not.
  2. If you’ve not enabled the SPI interface using raspi-config then things wouldn’t work, but I think you mentioned an SPI setting in config.txt?

I have tried RPI 3B and 4, both with 32 and 64 bit Debian Bullseye Lite, fully patched, SPI enabled, following the directions to the letter, but I still get the “connack” error mentioned before.

Sorry, I’ve been distracted by all sorts of things (some voluntary work I do, fixing things for family, family gatherings, etc) so I’ve still not fully rebuilt my development Pi. Are you able to try Debian Buster? That’s the latest version I’ve used, although my next build will be based on Bullseye so if there are problems with that OS I’ll eventually find them.

Hi
Thanks for replying.

For now I have given up with the Mikroe, and now use DFRobot Gravity: Lightning Distance Sensor and using the biffobear_as3935 CircuitPython_AS3935 drivers, I modified my detection software, so it ignores false spikes. Unfortunatly here in Dorking, Surrey, England, w’ve little or know rain or thunder storms, so I have not been able to realy test it.

I am using a raspberry pi 4 with Raspberry Pi OS with desktop, Release date: April 4th 2022 System: 32-bit, and use Adafruit CircuitPython drivers for most of my sensors.

I would be happy to post python script if it would be useful

Michael

Are you able to try Debian Buster?
Arrhhgg, typo from my side, it is Buster I am using :?

Hi

Sory I’m a little confused.

Are you suggesting that I try and set up a Raspberry Pi to with a Buster Image to try the Mikroe?

At the momemt I do not have a spare Raspberry Pi, and would prefere not to upset my two other raspberry pi’s that I’m using one for my Weather Station and the other for SDR.

Michael

Arrhhgg, typo from my side, it is Buster I am using :?

I must have had a stroke or something, I’m using Bullseye, I tried with Buster a few weeks ago, but the script took a long time, with all the updates, and the result was the same, however I will give it another try.

Update:
Installed it with an updated Buster, and now it’s working again: http://m-k-s.dk:7100/as3935/ :smiley:

That’s good to know. Now I can concentrate on figuring out why it’s broken under Bullseye.

Has anyone tried to use DFRobot Gravity: Lightning Distance Sensor and using the biffobear_as3935 CircuitPython_AS3935 drivers?
I posted my python3 script a few months ago.

Also what makes the Mikroe so difficult to use under with Python3?

Things might have changed now, but when I started looking at this the only Mikroe AS3935 library used the i2C interface which was reported as having some problems. I re-worked another library to make it use SPI which is reportedly more reliable. Other than that, once you’ve got the library there aren’t any real problems with Python3 as far as I recall. I don’t know why there are problems with Debian Bullseye though.