Applications
Use Python to access serial ports
Digi Connect IT® 16/48 User Guide
478
# python
Python 3.6.12 (default, Jan 11 2021, 10:25:21)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
3. Import the
hid
module:
>>> import hid
>>>
4. Use the help command with
hid
:
>>> help(hid)
Help on package hid:
NAME
hid
PACKAGE CONTENTS
CLASSES
_ctypes.Structure(_ctypes._CData)
DeviceInfo
builtins.Exception(builtins.BaseException)
HIDException
builtins.object
Device
...
>>>
5. Use
Ctrl-D
to exit the Python session. You can also exit the session using
exit()
or
quit()
.
Use Python to access serial ports
You can use the Python
serial
module to access serial ports on your Connect IT 16/48 device that are
configured to be in Application mode. For example, you can configure USB ports to function serial
ports and interact programmatically with those ports. See
for information
about configuring a serial port in Application mode, and see
for information
about configuring USB ports on the device to function as serial ports.
To use Python to access serial ports:
1. Log into the Connect IT 16/48 command line as a user with shell access.
Depending on your device configuration, you may be presented with an
Access selection
menu
. Type
shell
to access the device shell.
2. Determine the path to the serial port:
# ls /dev/serial/
by-id
by-path
by-usb
port1
USB_port1
USB_port2
#
Содержание Connect IT 16
Страница 1: ...Digi Connect IT 16 48 User Guide Firmware version 21 2 ...
Страница 157: ...Interfaces Bridging Digi Connect IT 16 48 User Guide 157 8 Click Apply to save the configuration and apply the change ...
Страница 440: ...Services Configure the ping responder service Digi Connect IT 16 48 User Guide 440 iperf Done ...