Page 1 of 1

Firmware Version from command line

Posted: Tue Feb 11, 2020 11:06 pm
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?

Re: Firmware Version from command line

Posted: Thu Feb 13, 2020 7:03 pm
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.

Re: Firmware Version from command line

Posted: Fri Feb 14, 2020 12:07 am
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...