Raspberry Pi Wifi enabled 4-way power box

8K
I just thought of something, What powers the Pi itself? Is it the plug that fits into the microUSB? if so, then you would need two plugs to power the system, one for the Pi and one for the “Controlled” plugs, correct?

If you are responding to my question - thats exactly what I DONT want. :slight_smile:

If this is going to work for me, I need the system to power up, and automatically run two different timing sequences from the very beginning.

I do NOT want it to pick up where it left off. Both timing cycles must start over, from the beginning, every time the Pi powers up. Plus it needs to be on an auto-run basis. The timing sequences must start all by themselves as soon as the Pi powers up.

@anon32470837 - You could potentially create a startup script that resets the system time to April 20th, 1969, 4:20pm (or whatever time you decide) and then setup the nodered software triggers accordingly. It would therefore start from “zero” every time it booted.

It would be a matter of creating a simple bash script utilizing the unix/linux “date” command https://www.computerhope.com/unix/udate.htm

And then that script would be placed somewhere that it’ll be triggered at boot. Somewhere in the init scripts (often in /etc/init.d/), I am assuming - but I actually don’t have specific knowledge of Raspian boot/init processes/structure.

Gotta be doable, though.

3 Likes

If the power goes off, the Pi will go off. When the power comes back on, the Pi will restart and NodeRed will also restart. If you have a timer, for feeding, let’s say, that feeds for 10 minutes every hour (starts at 8:00 AM and ends at 8:10 AM, starts at 9:00 am and ends at 9:10 AM, etc), the power goes off at 11:40 AM and comes back on at 1:15 PM, the timer will restart at 2:00 PM and stop at 2:10 PM.

It is my understanding that the timer within NodeRed can be programed with either start time/end time, or immediate start and duration (on for 12 hours/off for 12 hours) have just started looking at it. Do you know much java scripting? It appears that it can be configured through a settings file (settings.js). I would take a look at the users guide, especially the “Configurating Node Red” section.

https://nodered.org/docs/user-guide/

Just started getting back into programming (did a fair amount of C/C+ many moons ago) but it seems fairly straight forward

I reread what you had posted and I was confused (which wouldn’t be the first time, by any means) I wanted to see if I understand. First off, the Pi never “shuts off” the timer will, but not the Pi. That would be like turning on your phone to check for calls, turning it off, then turning it back on 15 minutes later to check again. Second, it sounds like you want to start the Pi from your compressor, to start your pump, to start your compressor. I was really confused. but like I said before, not uncommon.

There are “Hats” for the PI that will sense all kinds of things like humidity, temperature and pressure. I would look into something like that, that may be able to be incorporated into NodeRed so that the pressure reads low, starts the pump, and then starts the compressor either at a certain fluid level, pressure or time. That is one of the nice things about Linux and open source, if you have a problem, someone has probably written something to fix it, because they had the same or similar problem.

2 Likes

Pretty sure he wants the Pi to be off by default. When certain conditions are met (pressure in his tank?) the Pi will be powered up and trigger some specifically-timed, sequential events. Then, when certain conditions are met, the Pi is powered off again. A very unconventional use of a Pi and nodered. Perhaps this is the source of your confusion?

Or, I am totally misunderstanding @anon32470837 as well?

1 Like

But then you would need a timer, to turn on the timer. There are probably better ways to do it. I would say to look at what some of the folks have done with HPA. Something there might be better adapted.

1 Like

I’m pretty sure he planned on using a physical trigger to turn on the Pi, based on some other environmetal factor (tank pressure?), not a timer.

1 Like

Yes, exactly. My situation is not normal.

Thanks to all of you for the help. Im going to try a different, simpler approach to doing what I want.

I may still build one of these to replace all my Sonoff switches, but that will have to wait a bit.

Like I said before, look at some of the posts dealing with Aeroponics, specifically High Pressure (HPA). There you will use pressure to start a pump to make sure tank is full, but a timer and relay to turn on sprayers. Combination of mechanical and electronic.

1 Like

hehehehehe you mean like this long thread on HPA that I started last year :wink:

Its my HPA system Im wanting to add this particular mod to. :smiley:

I would ask the question exactly as you asked it here. I don’t remember anything posted that was close to what you wanted, but if you ask it there, someone who follows that thread may give you something.

I know what you mean though. I tried to do the same thing with one of @Sebring threads, I think, it was around 900 replies at the time. I gave up after the first 4 or 5 hundred and just asked a question.

Yep! OG is a very friendly community, so it’s best to ask the question, even if it’s been asked before. Repeat questions means there is a common problem and repeating the answer will help others find the right answer easier. :wink:

2 Likes

LOL!!! Sorry, this misunderstanding is probably my fault, but it is kind of funny. :smiley:

The point you are missing is that the main person to ask in that thread is me. I started that thread. It my personal HPA grow thread, so I am pretty sure I already know exactly what I would tell myself when I ask the question :wink:

But, as it happens, I DID ask this same question in my thread and I got some answers that did help, so thanks for the suggestion, and special thanks again to @MicroDoser :smiley:

Im laughing party because it occurs to me that it is much better to be told to ‘go ask yourself’ than it is to be told to ‘go F#$@ yourself’ :smiley: :smiley:

Yup. Gotta love OG Its my favorite forum by far :slight_smile:

Seriously - thanks for the help guys!! This is not the best option for my HPA problem, but I will be doing this - or maybe an arduino option - to replace my Sonoffs and get me and my data out of china and off the cloud.

4 Likes

Just picked up a raspberry pi 4 with a gift card I got from the in laws. Going to give this a run with no coding experience. What can go wrong here?

4 Likes

You don’t need to code anything, just follow directions to load up the operating system on an SD card and then install node-red. From there, it’s mostly dragging and dropping widgets from the web interface and doing configuration.

3 Likes

Thanks lefty, will be diving into this shortly

1 Like

Nice info.

My only question, with UPS/battery backups being readily available these days at a fairly decent price, why not provide UPS support to specific growing devices to prevent catastrophic failure of a grow?

1 Like

Any suggestions on a humidity sensor? End game to run keep a small ‘greenhouse’ at high humidity

2 Likes

I’ve seen some pretty cool videos using the DHT11. People adding temperature/humidity dials. You can find some videos on YouTube that show how to set it up.

3 Likes

@lefthandseeds, while playing around on the dubya dubya, found this little project for you when bored with nothing to do using Arduino