BenSDuggan / ETag-Revisions

Changes to the ETag code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ETag code revisions

ETag and code originally developed by Eli Bridge and Jay Wilhelm. Revisions by Ben Duggan. You can email with questions at bendugga@iu.edu. BSD_ETag_Revisions is the folder with the most up to date code. The other folders are ones that I use to test new code or hold original versions I work on.

Status: BSD_ETag_Revisions working

List of changes:

  • battery logging: To help determin the time that the board dies, every time the main loop is executed a log is saved that says "BOARD STILL ON". This only works when the main loop is being executed. This means that the log won't save when the board is sleeping.
  • specialty-code: This is a folder that contains special versions of BSD_ETag_Revisions. Look further in the readme to see a description of the contents.
  • Sleep function: To save battery life the board can go to sleep. In the constants and logging parameters section slpH and slpM are hour and minute (seconds are not supported) to put the board to sleep, respectively. wakH, wakM and wakS are the hour, minute and second to wake up, respectively. Both of these are in 24-hour format. Some notes on this feature:
    • The sleep function works for almost any time. To be clear, the sleep function won't work if the main loop() takes longer than 1 minute. So as a rule of thumb, (pollTime1 + pollTime2 + readInterval + pauseTime) <= 55 seconds. Additionally, the sleep time and wake time should differ by more than 3 minutes. This feature only works for sleeping at night and waking up in the morning. By this I mean that the following must hold: 0 <= wakH:wakM:wakS <= slpH:slpM:slpS <= 23:59:59
    • When the board goes to sleep the communication through the USB is terminated. So, if the board is scheduled to sleep and you try to upload code it won't work. To fix this the board will terminate scanning and write to the log file when the board is scheduled to sleep, but the board won't go into its deep sleep for 2 minutes after a sleep is scheduled.
    • I didn't write the actual sleep function. I am using the RTCZero library.
  • Reader ID: In the constants and logging parameters section you can set readerID which is prepended to the data and log file. This is similar to file name scheme of the Gen. 2 boards. The string can contain alphanumeric characters.
  • Log file: There is a log file added to the board. This is like the one from the Gen. 2. The file saves when logging is started and stopped.
  • Create data and log file at initial startup: The data and log files are created immediately when the board is turned on, even if nothing is in them.
  • Change file name to readerID + data/log: The file name scheme changed from just one that says datalog.txt to (readerID + "data.txt") for the data file and (readerID + "log.txt") for the log file.

specialty-code:

  • USB_Batterypack_Sleep: This code is designed to work with USB battery packs that turn off power with the normal sleep method. This version adds pollTimeSleep and pauseTimeSleep variables. When the board is sleeping it turns the antenna on for pollTimeSleep ms and then off for pauseTimeSleep ms. You will need to calibrate this with your battery pack. For best results pollTimeSleep should be minimized wile pauseTimeSleep should be maximized. There is a risk that the board will not wake up again.

About

Changes to the ETag code


Languages

Language:C++ 100.0%