I’m trying to write a small piece of code in python to use FTDI chip. I am using pyserial and can send byte string that’s correct but I receive no response and I believe my device is waiting for serial number authentication or something like that.. any hints would be helpfull as I’m fairly new to programming
Asked
Active
Viewed 602 times
-1
-
Hi and welcome to Stack Overflow. Can you indicate what device the FTDI chip is connected to, as well as what a logic analyzer or appropriate oscilloscope detects when you probe the RX and TX lines while trying to run your code? – nanofarad Sep 13 '18 at 02:43
-
I do not have a logic analyzer unfortunately I’m just monitoring data sent and received with serial port monitor it’s connected rs232 FTDI chip – Mjway Sep 13 '18 at 02:48
-
Please indicate how the serial monitor is connected and what it detects. – nanofarad Sep 13 '18 at 02:49
-
I’m using hhd software to monitor port and can see data transmitted when other software is running and can see what data is transmitted with my program.. however when I send the data something is not correct as I get no response from the device – Mjway Sep 13 '18 at 03:35
-
It is connected virtually using hhd software.. watches data transmission however I feel like my device doesn’t except the command since it is likely hasn’t been enabled to communicate – Mjway Sep 13 '18 at 03:40
-
In that case, we will need the datasheet and other details on the device in question. – nanofarad Sep 13 '18 at 15:06
1 Answers
0
import serial
import time
ser = serial.Serial('COM3')
if ser.isOpen:
print(ser.name + 'Communication Open')
ser.bytesize = 8
ser.stopbits = 1
ser.baud = 9600
String = [0xff, 0x10, 0x6f, 0x00, 0x73]
String1 = [0xf4, 0x10, 0x6f, 0x01, 0x74]
String3 = [0xf4, 0x10, 0x6f, 0x02, 0x75]
String4 = [0xf4, 0x10, 0x6f, 0x03, 0x76]
String5 = [0xf4, 0x10, 0x6f, 0x04, 0x77]
String6 = [0xf4, 0x10, 0x6f, 0x05, 0x78]
String7 = [0xf4, 0x10, 0x6f, 0x06, 0x79]
String8 = [0xf4, 0x10, 0x6f, 0x07, 0x7a]
String9 = [0xf4, 0x10, 0x6f, 0x08, 0x7b]
String10 = [0xf4, 0x10, 0x6f, 0x08, 0x7c]
ser.write(String)
ser.read(8)
print(ser.read(8))
ser.write(String1)
print(ser.read(8))
ser.write(String2)
print(ser.read(8))
ser.close()
this my code im trying to use as it isnt totally complete just a start to see if I can get a response from the device

Mjway
- 1