Data Logger using Raspberry Pi Scott Cairns 1817523



Download 200.65 Kb.
Page11/12
Date31.07.2017
Size200.65 Kb.
#25490
1   ...   4   5   6   7   8   9   10   11   12

Appendix D User guide


This appendix contains the User guide which shows the end user how to run the program as well as carry out various tasks that the software will be used to do.
Auto login:
This will allow the Raspberry Pi to automatically log in using the root account without prompting for a username and password during every start up, this only works locally within the Pi, connecting via SSH will still require the user to enter a username and password.


  1. Log in using any account.



  1. Enter ‘sudo nano /etc/inittab’.



  1. Scroll down until ‘1:2345:respawn:/sbin/getty –noclear 38400 tty1’ is visible.



  1. After /sbin/getty type ‘—autologin root’.



  1. It should now read ‘1:2345:respawn:/sbin/getty –autologin root –noclear 38400 tty1’.



  1. Press Ctrl + X, a message should appear ‘Save modified buffer’.



  1. Type ‘Y’, another message will show ‘file name to write’.



  1. Press enter.



  1. Restart the Raspberry Pi and it should automatically log in using ‘root’.

Setting script to auto run:
This will allow the Python script to automatically run when the user log into a user (if not using auto login) allowing the program to run with no visual display.


  1. Log in using any account.




  1. Enter ‘sudo nano /etc/profile’.




  1. Scroll down to the bottom of the page.




  1. At the end enter ‘python /home/pi/Desktop/logger.py’.




  1. Press Ctrl + X, a message should appear ‘Save modified buffer’.




  1. Type ‘Y’, another message will show ‘file name to write’.




  1. Press enter.




  1. Restart the Raspberry Pi and the script should automatically start after logging in (if not using the auto login).


Running the script:
NOTE: When running the python script try to make sure it is only loaded once (either remotely or locally), if the user load it via SSH and again from the Pi directly it could cause issues and unexpected commands.
Using graphical session:
To use the program on the graphical desktop a small number of extra steps will be required to ensure the file can be executed


  1. Log in using root user (‘root’)

    1. If the root password has not been set log into the default user (default user: pi default password: raspberry).

    2. Enter ‘sudo passwd’ in terminal the user should receive a prompt asking for the new password then confirmation.

screenshot1921

Terminal view for changing root password


  1. Run the graphical desktop using command ‘startx’.



  1. Open the file manager (Menu > Accessories > File manager).



  1. Locate /home/pi/Desktop.



  1. Right click on the ‘logger.py’ file and go to Properties.



  1. Under the Permissions tab tick the ‘Make the file executable’ box and click Ok.



  1. Double click the logger.py file and execute in terminal.



  1. The python script should now have loaded.

Using terminal:


  1. Log in using root user (‘root’)

    1. If the root password has not been set, log into the default user (user: pi password: raspberry).

    2. Enter ‘sudo passwd’ in terminal the user should receive a prompt asking for the new password then confirmation.

screenshot1921

Terminal view for changing root password


  1. Run the command “cd /home/pi/Desktop”



  1. Run “python logger.py”.



  1. The python script should now have loaded within the terminal.

screenshot1922

Terminal view when running program
Streaming webcam footage over the network:


  1. Locate the middle button (indicated by S2) on the Gertboard and press it (or press 2 on a keyboard if remotely connected).



  1. A message in the terminal should state that the Recording method has changed to ‘stream’.

screenshot1923

Terminal view showing stream


  1. Locate the left button (indicated by S3) on the Gertboard and press it (or press 1 on a keyboard if remotely connected).



  1. A warning will appear followed by sensor information (temperature and optical).

screenshot1927

Terminal view when beginning logging


  1. The red LED will disable and the green LED will now be showing.



  1. Open a media player such as VLC and load the stream http://ip-address-of-pi:8001/webcam.mjpeg



  1. The sensor information is sent to COSM and can be viewed on;

    1. https://cosm.com/users/scottrpi# - Overview

    2. https://cosm.com/feeds/117510 - Optical

    3. https://cosm.com/feeds/117505 - Temperature



  1. Within the ‘logger’ folder (home/pi/Desktop/logger) a file will be created/updated named ‘light.txt’ and ‘temperatures.txt’ which contain information from the sensors.



  1. Press the left button again (or press 1 on keyboard) to end the sensor data logging.



  1. The green LED will disable and the red LED will again be showing.



  1. (If remotely connected) press Q to end the webcam stream.

Storing webcam footage on the SD card:


  1. The default method when the script is loaded sets it to store data to the SD card (if it has been changed press 2 or middle button/S2).

screenshot1925

Terminal view showing store


  1. Locate the left button (indicated by S3) on the Gertboard and press it (or press 1 on a keyboard if remotely connected).



  1. A warning will appear followed by sensor information (temperature and optical).

screenshot1926

Terminal view when beginning logging


  1. The red LED will disable and the green LED will now be showing.



  1. Again the sensor information is sent to COSM and can be viewed on;

    1. https://cosm.com/users/scottrpi# - Overview

    2. https://cosm.com/feeds/117510 - Optical

    3. https://cosm.com/feeds/117505 - Temperature



  1. Within the ‘logger’ folder (home/pi/Desktop/logger) a file will be created/updated named ‘light.txt’ and ‘temperatures.txt’ which will contain information from the sensors as well as a ‘webcam-XXXX-XX-XX~XX:XX:XX.mpeg’ file containing the webcam footage and the timestamp from when it was taken (in the filename).

screenshot1929

List of contents within logger folder


  1. Press the left button again (or press 1 on keyboard) to end the sensor data logging.



  1. The green LED will disable and the red LED will again be showing.



  1. (If remotely connected) press Q to end the webcam storing.

Taking a single webcam image:


  1. Locate the right button (indicated by S1) on the Gertboard and press it (or press 3 on a keyboard if remotely connected).



  1. The yellow LED will flash on for a second and off again.



  1. A message in terminal should state ‘Writing JPEG image to …’.

screenshot1930

Terminal view taking single image


  1. Within the ‘logger’ folder (home/pi/Desktop/logger) a file will be created named ‘image-XXXX-XX-XX~XX:XX:XX.jpg’ which will contain the single image and the timestamp from when it was taken (in the filename).

Directory: ~aka

Download 200.65 Kb.

Share with your friends:
1   ...   4   5   6   7   8   9   10   11   12




The database is protected by copyright ©ininet.org 2024
send message

    Main page