Git Product home page Git Product logo

grow-python's People

Contributors

damacus avatar gadgetoid avatar guru avatar jorjun avatar shane-powell avatar svetlemodry avatar tomjn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grow-python's Issues

Strange auto-watering behaviour

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.

Logging sensor data in time

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.

Display always on

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?

Feature request: turn off display at night

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 :)

Increase frequency of beeps to improve loudness

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.

def __init__(self, image, enabled=True, interval=10.0, beep_frequency=440):

And

self.pwm = GPIO.PWM(gpio_pin, 440)

def beep(self, frequency=440, timeout=0.1, blocking=True, force=False):

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.

Install no longer compatible with Bullseye (or Bookworm!)

With the move to the "new" way of doing things, we've broken compatibility with Bullseye ("Raspberry OS Legacy");

  • the install script now objects to being run as root, but the "one line install" (curl -sSL https://get.pimoroni.com/grow | bash) still attempts to run this via sudo
  • the st7735 library really doesn't seem to like Bullseye at 1.0.0, so needs to be pinned to 0.0.5

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?)

Feature Request: Turn off display to save power

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

Moisture channel 2 (BCM8) conflicts with SPI0 CS0 as of 5.4.51 kernel

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/

Raspberry Pi5

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.

Display can't be used when light is low config is enabled

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

Service not installing on Bullseye

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

Proper MQTT support with example

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.

New Release

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?

Beeping even when mute button pressed

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.