Re: [Raspberry_Pi_4-Ham_RADIO] Printing to LCD display
- 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/ttyXXOn 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/ttyXXI am sure someone on this list can fill in the details :)Rick----- Original Message -----From: mark_w6satSent: Sunday, March 24, 2013 3:14 PMSubject: [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
ser = serial.Serial(port='/dev/ttyAMA0', baudrate=9600)
Dave Cochran--Μολον λαβέ