From 7ca79fb65db174045cf6005f47d0a540543353a3 Mon Sep 17 00:00:00 2001 From: Gulyx Date: Mon, 23 Jul 2018 16:02:41 +0200 Subject: [PATCH 1/3] Removed parameter (i.e. level) from the invocation of the methods SerialExpander::setRTS and SerialExpander::setDTR. Possibli this fix is required by the evolution of the python-serial in Ubuntu 18.04 --- pykmaze/keymaze.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pykmaze/keymaze.py b/pykmaze/keymaze.py index 9250bef..d5eaacf 100644 --- a/pykmaze/keymaze.py +++ b/pykmaze/keymaze.py @@ -62,8 +62,10 @@ def __init__(self, log, portname): raise AssertionError('Cannot open device "%s"' % portname) if not self._port.isOpen(): raise AssertionError('Cannot open device "%s"' % portname) - self._port.setRTS(level=0) - self._port.setDTR(level=0) +## self._port.setRTS(level=0) +## self._port.setDTR(level=0) + self._port.setRTS() + self._port.setDTR() self._drain() def close(self): From 39c2371b3d9312f8916117e8ce93dae52a0e2250 Mon Sep 17 00:00:00 2001 From: Gulyx Date: Mon, 23 Jul 2018 16:05:11 +0200 Subject: [PATCH 2/3] Added a simple bash script that should ease downloading the tracks --- extractData.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 extractData.sh diff --git a/extractData.sh b/extractData.sh new file mode 100755 index 0000000..b54363d --- /dev/null +++ b/extractData.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +################################################################## +## Copyright (C) 2018 Guglielmo De Angelis (a.k.a. Gulyx, see +## https://github.com/gulyx). +## +## This file is has been developed for easing the interaction with +## the pykmaze project (see at https://github.com/eblot/pykmaze). +## It has been developed and (not really) tested under Ubuntu 18.04 LTS +## with KeyMaze 500. +## +## This is free software: you can redistribute it and/or modify +## it under the terms of the GNU Lesser General Public License as +## published by the Free Software Foundation, either version 3 of the +## License, or (at your option) any later version. +## +## This software is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU Lesser General Public License for more details. +## +## You should have received a copy of the GNU Lesser General Public License +## along with this source. If not, see . +## +################################################################## + +PYKMAZE="/opt/pykmaze/pykmaze/pykmaze.py" +DEVICE="/dev/ttyUSB0" +TARGET_PATH="./" + +OPTIND=1 +while getopts c:p:o:h OPT +do case "$OPT" in +# command + c) echo "foo"; PYKMAZE="${OPTARG}";; +# device + p) DEVICE="${OPTARG}";; +# output dir + o) if [ -d "${OPTARG}" ] + then + TARGET_PATH="${OPTARG}/" + else + echo >&2 "Target dir \"${OPTARG}\" does not exist!!" + exit 1 + fi;; + [h?]) echo >&2 "USAGE $0 [-c ] [-p ] [-o ]" + exit 1;; + esac +done + +for line in `${PYKMAZE} -p ${DEVICE} -c | tail -n +3 | sed "s/ \+/@/g"`; +## for line in @01@2014-10-12@07:55@13:59@05h33m@13.22km@695m@1717m +do + id=`echo $line | cut -d @ -f 2` + date=`echo $line | cut -d @ -f 3` + + filename=$0; + while [ -e "${filename}" ] + do + tmp=`mktemp -u XXX.kml`; + filename="${TARGET_PATH}${date}_${tmp}" + done + + echo "Processing ${id} --INTO--> ${filename}" + ${PYKMAZE} -p ${DEVICE} -t ${id} -k ${filename} +done From 1e402d0dac013527de64608822fb3882faf83891 Mon Sep 17 00:00:00 2001 From: Gulyx Date: Tue, 24 Jul 2018 09:18:17 +0200 Subject: [PATCH 3/3] Removed Echo statement --- extractData.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extractData.sh b/extractData.sh index b54363d..14371ed 100755 --- a/extractData.sh +++ b/extractData.sh @@ -32,7 +32,7 @@ OPTIND=1 while getopts c:p:o:h OPT do case "$OPT" in # command - c) echo "foo"; PYKMAZE="${OPTARG}";; + c) PYKMAZE="${OPTARG}";; # device p) DEVICE="${OPTARG}";; # output dir