DIY Automatic hydro Grow

rolln1up

Well-Known Member
there is a built-in shell command called "sleep" that should do the trick (time is in seconds by default)...

so something like this...
( sleep 900; sh command_to_turn_on_lights >& errors) &
I need to run the script as root on boot to allow it to access the parallel port any suggestions?
 

Maccabee

Well-Known Member
Run it out of init. Any process started by init.d will be owned by root.


Or use sudo.


I'm not sure I get what you're asking?
 

rolln1up

Well-Known Member
Run it out of init. Any process started by init.d will be owned by root.


Or use sudo.


I'm not sure I get what you're asking?
Thanks maccabee i'm going to try the init. thing to fix it. The problem is the script needs to auto run when the computer starts under a user account. The script must be ran as root and if I add the sudo command to the script it needs a password which kinda makes auto starting a program useless if I still have enter password
 

Maccabee

Well-Known Member
You can add a line to your sudoers file to permit a user to run a specified executable as root from sudo w/o having to supply a password. Sudo can then be called from a script w/o execution stopping to wait for a password. See the man page for sudo, I don't recall the configuration syntax off-hand.

But I would still use init to run it out of the at queue. Init is the intended facility for performing actions on startup, and similarly the at command is the intended facility for delayed execution. You could hack up something else, but why go through all that if your environment will permit the most straightforward solution?
 

rolln1up

Well-Known Member
I tried placing it in the init.d file changing my sudo file to allow me run it without a password but non of them work so heres what I came up with. Here is my script I simply added it the start up programs and viola done.

#!/bash/bin
#My java start up script
echo "password" | sudo - S /usr/local/bin/parashell 0x378 0 #clears parallel port to all 0
sleep 900 # 15 minute delay to allow bulb to cool down in the event of power outage
ech "password" | sudo -S java jauto.jar &

This script requires you have parashell installed to clear parallel port if for some reason like me you have one pin want to go high on boot of the OS. Change password with the password of your user account and everything should be fine.

Okay now that I have the computer setup and ready I plan to get everything switched over to the computer control tomorrow and get some pics up here of the setup.
 

Maccabee

Well-Known Member
Cool! Yeah, out of force of habit I would never tell someone to hardcode a sudo password into a script like that but it will definitely work!

What happened when you tried to run it out of init? Did you check atq to see if the job was accepted? If not, did you try manually invoking both scripts to see if/how they error out?

Not that it matters, this will work fine! :)

Looking forward to more pics!

Also, I'm thinking that once you get further along we should think about trying to bridge jAuto and Cannagrower--and maybe some kind of data collection tool as well. (cannagrower is an older program intended to log a grow and produce graphs of logged data etc.) They're both GPL'd afaik. Then you could really sit back and wait for the grow to tell you what it needs--watch the pH and nute charts for drift, etc.
 

Maccabee

Well-Known Member
... Here is my script I simply added it the start up programs and viola done.
...
Just curious, cause now I'm a little confused....when you mean 'startup items' did you add it to the System V bootscripts, or to the startup items in Ubuntu's GUI (GNOME)?

Because I'm not so sure that the GNOME startup items will execute before the user logs in, which is a problem for your specified power surge / unattended restart failure mode. Maybe Ubuntu can be made to auto-login, I'd imagine the functionality is there for kiosk type applications.

EDIT: Yep.

system>admin>login window

Maybe you've already done this. ;)
 

rolln1up

Well-Known Member
Yah I have it set to auto log in. I used the GUI in ubuntu System>Prefences>Session to add the script to start up programs.
The way I added the script to init.d is by placing it in /etc/init.d
$chmod +x my_script #Also ran chmod 755 later
$update-rc.d my_script defualts

I invoked the script manually and it worked fine but on restarts it doesn't launch the app?

I know its against my best judgment hardcode the password in there, but I was spending so much time trying to get around doing that I could have been working on other systems but oh well.
I also tried visudo to edit my sudo file and add an exception for that script to run without a password but with no success.
 

LoudBlunts

Well-Known Member
its actually way better....

its like this: Growtronix, Greenhouse Controller and Grow Room Computer Automation System

shit a setup like this...depending on how big you wanna go....how many res' you have...man they would charge you like probably at least 1500 and working ya way up!!!!

if ya build you can do it for under 500 with everything and even have left overs if you wanted to expanded....

that is why i love this thread


+rep for my fellow IT folks!!!!!!!!
 

rolln1up

Well-Known Member
its actually way better....

its like this: Growtronix, Greenhouse Controller and Grow Room Computer Automation System

shit a setup like this...depending on how big you wanna go....how many res' you have...man they would charge you like probably at least 1500 and working ya way up!!!!

if ya build you can do it for under 500 with everything and even have left overs if you wanted to expanded....

that is why i love this thread


+rep for my fellow IT folks!!!!!!!!
Thanks loudblunt I had never seen that Growtronix system before and to be honest there is no way I would pay that for such a crapy system. It didn't say anything about being able to control it remotly and the price.....damn for that much money I would just buy my weed. Then again the abilty to be able to recieve a cell phone text message if something goes wrong or just with updates might not be so bad. Thanks for the rep/backing as well.
 

moon47usaco

Well-Known Member
Yes I'll begin working on an input system now I plan to regulate tempiture, ph , ppm, nutes, res changes and all aspects of the growing process
Very cool stuff here... I look foreword to seeing the input/injection systems once they are in place... =]
 

greenkong

Active Member
I read on the first page about wanting to make a live feed. you could use a web cam and have it take pictures after a certain amount of time then get it to upload it somewhere annoyomusly
 

rolln1up

Well-Known Member
I read on the first page about wanting to make a live feed. you could use a web cam and have it take pictures after a certain amount of time then get it to upload it somewhere annoyomusly
yah but its the uploading annoyomusly that the tricky part if anyone knows how it can be done I would deffiantly set it up
 
Top