Sending the Sensor Outputs to a Server

Install FTP Remote Access

FTP (File Transfer Protocol) is needed to copy the temperature sensor information to a web server.  

The variant of FTP to be used is LFTP.  To install this on the Pi enter the following command:

[email protected] ~ $ sudo apt-get install lftp

We will use the FTP client to upload the graphs to a server.

Create an upload script to run to upload all the files to the web server.

[email protected] ~ $ sudo nano

Copy the script below into the newly created file.

sleep 30
put RBP_temp_log_h.png
put RBP_temp_log_d.png
put RBP_temp_log_w.png
put RBP_temp_log_m.png
put RBP_temp_log_y.png
#put RBP_humidity_log_h.png
#put RBP_humidity_log_d.png
#put RBP_humidity_log_w.png
#put RBP_humidity_log_m.png
#put RBP_humidity_log_y.png
quit 0

Now make the file executable.

[email protected] ~ $ sudo chmod +x

To add a scheduled job to upload the graphs regularly we need to set-up another cron job.  Start crontab by running the following command:

[email protected]:/RaspBeePi_Monitor $ sudo crontab -e

Now add the following line to the file, save and close the file:

# m h dom mon dow command
*/5 * * * * /RaspBeePi_Monitor/ >> /RaspBeePi_Monitor/RaspBeePi_cron.log 2>&1

This command runs the script every five minutes. "&> /dev/null" takes the output from this command and discards it.