New Approach to Data Transfer

After giving it a great deal of thought and looking into various options, I’ve settled on a method to transfer data from the snow measurement system to the weather system. I am going to simply use SFTP within the python script that processes snow depth measurements to create a file with the measurement data and transfer that file to a known location on the weather system.

The weather system (another Raspberry Pi) will have the responsibility for storing the snow data in it’s database and doing all of the processing needed to develop statistics and graphs.  I will have to modify the database schema to use the new parameter.  I will also have to write a new service that is executed by the weather software every 5 minutes.  This service will go grab the data from the file that was uploaded by the snow depth system, check for errors, and provide a database entry for the measurement data.

One nice thing about this approach is that I can completely test the measurement system without touching the weather system (other than perhaps some file permissions).  Once the measurement system is working as expected I can use some fairly “standard” procedures to modify the database and add the new service.

Come to think of it, I could also work on the weather system side independently just by creating a file with bogus measurement data in an alternate “known location” on the weather system.

Next tasks ares to:

  • Uninstall mysql from the measurement system
  • Install the SFTP client python module pysftp
  • Install and modify the sensor interface code
  • Create a place-holder python script that uploads bogus sensor data to the weather system via sftp
  • Create a cron-job on the measurement system that executes the place-holder script every 5 minutes.

Once all that is done, I’ll have a look at changes to the weather system that need to be made.