Close

Updated shell script

A project log for Web based solar panel monitoring/managment

Arduino enable web server to monitor a small solar array and power management systems.

garyGary 05/30/2014 at 00:560 Comments

I split out the date/time to make for easier import to a spread sheet. This script queries the arduino every 5 minutes and collects current data. Runs out of cron.

#!/bin/bash

DAY=`date +%D`

TIME=` date +%T`

date=`date`

CMD=`curl -s 192.168.1.177 | grep Panel`

source=`echo $CMD | awk '{print $1}'`

volts=`echo $CMD | awk '{print $2}'`

amps=`echo $CMD | awk '{print $3}'`

watts=`echo $CMD | awk '{print $4}'`

echo "$DAY,$TIME,$source,$volts,$amps,$watts"

Discussions