User Tools

Site Tools


member-projects:m0jqq_-_bpq_for_beginners

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
member-projects:m0jqq_-_bpq_for_beginners [2024/12/15 12:44] – [Monitoring a Remote Battery Voltage] section added m0jqqmember-projects:m0jqq_-_bpq_for_beginners [2025/08/01 18:33] (current) m0jqq
Line 464: Line 464:
 import serial import serial
 import time import time
-sdata = serial.Serial('/dev/ttyUSB0', 115200, timeout=1.0)+sdata = serial.Serial('/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.1:1.0-port0', 115200, timeout=1.0)
 time.sleep(2) time.sleep(2)
 sdata.reset_input_buffer() sdata.reset_input_buffer()
Line 472: Line 472:
                 time.sleep(0.01)                 time.sleep(0.01)
                 if sdata.in_waiting >0:                 if sdata.in_waiting >0:
-                        file = open("/opt/oarc/bpq/beacon" ,"w")+                        file = open("/tmp/beacon" ,"w")
                         battState = sdata.readline().decode('utf-8').rstrip()                         battState = sdata.readline().decode('utf-8').rstrip()
                         file.write(f"{battState}"+"\n")                         file.write(f"{battState}"+"\n")
Line 496: Line 496:
 Make it executable <code> chmod +x getBattMonitor.sh </code> Make it executable <code> chmod +x getBattMonitor.sh </code>
  
- == Create beacon file == +  
- +Now is the time to test your work. Connect a variable power supply set to less than 5 volts to the batt+ and Gnd connections of your Arduino and measure the voltage between GND & A0 It should be about one third of your variable power supply voltage.
-<code> sudo touch /opt/oarc/bpq/beacon && sudo chown linbpq:linbpq /opt/oarc/bpq/beacon</code>  +
- +
-Now is the time to test your work. Connect a variable power supply set to less tha 5 volts to the batt+ and Gnd connections of your Arduino and measure the voltage between GND & A0 It should be about one third of your variable power supply voltage.+
 Start the script with <code> ~/getBattMonitor.sh </code> After a few seconds you should see something like the following... Start the script with <code> ~/getBattMonitor.sh </code> After a few seconds you should see something like the following...
  
Line 507: Line 504:
  
 a <code> get /opt/oarc/bpq/beacon </code> from a second terminal should match and follow the output at 5 second intervals a <code> get /opt/oarc/bpq/beacon </code> from a second terminal should match and follow the output at 5 second intervals
 +
 +
 +
  
  
  
member-projects/m0jqq_-_bpq_for_beginners.txt · Last modified: by m0jqq