I have a raspberry pi 3b+, and I am trying to communicated with a TPI synthesizer model 1001-B. I want to use Python and specifically the pyserial module to communicate with a serial port - i.e. the synthesizer, which is connected via USB to the raspberry pi. The synthesizer specifies some particular setting for the python code:

"Internally the communication USB port is connected to an FTDI chip that acts as a USB to UART translator. Therefore, the user’s program accesses the unit as if it was a COM port. The driver installed in the computer maps the computer’s USB port to a virtual COM port. The user’s program must set the COM port parameters to the following… • Baud rate: 3,000,000 (3 Mbit/sec) • Data bits: 8 • Stop bits: 1 • Parity: None • Handshake: Request to send"

The code I tried was:

import serial

ser = serial.Serial( port='/dev/ttyUSB0', baudrate=3000000, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS )

I then ran the following code, hoping to write to the device and enable user control on the device:

ser.write(chr(0xAA) + chr(0x55) + chr(0x00) + chr(0x02) + chr(0x08) + chr(0x01) + chr(0xF4))

I chose this particular set of strings because the user manual specified it. "The full packet including the header and checksum is… 0xAA, 0x55, 0x00, 0x02, 0x08, 0x01, 0xF4" where 0xAA, 0x55, 0x00, 0x02 is the header, 0x08, 0x01 is the body, and 0xF4 is the checksum.

When I did, the device did not write anything back. Any ideas? Can I use pyserial with Linux? Help!

  • 1
    Ah let me see. (1) So your TPI synthesizer is using a USB to UART/serial/TTL cable/adapter (never mind FTDI, which is not relevant here) to talk to the other side. (2) The other side, in your case Rpi, is of course using serial, either the UART RxD, TxD pins, or also a USB to serial cable to the other side. (3) In other words, TPIS has a USB to serial cable, Rpi also has a serial cable (on board serial, or also USB to serial), and the two serial cables join end to end (Importnat: Rx/TX wires "crossing over") Please let know if I see the picture correctly, before I move on.
    – tlfong01
    Feb 14, 2020 at 3:18
  • 1
    Also can you give me the web link to the AT command set, or the user manual that describes the serial spec 3kbd8N1, the AT commands and the package spec: header, body, checksum etc
    – tlfong01
    Feb 14, 2020 at 3:22
  • I casually googled and found the following, but no luck with the AT command set:(1) Review: TPI-1001-B RF Synthesizer interferencetechnology.com/review-tpi-1001-b-rf-synthesizer (2) TPI-1001-B RF Synthesizer Features rf-consultant.com/products/tpi-1001-b-signal-generator (3) TPI-1001-B RF Synthesizer Features YouTube rf-consultant.com/products/tpi-1001-b-signal-generator (4) AliBaBa TPI-1001-B - $450 alibaba.com/product-detail/TPI-1001-B_50021319321.html / to continue, ...
    – tlfong01
    Feb 14, 2020 at 3:52
  • (5) TPI-1001A User Manual - Trinity Power Inductry studylib.net/doc/18665149/tpi-1001-a-user-manual---rf
    – tlfong01
    Feb 14, 2020 at 3:52
  • 1
    Run your script on a regular PC. Unless it works, the problem is not related to the Raspberry. Feb 14, 2020 at 8:27


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.