From d859ab1aad01ed1fb4db69f9ce23268764c1dc3d Mon Sep 17 00:00:00 2001 From: klaute Date: Sun, 25 Sep 2016 11:14:30 +0200 Subject: [PATCH] Serial port naming for windows machines fixed. --- tools/2m_scan.bat | 5 +++++ tools/70cm_scan.bat | 5 +++++ tools/install_packages.bat | 6 ++++++ tools/meas.py | 6 ++++-- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 tools/2m_scan.bat create mode 100644 tools/70cm_scan.bat create mode 100644 tools/install_packages.bat diff --git a/tools/2m_scan.bat b/tools/2m_scan.bat new file mode 100644 index 0000000..93b433d --- /dev/null +++ b/tools/2m_scan.bat @@ -0,0 +1,5 @@ +@echo off + +C:\Python27\python.exe meas.py -o 70cm.csv -s 144000000 -e 146100000 -i 50 -p 5000 -d COM16 -m + +pause diff --git a/tools/70cm_scan.bat b/tools/70cm_scan.bat new file mode 100644 index 0000000..5af68d4 --- /dev/null +++ b/tools/70cm_scan.bat @@ -0,0 +1,5 @@ +@echo off + +C:\Python27\python.exe meas.py -o 70cm.csv -s 430000000 -e 440100000 -i 50 -p 5000 -d COM16 -m + +pause diff --git a/tools/install_packages.bat b/tools/install_packages.bat new file mode 100644 index 0000000..aaef6eb --- /dev/null +++ b/tools/install_packages.bat @@ -0,0 +1,6 @@ +@echo off + +C:\Python27\python.exe -m pip install --upgrade pip +C:\Python27\python.exe -m pip install --upgrade matplotlib pyserial + +pause diff --git a/tools/meas.py b/tools/meas.py index 531522a..4f14082 100644 --- a/tools/meas.py +++ b/tools/meas.py @@ -285,8 +285,10 @@ def openSerialDevice(d): global ser try: - #serial.Serial.close() - ser = serial.Serial("\\\\.\\"+d) + if "com" in d.lower(): + d = "\\\\.\\"+d + + ser = serial.Serial(d) except: print "ERROR (1): Can't open the serial device " + d exit(1)