Skip to content
André Castro edited this page Sep 10, 2024 · 8 revisions

Serial connection details

  • ID = 61 (this should be different for each Thies)

  • Baud = 9600

  • Bits = 8

  • Parity = N

  • Stop bits = 1

  • Communication = Half-duplex, RS-485

  • device: /dev/ttyACM0

Serial communication

find out the Thies ID

In order to communicate successfully with the Thies it is important to set its ID, according to sensor_name: value in configs_netcdf/ For instance

In order to do so, on a terminal window, we shall follow the output of the /dev/ttyAMC0 port: tail -f /dev/ttyACM0. And on another, we can send requests for say, getting Serial Number of the device. If the ID is correct, expect the tail window to print a response. If that is not the Thies ID, there won't be a response

  • ID 00 get SN: echo -en "00SN\r" > /dev/ttyACM0
  • ID 01 get SN: echo -en "01SN\r" > /dev/ttyACM0
  • ID 06 get SN: echo -en "06SN\r" > /dev/ttyACM0

setting new ID to the Thies

To communicate with the Thies the command construction is in the format:

{ID number}{Command code}{Parameter number as a 5 digit number}{Carriage return}

To alter the settings on the Thies, firstly it needs to be placed in configuration mode. The command to do this (for an instrument with an ID of 61):

01KY00001\r ie echo -en "01KY00001\r" > /dev/ttyACM0 here the Thies with ID 01 is set in conf mode

The Thies will reply:

!01KY00001/r

After this the required command can be sent to the instrument. To change the ID for example to 05, the following code can be sent:

01ID00005\r ie echo -en "01ID00005\r" > /dev/ttyACM0

After changing the ID, the next command will start with the new ID number. AS an example to request the telegram with the new ID the following command would be used:

05TR00004\r

Debug Serial connection

echo -en "61KY00001\r" > /dev/ttyACM0

tail -f /dev/ttyACM0

USB Ports

identify Parsivel and Thies Ports

Parsivel is at /dev/ttyUSB0

python -m serial.tools.list_ports -v

/dev/ttyACM0        
    desc: USB Single Serial
    hwid: USB VID:PID=1A86:55D3 SER=5586004457 LOCATION=1-1.2:1.0
/dev/ttyAMA0        
    desc: ttyAMA0
    hwid: fe201000.serial
/dev/ttyUSB0        
    desc: FT232R USB UART - FT232R USB UART
    hwid: USB VID:PID=0403:6001 SER=A10KN2XG LOCATION=1-1.3

lspci

00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2711 PCIe Bridge (rev 20)
01:00.0 USB controller: VIA Technologies, Inc. VL805 USB 3.0 Host Controller (rev 01)

lsusb -D /dev/bus/usb/001/003

Device: ID 1a86:55d3 QinHeng Electronics USB Single Serial
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x1a86 QinHeng Electronics
  idProduct          0x55d3 
  bcdDevice            4.45
  iManufacturer           0 
  iProduct                2 USB Single Serial
  iSerial                 3 5586004457

lsusb -D /dev/bus/usb/001/004

Device: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0403 Future Technology Devices International, Ltd
  idProduct          0x6001 FT232 Serial (UART) IC
  bcdDevice            6.00
  iManufacturer           1 FTDI
  iProduct                2 FT232R USB UART
  iSerial                 3 A10KN2XG
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0020
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0

Thies Telegram example

1:06; 2:06; 3:0854; 4:2.11; 5:11.02.14; 6:12:56:02; 7:00; 8:00; 9:NP   ; 10:000.000; 11:00; 12:00; 13:NP   ; 14:000.000; 15:000.000; 16:000.000; 17:0074.77; 18:99999; 19:-9.9; 20:100; 21:0.0; 22:0; 23:0; 24:0; 25:0; 26:0; 27:0; 28:0; 29:0; 30:0; 31:0; 32:0; 33:0; 34:0; 35:0; 36:0; 37:0; 38:+33; 39:37; 40:1778; 41:4011; 42:2772; 43:275; 44:028; 45:034; 46:+27.0; 47:999; 48:9999; 49:9999; 50:9999; 51:00000; 52:00000.000; 53:00000; 54:00000.000; 55:00000; 56:00000.000; 57:00000; 58:00000.000; 59:00000; 60:00000.000; 61:00000; 62:00000.000; 63:00000; 64:00000.000; 65:00000; 66:00000.000; 67:00000; 68:00000.000; 69:00000; 70:00000.000; 71:00000; 72:00000.000; 73:00000; 74:00000.000; 75:00000; 76:00000.000; 77:00000; 78:00000.000; 79:00000; 80:00000.000; 81:000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000; 521:99999; 522:99999; 523:9999; 524:999; 525:CD

Clone this wiki locally