Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


serial_data_logger

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
serial_data_logger [2014/07/07 11:28] – [rsync / init script] adminserial_data_logger [2014/07/07 11:30] admin
Line 1: Line 1:
 {{tag>[serial hardware linux]}} {{tag>[serial hardware linux]}}
-=====Serial data logger=====+=====Smart Meter - P1 data logger=====
 This script will log serial data and prepend time/date stamp. The example below if P1 data from a smart meter. You can pipe this to [[rotatelogs]] to save the output to rotated logs. This script will log serial data and prepend time/date stamp. The example below if P1 data from a smart meter. You can pipe this to [[rotatelogs]] to save the output to rotated logs.
 <code># /usr/local/bin/serialWatch.exp ttyUSB0 <code># /usr/local/bin/serialWatch.exp ttyUSB0
Line 79: Line 79:
   }   }
 }</code> }</code>
 +  * Start logging after boot. Add to **/etc/rc.local**: <code>echo "nohup /usr/local/bin/serialWatch.exp ttyUSB0 | rotatelogs -f /mnt/ram/p1data 86400 100M &" | at now+1min</code>
 +
 =====rsync / init script===== =====rsync / init script=====
 You can use the following script to sync the RAM disk to NAS. It wil also sync before shutdown. This has been tested on Raspbian (Raspberry PI) Debian. You can use the following script to sync the RAM disk to NAS. It wil also sync before shutdown. This has been tested on Raspbian (Raspberry PI) Debian.
Line 155: Line 157:
 update-rc.d rsync-p1-data enable</code> update-rc.d rsync-p1-data enable</code>
   * Enable automatic sync every hour. Add to crontab: <code>1 * * * * /etc/init.d/rsync-p1-data sync</code>   * Enable automatic sync every hour. Add to crontab: <code>1 * * * * /etc/init.d/rsync-p1-data sync</code>
 +
serial_data_logger.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1