pimoroni / grow-python Goto Github PK
View Code? Open in Web Editor NEWPython libs for controlling the Grow HATs
License: MIT License
Python libs for controlling the Grow HATs
License: MIT License
I'm still seeing some strange behaviour with the watering UI branch of the monitoring app, I have the auto-watering values set to modest levels and for the most part they're working nicely but once every couple of days everything seems to freak out, trigger the buzzer and do a full strength pulse of water that misses the plant pot and lands on my desk!
Random bleeping often happens when we turn the light on in the morning, so perhaps it could be related to what the light sensor is doing? I've also seen the sensor bars flash on and off whilst catching it in the act.
Say so.
Or people's time will be wasted. You can't avoid marketing. Right now Pimoroni is engaging in negative marketing through neglect and omission.
Hi,
I'd like to include a code snippet in examples/monitor.py so as to output the sensor data every X minutes onto an external file. For example, in a CSV format of the form:
timestamp sensor1 sensor2 sensor3
Can I get some recommendations on how this might be done? I can paw my way around Python code, but I'm not sure where is the best place to put such a snippet, nor am I sure how to design the timings.
The display on my growhat mini stays always on, even after shutting down the Raspberry Pi. I need to manually disconnect the power to switch it off. Is this normal?
Hi all
I have a little feature request. It would be great if the light sensor could be used to disable the display at night. That should also increase the lifespan of the display.
Thanks for adding this :)
There's an observation in Pimoroni Forums: Grow kit feedback
The piezo alarm is, in my opinion, very quiet. I will definitely not notice it chirping about dry soil from the other side of our busy kitchen.
I don't have an unboxed grow board to test this with but I suspect you are using a small piezo buzzer which performs at higher frequencyes (2-3 kHz) in terms of loudness but the code currently shows a liberal sprinkling of 440Hz. That's a useful referernce (A4) but may not be a good choice for producing a beep that's audible at a distance even with its square wave harmonics.
grow-python/examples/monitor.py
Line 786 in bc5fec5
And
grow-python/library/grow/__init__.py
Line 14 in bc5fec5
grow-python/library/grow/__init__.py
Line 45 in bc5fec5
Those two could also be a single variable rather than two independent values.
I don't know if there's already use of different perodic beeping to indicate different emergency conditions but frequency could also be a part of this using the frequency to effectively increase volume, i.e. as it gets drier beep at 550, 1100, 2200Hz.
With the move to the "new" way of doing things, we've broken compatibility with Bullseye ("Raspberry OS Legacy");
curl -sSL https://get.pimoroni.com/grow | bash
) still attempts to run this via sudo
At the same time, the venv
stuff doesn't quite work under Bookworm, because the service created by the install has no understanding of venv
; I would give you a patch for that, but I got stuck in a quagmire of things like numpy refusing to play ball and it all felt like a wider job than just Grow (I'm guessing other Pimoroni products take a service-based approach so perhaps the venv
approach needs more looking at?)
Hi there! In the required libraries to run the examples, Pillow
version is requested to be greater than 10. However, the implementation of monitor.py
uses methods that have been removed from version 9.5 onwards.
Hi, I'm not sure if this is possible but currently on the home screen of the Grow Hat mini the Y button is redundant.
Would it be practical to utilize this button to completely deactivate the screen in a toggle fashion when on the home screen?
I'm thinking this would be useful as a power saver for anyone wanting to power their raspberry pi via solar power/battery pack.
Thanks
As of the recently Kernel 5.4.51 it's no longer possible to add_event_detect
on an SPI Chip-Select pin while the SPI interface is enabled.
To replicate use the following code snippet on a 5.4.51 Pi vs the previous kernel:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(8, GPIO.IN)
def test(pin):
pass
GPIO.add_event_detect(8, edge=GPIO.RISING, callback=test)
It attempts to set up edge detection on SPI's default CE0 pin.
Run this without SPI enabled and it will work fine.
Run it with SPI enabled, and it will fail with "RuntimeError: Failed to add edge detection".
This has changed from previous behaviour and is no doubt the fault of changes as of the 5.x Linux kernel (the new mutually exclusive gpiochip instead of sysfs) and is, furthermore, no doubt fully intended behaviour depite the fact it breaks some potential back-compatibility cases including the use of CS0 to read a moisture channel on the Grow board.
Yes in retrospect using a channel "reserved" by the SPI device in this way was probably never a wise thing to do. But what's done is done.
The fix is simple enough. You must re-allocate the offending chip select channel to a different pin. There's a dtoverlay for this:
dtoverlay=spi0-cs,cs0_pin=14 # Re-assign CS0 from BCM 8 so that Grow can use it
This allocates CS0 to BCM14 (UART transmit) (currently unused by Grow) so that the above code will work in both cases.
This line should be added to the Grow installer to be placed in /boot/config.txt
and we should consider moving that pin in a future revision (groan).
We should also communicate the addition of this line to end-uers, since it has the very real possibility of making SPI devices appear not to work if they're in the habit of swapping between HATs. (double groan)
I have raised a counterpart issue against RPi.GPIO to notify others who might have fallen into this trap: https://sourceforge.net/p/raspberry-gpio-python/tickets/184/
Please could you add a menu option to add this to the config file so that it's possible to set up/adjust auto-watering from the HAT?
So, I know it's not going to work, but is there any development toward getting it working on the Pi5 (yes absolute overkill) and PiOS Bookworm, I can see some talk but not sure which branch you are using for it.
Personally, I'll be creating a venv in /opt as I have another python daemon/service working from there under venv's, so just git pulling to do it, creating a venv, hopefully just using requirements for all the pip modules to come down and then that keeps it well away from my other python stuff. (the point of venv's and the main reason for the change by Debian/Python)
import RPi.GPIO as GPIO obviously the biggest killer.
So lgpio/gpiozero ?
/opt may well go to Home, depending on which is easier.
There's a config option black_screen_when_light_low
that lets you turn the display off in low light.
However, my finger casts a shadow when pressing the buttons, fooling the sensor into thinking it's night time and disabling the buttons.
A timer or counter of some kind that disables the functionality and keeps the backlight/display on when you press a button for 10s regardless of how low the light might be a useful
I tried to install grow-python on a new install of Raspbian Bullseye and it doesn't install the service.
install.sh seems to have the relevant code
install-bullseye.sh doesn't
It would be wonderful if you could include an MQTT example. Similar to the EnviroPlus.
https://github.com/pimoroni/enviroplus-python/blob/master/examples/mqtt-all.py
I have tried using the script from https://github.com/jeroenboumans/PimoroniGrowKit-MQTT
but unfortunately it always shows me 100% for saturation.
An official example would help a lot.
It's time for a new version, I'd suggest bumping the version by more than 0.0.1, perhaps a v0.1 or v0.2 release?
What tasks are needed for it to happen?
When clicking on the GPIO pinout link in README.md it leads to a 404 error
GPIO Pinout - https://pinout.xyz/pinout/grow_hat_mini
When I press the mute button on the HAT to stop the beeping, it often starts beeping again a few seconds later. Sometimes, I have to press the mute button three times to make it stop beeping, and often it'll start again after an undetermined amount of time. Is this a 'feature' or a bug?
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.