Tag Archive: github

View on GitHub

The PowerEventLog application uses an immutable array to keep track of when the JNIOR turns on and off. It takes the values in an immutable array and stores them in a log file called powereventlog.

The application starts by checking if another instance of  itself is already running. If there is one already running, the instance of it trying to launch terminates itself. After checking that, it then gets the time that the application started on the JNIOR. The Immutable block is then returned (or created if it doesn’t exist yet.) to hold/retrieve the values of when the JNIOR last turned off and when it booted up again. The stop and start times of the JNIOR are re-formatted as date strings to be more readable. The log files being created are then checked to see if a backup needs to be created. Lastly, the stop and start times of the JNIOR are written to the log file, and then the times are updated for the next time the JNIOR turns off.

View on GitHub

JBakup is an application that is running on the JNIOR to help extend the life of your log files.  It does this by monitoring the filesystem for the creating of a .log.bak file.  This logic runs just once every 15 minutes.  When a .log.bak file is found that has NOT been previously processed then it is added to the .zip of the same name in the flash/baks directory.

The JAVA application doesnt take care of the zipping of the backup file data but rather creates a script that the OS executes using the ARC command.

The code is small and should be easy to follow.

View on GitHub

This post goes over an application that checks the current devices connected to the JNIOR, and if any of them are temperature probes logs there device index and current temperature. 

Log Temperature starts off by declaring a string builder, which will be used later to log our information. We start with a while loop set to true so our program runs unless exited. We then perform a for loop that iterates 10 times. This checks the indexes of devices connected to the JNIOR from 1 – 10. Each time the loop iterates, it checking the JNIOR’s registry for connected temperature probes using the isTempPresent function. This returns the index of a temperature probe connected to the JNIOR. Once the index is returned its then used to get the temperature of that temperature probe, and then uses the string builder to construct a sentence listing time, index, and temperature from the temperature probe. This is then logged to a log file called tempLog.log. The while loop returns re-logging the values every minute.

View on GitHub

This post goes over an application that goes through the Iolog, grabs IoEvents that occur every second, reports their Input States as a String out the AUX Port. 

It starts by declaring a class object that has functions we can use to report our input states. The program first calls a constructor function to open the serial port to report our inputs. After the AUX port opens, another function is called to return the IO events from the Iolog monitor. This function then calls another function to build a message containing the IO events as string values. Once again this function calls one last function, this one then sending off the string we built to the AUX port to report the IO events.