Loading ...
Sorry, an error occurred while loading the content.

Re: [Raspberry_Pi_4-Ham_RADIO] Printing to LCD display

Expand Messages
  • Dave Cochran
    Switch it up a little to continue if Headers.log is rotated, else your script will crash... tail -F /var/log/Headers.log .................... ... -- Dave
    Message 1 of 7 , Mar 24, 2013
    • 0 Attachment
      Switch it up a little to continue if Headers.log is rotated, else your script will crash...

      tail -F /var/log/Headers.log ....................

      On Sun, Mar 24, 2013 at 5:03 PM, John D. Hays <john@...> wrote:

      tail -f /var/log/Headers.log | sed 's/.*My: \(.*\) Your.*/\1/' >> /dev/ttyXX  

      (All headers MY field, including /xxxx")

      tail -f /var/log/Headers.log | sed 's/.* DPlus.*My: \(.*\) Your.*/\1/' >> /dev/ttyXX  

      (For only DPlus headers)

      tail -f /var/log/Headers.log | sed 's/.*My: \(.*\)\/.*/\1/' >> /dev/ttyXX  

      (If you don't want the /xxxx)

      John D. Hays
      PO Box 1223, Edmonds, WA 98020-1223 

      On Sun, Mar 24, 2013 at 2:06 PM, Rick Simpson <goatguy101@...> wrote:

      Ah, the joys of  shell scripting. All you need is a one-line script that pipes the file through a grep statement that selects the portion of the line you want to display through another pipe to the serial port on the LCD. Something of the form:
      cat Headers.log | grep 'selection phrase' | /dev/ttyXX
      I am sure someone on this list can fill in the details  :)
      ----- Original Message -----
      Sent: Sunday, March 24, 2013 3:14 PM
      Subject: [Raspberry_Pi_4-Ham_RADIO] Printing to LCD display


      Hello all. I bought the 16x2 LCD display from Radio Shack. It has a serial interface so all that is needed is 3 pins from the Pi, some changes in a couple files and you can send text to the screen.

      I'm looking to for anyone that knows how to parse a log file and be able to format it to send to the screen either in python or bash. Below is the format of file from Headers.log

      2013-03-24 18:43:25: DPlus header - My: xx6xxx /DVAP Your: CQCQCQ Rpt1: REF012 A Rpt2: REF012 A Flags: 00 00 00

      I'm looking to capture the callsign after "My:" and send it to the display and have it update the screen as the Headers.log file changes.

      I can echo to the screen and have even made a small python script to display messages but I have no idea how to dynamically take info from a log file and send to the LCD screen.

      Thanks and 73


      P.S. Here is the python script. You have to do a:
      #apt-get install python-serial to get it working.

      root@raspberrypi:/temp# cat hello
      #!/usr/bin/env python
      import serial
      import time

      ser = serial.Serial(port='/dev/ttyAMA0', baudrate=9600)
      if ser.isOpen():

      Dave Cochran
      Μολον λαβέ

    Your message has been successfully submitted and would be delivered to recipients shortly.