ageir / chirp-rpi Goto Github PK
View Code? Open in Web Editor NEWPython library for the Chirp I2C soil moisture sensor.
License: MIT License
Python library for the Chirp I2C soil moisture sensor.
License: MIT License
Sorry, i'm not sure if this is the right avenue to ask for help... i have purchased a Catnip Soil Moisture Sensor v2.7.6, and i have it wired to a raspi pi I2C bus.... i got your code to work!!! but the moisture values seem to be way off... and once in a while the temperature reading is bad... also you can see that the address reads back as 255, but i did a SET to test and the address is absolutely 20!
i tried to put the sensor in some water, in my hand, on the table, and i can't get the moisture value to change at all.
any help??
Chirp soil moisture sensor.
Firmware version: 0x26
I2C address: 255
Press Ctrl-C to exit.
49279 9615.5% | 4940.7°C | 65535
63503 12404.5% | 29.1°C | 46789
61471 12006.1% | 29.0°C | 46815
63519 12407.6% | 29.0°C | 46602
63503 12404.5% | 28.9°C | 46072
63503 12404.5% | 28.9°C | 46829
63519 12407.6% | 28.9°C | 46865
63503 12404.5% | 28.9°C | 46785
61471 12006.1% | 28.8°C | 46811
63503 12404.5% | 28.8°C | 46862
63503 12404.5% | 28.8°C | 47059
49279 9615.5% | 4940.7°C | 46625
63519 12407.6% | 28.7°C | 46997
63519 12407.6% | 28.7°C | 48832
49279 9615.5% | 4940.7°C | 48707
63519 12407.6% | 28.6°C | 48097
I need help!
When a run the script I obtain the following error:
Traceback (most recent call last):
File "chirp.py", line 21, in
import smbus
ImportError: No module named smbus
I've installed python 2.7.18 and when I want to install smbus library using "sudo apt-get install python-smbus", I obtain the following error:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-smbus is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-smbus' has no installation candidate
Thanks in advance for your help.
To fix it change:
@sensor_address.setter
def sensor_address(self, new_addr):
if isinstance(new_addr, int) and (new_addr >= 3 and new_addr <= 119):
self.bus.write_byte_data(self.address, 1, new_addr)
self.bus.write_byte_data(self.address, 1, new_addr) #<= ADD THIS LINE
self.reset()
self.address = new_addr
else:
raise ValueError('I2C address must be between 3-119 or 0x03-0x77.')
Will this work with Micropython on a Raspberry Pi Pico?
You could read version number as a wakeup call, this way it would be faster, saving the battery.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.