kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
use 255 data points, slight tweaks for consistency
rodzic
47528ee34c
commit
0e4b668836
|
@ -127,5 +127,5 @@ def detect_version(serialPort: serial.Serial) -> str:
|
|||
# this is a nanovna v2
|
||||
return 'nanovnav2'
|
||||
|
||||
logger.error('Unknown VNA type: hardware responded to \r with: %s', data)
|
||||
logger.error('Unknown VNA type: hardware responded to CR with: %s', data)
|
||||
return 'unknown'
|
||||
|
|
|
@ -34,7 +34,7 @@ def _unpackUnsigned16(b):
|
|||
|
||||
class NanoVNAV2(VNA):
|
||||
name = "NanoVNA-V2"
|
||||
datapoints = 101
|
||||
datapoints = 255
|
||||
screenwidth = 320
|
||||
screenheight = 240
|
||||
|
||||
|
@ -43,7 +43,7 @@ class NanoVNAV2(VNA):
|
|||
|
||||
if platform.system() != 'Windows':
|
||||
tty.setraw(self.serial.fd)
|
||||
self.serial.timeout = 3
|
||||
self.serial.timeout = 6 # for this much data we need a longer timeout
|
||||
|
||||
# reset protocol to known state
|
||||
self.serial.write([0, 0, 0, 0, 0, 0, 0, 0])
|
||||
|
@ -174,4 +174,5 @@ class NanoVNAV2(VNA):
|
|||
cmd = b"\x23\x00" + int.to_bytes(int(self.sweepStartHz), 8, 'little')
|
||||
cmd += b"\x23\x10" + int.to_bytes(int(self.sweepStepHz), 8, 'little')
|
||||
cmd += b"\x21\x20" + int.to_bytes(int(self.datapoints), 2, 'little')
|
||||
cmd += b"\x21\x22" + int.to_bytes(1, 2, 'little') # number of samples
|
||||
self.serial.write(cmd)
|
||||
|
|
Ładowanie…
Reference in New Issue