PROBLEM when using Pi4J with ScheduledExecutorService

21 views
Skip to first unread message

Dave Kutilek

unread,
Sep 13, 2016, 12:30:42 PM9/13/16
to Pi4J
Hi everyone,

I am using RaspberryPi 3 Model B.   The Pi is running my JAVA program (see MAIN class code attached).   Notification messages are received via Ethernet 24-hours a day from my Leviton smart home controller whenever an event occurs (motion detected, door opened, thermostat turns on/off, lights turn on/off... etc).

The Pi processes each notification message and is connected via internet to one of mySQL databases and writes the relevant data into the appropriate table with timestamp etc.  All this is working fine.

What I am experiencing is that after I added Pi4J code (and 2 LEDs with resistors on GPIO) to flash an LED to provide me a visual indication that everything is running ok.. my program will fail to work properly after some period of time.  

Everything works as expected for a while... but after maybe 10 hours... or up to 20 hours... the LEDs will not pulse anymore... and yet other parts of the program are still running... for example the Keep_Alive method which sends a timestamp to my database once every 10 minutes to prevent a timeout in the middle of the night when event activity is very low... it is still running fine.

I am using the ScheduledExecutorService to keep things running.   When I wrote a simple little test program to test the GPIO LEDs and my use of Pi4J lib... it all worked fine... but then when I similarly added the ScheduledExecutorService to that test program... I had some trouble reliably getting the LEDs to pulse.

Are there issues when using Pi4J with ScheduledExecutorService?

I have had to remove Pi4J and the associated code... but now I have no visual indication via LEDs that things are running.


Any help would be very much appreciated. 

Dave

(SEE attached file for CODE example)



code.txt
Reply all
Reply to author
Forward
0 new messages