Comments (24)
I can help if you are willing to do a bit of the work ;-) The two interfaces from a python code perspective should be pretty similar.
At first blush the worklist appears to be:
- locate SPI python code that we can pattern after (do you have any, or know of, working examples?)
- adapt the current code to select between SPI/i2c with new config.ini setting
- add the SPI code and runtime switch between
- test the new SPI support (code and setup docs) against a sensor board... to prove it all working
- adjust the setup part of the README to describe what's needed to enable SPI (or i2C) depending on which the user wants.
- release the new version to the repo.
I'm in the midst of a number of small projects (pretty much my life all the time ;-) but I can put some time into this if you will too.
Thoughts?
from lightning-detector-mqtt2ha-daemon.
from lightning-detector-mqtt2ha-daemon.
Nice, I'll lead off while you are wiring up by adding the config option in the code to select between SPI/I2C... I'll send a .zip to you... you can contact me at [email protected] by email and I'll send it by return email...
Oh, hey alternatively, how about you just work with the content I push to the 'feature_add_spi_support' branch. Then i don't have to email anything... just thinking out loud here ;-)
Let me know if you are not comfortable playing in the source and then I can do the adaptation of SPI once you have working examples...
from lightning-detector-mqtt2ha-daemon.
Any progress with this?
from lightning-detector-mqtt2ha-daemon.
from lightning-detector-mqtt2ha-daemon.
I was planning to attempt this by moving HA from the Hassio minimalist OS to full Raspbian running Hassio Supervised in Docker, however my RPi 3B seems to be running out of memory with HA and everything going when it's installed on Raspbian. Memory usage upwards of 800MB then locks up. Can't figure out how to install Python3 on the Hassio OS version yet.
from lightning-detector-mqtt2ha-daemon.
from lightning-detector-mqtt2ha-daemon.
I've moved HA onto my DS920+ and am gonna setup the RPi 3B to try to figure out the SPI interface of this detector. Goal will be to have the RPi 3B interface over SPI with the detector board, and the RPi will connect to HA's MQTT broker that's running on my DS920+, that way HA and all its addons get to benefit from 20GB of RAM and won't be running out of memory like it was on the RPi 3B.
from lightning-detector-mqtt2ha-daemon.
I took a bunch of code from the RaspberryPi-AS3935 library to test out the code.
I tried out this library too, but it would not connect, with the lightning.connected variable always reporting as false
even when using a very simplified code. I ended up using the steps at SparkFun to set the board to I2C. So far the strikes nearby that I can hear myself correspond to to an increase on the Lovelace Card.
from lightning-detector-mqtt2ha-daemon.
from lightning-detector-mqtt2ha-daemon.
I ended up using the steps at SparkFun to set the board to I2C. So far the strikes nearby that I can hear myself correspond to to an increase on the Lovelace Card.
I am having the same issues, but I could not solve them yet. Here I described what I tried:
https://community.home-assistant.io/t/lovelace-lightning-detector-card-for-as3935/214167/6?u=fugazzy
Can you give me a hint?
from lightning-detector-mqtt2ha-daemon.
FYI- the new SPI addition just started working today. I'm finishing the addition an antenna tune portion next.
Feel free to run the code from the /develop branch while you wait for the next release!
from lightning-detector-mqtt2ha-daemon.
from lightning-detector-mqtt2ha-daemon.
Tomorrow, I'll reconfigure my sensor to use SPI like the manufacturer suggests and see how well the develop branch works. Well, suppose I'll wait around until the next storm to actually make sure that it's working, but it is summer here in the Southeast US, so the next storm should be within a few days.
from lightning-detector-mqtt2ha-daemon.
@lightmaster good, I'll look forward to hearing of your results.
from lightning-detector-mqtt2ha-daemon.
@terrycarlin take a look at this: https://github.com/ironsheep/lightning-detector-MQTT2HA-Daemon/blob/develop/THEOPS-SPI.md
Please let me know what you think...
from lightning-detector-mqtt2ha-daemon.
When disabling I2C on the Sparkfun AS3935, after you cut CS
and reconnect SI
, does it matter whether or not you also cut the I2C PU
?
from lightning-detector-mqtt2ha-daemon.
Only cut/short the trace(s)/pad(s) indicated by sparkfun in their docs.
I would do the least amount of work to get SPI to work. If you want to go back to I2C you'll have less to undo.
Which version of their board do you have? Once I know I can then give a more precise answer if needed...
from lightning-detector-mqtt2ha-daemon.
The same version depicted at the Sparkfun guide v20. I followed their directions to enable I2C originally, so I cut the trace SI
and connected CS
, then connected the middle and right pads on the I2C PU
.
from lightning-detector-mqtt2ha-daemon.
OK, reviewing your version (I have the Qwiic version - older model)
You do have to reverse the "Select Interface" shorts/opens.
The "I2C Pull Up Resistors" should be fine without reversing them.
As a note: my board uses 2.2K resistors which are connected all the time where yours' are open but you've shorted the middle and right pads. This will likely work without further change. If they weren't shorted before you awakened I2C then you should also be safe by removing the shorts.
But please let me know.
from lightning-detector-mqtt2ha-daemon.
Its now setup to use SPI using the develop branch. After starting PiGPIOd before manually running the script, I didn't get any errors. I set the service to log to syslog so I can see any errors that might popup and its now running as a service, waiting for a storm to roll by.
from lightning-detector-mqtt2ha-daemon.
from lightning-detector-mqtt2ha-daemon.
Your pull request is merged and this SPI support is now released and avail in v2.2.0 and later.
from lightning-detector-mqtt2ha-daemon.
from lightning-detector-mqtt2ha-daemon.
Related Issues (20)
- Not sure if --calc_tuning_cap is working right HOT 19
- i2c broken? HOT 2
- I2C Write Error HOT 10
- [Improvement] Hardlink to system tools HOT 2
- Provide an MQTT subscription triggered version HOT 5
- Spi bus tuning_cap Error HOT 2
- Sensor settings doesn't reflect what is configured in the config.ini HOT 3
- Question on noise level HOT 5
- Let's make sure our sensor re-appears after HA restart HOT 2
- Stupid Question from A New HA User HOT 8
- Problems with reading config.ini file HOT 1
- Home Assistant YAML configuration for sensors
- Tuning Frequency is Far Off HOT 2
- Docker-Image available?
- Add logic to post our storm as ended status HOT 2
- Bin needs to close after time ends for period (is currently closing at first detection after period end) HOT 2
- Ensure sensor reports distances in correct units HOT 2
- Adjust script so it can run as systemd daemon HOT 2
- MQTT lightningdetector/detect not updating count and distance HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightning-detector-mqtt2ha-daemon.