User Tools

Site Tools


setting_up_the_slave_umds

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
setting_up_the_slave_umds [2016/12/21 17:51] walkeradminsetting_up_the_slave_umds [2023/03/09 22:35] (current) – external edit 127.0.0.1
Line 2: Line 2:
 \\  \\ 
 {{:rpi_umd_001b.jpg?650|}} {{:rpi_umd_001b.jpg?650|}}
-\\  
-\\  
-<color red>This page is work in progress and is incomplete</color> 
 \\  \\ 
 \\  \\ 
Line 34: Line 31:
     sudo nano /etc/dhcpdc.conf     sudo nano /etc/dhcpdc.conf
          
-    Add these lines to the end of the file (default is dhcp) using  your own IP Address details+    Add these lines to the end of the file (default is dhcp) using your own IP Address details
          
     eth0     eth0
Line 232: Line 229:
 \\  \\ 
 To test this, reboot and the LCD should start up automatically (the LCD won't clear on boot, but wait for the "Waiting for 5 Seconds for Network Start" message). To test this, reboot and the LCD should start up automatically (the LCD won't clear on boot, but wait for the "Waiting for 5 Seconds for Network Start" message).
 +\\ 
 +\\ 
 +
 +----
 +===== UMDsiplay0x.py File Differences =====
 +\\ 
 +There are a couple of differences between the Python scripts on the Master and the slaves, here is an overview of those differences.
 +\\ 
 +\\ 
 +==== #import ====
 +\\ 
 +On the #import section there is one difference
 +<file>
 +Master                                  Slave
 +
 +#import                                 #import
 +import RPi.GPIO as GPIO                 import RPi.GPIO as GPIO
 +import time                             import time
 +import socket                           import socket
 +import fcntl                            import fcntl
 +import struct                           import struct
 +                                        import os
 +</file>
 +\\ 
 +On the slave there is an extra library that is imported (the os library). The <color red>os library</color> allows the running of command lines from within Python.
 +\\ 
 +\\ 
 +
 +----
 +==== Program Start ====
 +At the Program Start section of the Python code there is an extra line.
 +\\ 
 +    ## Get text file from master Pi UMD001 (runs the file getData in the Python folder)
 +    os.system("/home/pi/Python/getData")
 +\\ 
 +The <color red>os.system("/home/pi/Python/getData")</color> calls the getData script. This is the script that pulls the latest my_data.txt file from the UMD Master. This command is the one that needs the extra #import library.
 \\  \\ 
 \\  \\ 
  
  
setting_up_the_slave_umds.1482342695.txt.gz · Last modified: 2023/03/09 22:35 (external edit)