Showing posts with label data logging. Show all posts
Showing posts with label data logging. Show all posts

Bug squashed in data logger

Ooops!  I've just spotted a bug in my Raspberry Pi Sense HAT datalogging script.  The 'time' command causes the system to crash.  This is because you can't concatenate a date/time object to a string without first converting it to a string.  

The code should read:

    def do_time(self, args):
        """\n>Displays the current date/time"""
        self.mylog.setTime()
        print("\n>"+str(self.mylog.getTime()))

It is all fixed now.


Raspberry Pi Sense HAT data logger

I have been working on a command line temperature/humidity/pressure data logger for my Raspberry Pi Sense HAT.

You can get the Python code from this folder.

The data logger command line running on the Raspberry Pi 2 showing all available commands.

The script provides the following commands for accessing the Sense HAT sensors:


  • temp (gets the current temperature)
  • pressure (gets the current air pressure)
  • humid (gets the current relative humidity)
  • time (gets the current time/date)


You can also set up a 'log' which will automatically log data from the sensors to a csv file. The duration of the log run and the time interval between measurements can be set through commands.

This log shows the change in temperature and humidity over a few hours.
Running a log.

Label

World Karma Game