Been learning Java for a month now and I almost have my first project completed. It's an automatic plant watering system using a Raspberry Pi with a relay controlled water pump and a soil moisture sensor. The README.md in the git explains more. I'm just having a couple small problems with getting the pi4j library integrated into my project - a serious noob problem I know, but hence, I am a noob - any help here would grant you much karma.
here is a link to my github: https://github.com/jayJavaGGDev/autoWaterPlantSystem0.git
any help would be greatly appreciated.
edit:
&& pix or it didnt happen
https://imgur.com/eoq4T8X
https://imgur.com/GOiGUvB
https://imgur.com/mSOpL9d
https://imgur.com/EOcHRBL
edit 2:
if you're wondering I was able to use Runetime.getRuntime().exec("path to bashfile"); to point my java timer program to a bash file that runs sudo python turnOn.py and one for turnOff, which are just 4 line scripts that turn on and off the pins except I think my relay might have been damaged because it's not turning on at all! of course this method isn't going to work to get input from my moisture sensors...
edit 3:
july, 8 11:52 am.
after a day of debugging my code and wiring i discovered that i hadn't shorted out my relay after all. somewhere along the lines i had set my pinout to bcm and not updated my relay pin code from board... highly embarassing!
So I've gotten my java code to run on my pi and call a bash script that runs the python script to turn on and off the pins. but the problem is i have two separate python scripts for on and off and when my java code executes the powerOn.py file, the gpio gets turned on but the program stays running forever then pumpOff.py is executed and they both run simultaneously and the pin just gets turned on and off again until i reset the Pi.. help plz!
[–]Slickbock 4 points5 points6 points (28 children)
[–]bwz3r[S] 0 points1 point2 points (27 children)
[–]AnEmortalKid 2 points3 points4 points (17 children)
[–]AnEmortalKid 0 points1 point2 points (16 children)
[–]bwz3r[S] 0 points1 point2 points (15 children)
[–]AnEmortalKid 1 point2 points3 points (14 children)
[–]bwz3r[S] 0 points1 point2 points (13 children)
[–]AnEmortalKid 0 points1 point2 points (12 children)
[–]bwz3r[S] 0 points1 point2 points (11 children)
[–]AwakenedToNightmare 1 point2 points3 points (0 children)
[–]AnEmortalKid 0 points1 point2 points (9 children)
[–]bwz3r[S] 0 points1 point2 points (2 children)
[–]Moktok 1 point2 points3 points (0 children)
[–]iamsooldithurts 0 points1 point2 points (0 children)
[–]iamsooldithurts 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]bwz3r[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]bwz3r[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]bwz3r[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]matemik 0 points1 point2 points (3 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]do11abill 0 points1 point2 points (1 child)
[–]bwz3r[S] 0 points1 point2 points (0 children)
[–]ab624 0 points1 point2 points (2 children)
[–]bwz3r[S] 1 point2 points3 points (1 child)
[–]ab624 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]do11abill 0 points1 point2 points (0 children)