Firmware Version from command line

General support for the Pi-Star System
Post Reply
User avatar
N7HHI
Posts: 65
Joined: Thu Apr 12, 2018 11:33 pm
Location: Wentzville, MO
Contact:

Firmware Version from command line

Post by N7HHI »

I am trying to find the best way to display the firmware version form the command line.
The following snippet works after the system is up and running:

Code: Select all

grep 'MMDVM protocol version' /var/log/pi-star/MMDVM*.log | awk '{print $9}'
However, what I am trying to do is add the firmware version to the motd file at boot time. The log file in the above snippet is not present when rc.local is being run, so that code snippet produces an empty string when run at boot time.

Is there a better place to pull the firmware version from that exist at boot?
Last edited by N7HHI on Tue Feb 11, 2020 11:11 pm, edited 1 time in total.
73...
Scott - N7HHI
User avatar
N7HHI
Posts: 65
Joined: Thu Apr 12, 2018 11:33 pm
Location: Wentzville, MO
Contact:

Re: Firmware Version from command line

Post by N7HHI »

Thanks Jason,

At first glance I don't see what it would take from that script to get what I am looking for. When I get a chance I will investigate the script in more detail to see what I can get out of it.
73...
Scott - N7HHI
User avatar
N7HHI
Posts: 65
Joined: Thu Apr 12, 2018 11:33 pm
Location: Wentzville, MO
Contact:

Re: Firmware Version from command line

Post by N7HHI »

I ran the following to find the modem device:

Code: Select all

pi-star@pi-star(rw):~$ find /dev/tty* ! -type l | grep -E "tty(AMA|ACM|USB|S)."
It resulted in:
/dev/ttyAMA0
/dev/ttyS0
/dev/ttySC0
/dev/ttySC1


I then tried the following with each of the devices from the results of the previous command:

Code: Select all

pi-star@pi-star(rw):~$ sudo echo -en '\xE0\x03\x00' > /dev/ttyAMA0
Each device returned nothing. /dev/ttyS0 actually hung. I had to break out using a [Ctrl] C

This is probably user error on my part, not knowing exactly how to send a packet to the serial port. And I am not sure which device is the proper one. So I am probably in over my head...
73...
Scott - N7HHI
Post Reply