loopylee
Posts: 14
Joined: Thu May 26, 2016 7:53 pm

temperature logging.

Thu May 26, 2016 8:13 pm

Hi,

I am a new user and dont have too much idea what im doing.

I have a respberry pi 3 which i have set up running raspbian.

I have also installed a temperv14 usb thermometer which i have working fine.

To get a reading im having to open the treminal and type "sudo temper14"

This gives me a lime of txt with the date, time and temperature.

Is there a way to get this to run every 30 minutes and record the results in a txt file?

Thank you for your time.

Lee

User avatar
Gavinmc42
Posts: 3622
Joined: Wed Aug 28, 2013 3:31 am

Re: temperature logging.

Fri May 27, 2016 2:41 am

Make a shell script file
read the data then echo $data >> /home/pi/data.file
You can date, time stamp it and format as a csv file, like this.

filedate="$( date +"%Y_%m_%d")"
datenow=$(date)
echo $datenow, $temp1, $temp2, $temp3...>> /home/pi/logs/$filedate.csv

Then just call the shell script from cron
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

sachinwable
Posts: 13
Joined: Fri May 13, 2016 9:17 am
Location: Pune
Contact: Website

Re: temperature logging.

Fri May 27, 2016 11:51 am

You can set a cron job to run that every 30 minutes.

PiGraham
Posts: 3576
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: temperature logging.

Fri May 27, 2016 11:56 am

See this similar query
viewtopic.php?f=28&t=149573

Return to “General discussion”