Nov-26-2021, 04:04 PM
Nov-26-2021, 06:39 PM
I can't give you a complete answer as my needs are few, and I usually do any 'AT' commands directly using Putty.
I will instead direct you to paramiko (which is an implementation of the SSHv2 protocol) URL's:
pipy: https://pypi.org/project/paramiko/
main site: https://www.paramiko.org/
GitHub: https://github.com/paramiko/paramiko
Check the 'demos' https://github.com/paramiko/paramiko/tree/main/demos
to see if you can find an example of what you're looking for.
There may be better options.
I will instead direct you to paramiko (which is an implementation of the SSHv2 protocol) URL's:
pipy: https://pypi.org/project/paramiko/
main site: https://www.paramiko.org/
GitHub: https://github.com/paramiko/paramiko
Check the 'demos' https://github.com/paramiko/paramiko/tree/main/demos
to see if you can find an example of what you're looking for.
There may be better options.
Dec-06-2021, 03:22 PM
Here is a solution:
import serial import io import time import os signal = serial.Serial( port='/dev/ttyUSB2', baudrate=115200, bytesize=8, parity='N', timeout=1, stopbits=1, rtscts=False, dsrdtr=False ) signal_text = io.TextIOWrapper(signal, newline='\r\n') signal.write("at+qccid\r\n".encode()) aaa = "a" while not aaa[0]=='+': aaa = signal_text.readline().rstrip() print("ICCID: ", aaa[8:])
Dec-06-2021, 06:09 PM
Thanks for sharing!