Neutree / COMTool

Cross platform communicate assistant(Serial/network/terminal tool)( 跨平台 串口调试助手 网络调试助手 终端工具 linux windows mac Raspberry Pi )支持插件和二次开发
https://neucrack.com/p/186
GNU Lesser General Public License v3.0
1.8k stars 330 forks source link

Opposite DTR and RTS state. #10

Closed dequn closed 2 years ago

dequn commented 5 years ago

According to the code, you may just set the opposite of DTR and RTS, I debug a full day for it, even through I doubt it's maybe my laptop system's bug or the driver bug.

 def dtrChanged(self):
        if self.checkBoxDtr.isChecked():
            self.com.setDTR(False)
        else:
            self.com.setDTR(True)

# so does rtsChanged
Neutree commented 5 years ago

maybe setDTR means set DTR to low level output or not so setDTR(True) makes low level output setDTR(False) makes high level output

doc here

dequn commented 5 years ago

Hello, I looked up some basic knowledge about serial communication, mostly is about RS-232 standard. DTE(Date Terminal Equipment, our computer reference) asserts DTR (Data Terminal Read) when it is ready to receive data, so RTS(Request to send) also. When these two box checked, it stand for we can receive data, but if has been set the opposite value background, We can't read data from serial conn anymore. I think we don't need think about the high/low level, just send a logic value and pySerial do it for us.

Actually, I tried to jump into pySerial source code, but as the first time to do hardware work, it's a little hard for me to understand absolutely. Hope for your explanation, Thank you!

RS-232

Neutree commented 5 years ago

that's right, these two checkbox of this software(comtool) means set DTR/RTS to high level or not, but not set to valid or not. And i didnt consider hadware flowcontrol in my early work, I can change the meaning of DTR/RTS checkbox to the same as pyserial do later.

Neutree commented 2 years ago

I added hardware flow control, and it controlled by pyserial

and when you want to control it by hand, the RTS DTR item now turn on means enable, not mean pin level anymore