¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Question on #consolecommands


 

Hi QRP -

capture - unique; currently broken for my python scripts, since not ASCII;
returns display buffer in some(??) bitmap format.
- QRP seems to have gotten this working in his latest NanoVNA-Sharp branch
with latest -Q firmware.
Wrong information. capture command is not unique, it is available in all
firmware versions, except these which is very-very old,
completely outdated with a bunch of bugs.
Sorry, key part of message was: "broken for my python scripts, since not ASCII"

- problem is in >>MY<< Python code, NOT firmware

- I need to add some Python that correctly handles 'capture' response,
e.g. from :

def capture(self):
from PIL import Image
self.send_command("capture\r")
b = self.serial.read(320 * 240 * 2)
x = struct.unpack(">76800H", b)
# convert pixel format from 565(RGB) to 8888(RGBA)
arr = np.array(x, dtype=np.uint32)
arr = 0xFF000000 + ((arr & 0xF800) >> 8) + ((arr & 0x07E0) << 5) + ((arr & 0x001F) << 19)
return Image.frombuffer('RGBA', (320, 240), arr, 'raw', 'RGBA', 0, 1)

Join [email protected] to automatically receive all group messages.