Read DVmega Firmware Version

After discussion on a thread in the MMDVM group I hacked a little shell script that queries the DVmega for its firmware version. I got the details from the MMDVMHost code. That is sending 3 bytes to the unit and reading the response. For the version you need to send the bytes 0xE0 0x03 0x00 and read back the version information. That is done by the following shell script:

#!/bin/bash

set -m

PORT="/dev/ttyUSB5"

stty -F ${PORT} ospeed 115200 ispeed 115200 -crtscts

#cat -v < $PORT &
dd if=${PORT} bs=1 count=17 status=none | sed -e "s/$/\n/" &
echo -ne '\xE0\x03\x00' > ${PORT}
sleep 0.1
exit 0

I tested it with a DVmega on a BlueStack micro+.