Difference between revisions of "USB ETH"
From Diustou Wiki
Yousimaier17 (talk | contribs) (Created page with "{{Product |images=File:USB ETH_示意图.png |categories= {{Category|USB}} {{Category|ETH}} |brand=Diustou |features= * USB ETH |interfaces= {{Category|USB}} {{Category|ET...") |
Yousimaier17 (talk | contribs) |
||
Line 196: | Line 196: | ||
</div> | </div> | ||
− | <div class="tabbertab" title="售后"><br />{{ | + | <div class="tabbertab" title="售后"><br />{{Service00}}</div> |
Revision as of 16:22, 17 January 2025
| ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
|
Product Features
- Utilizes the original CH9120 chip, which internally incorporates the Ethernet Media Access Control (MAC) layer and Physical (PHY) layer.
- Enables bidirectional transparent transmission of USB interface data and RJ45 Ethernet port data.
- Supports 10M, full-duplex/half-duplex adaptive Ethernet interface, compatible with IEEE 802.3 protocol.
- Supports MDI/MDIX automatic line conversion, allowing for arbitrary connection of crossover or straight-through cables with automatic switching.
- Supports DHCP for automatic IP address acquisition and DNS domain name access.
- Allows configuration of chip working mode, ports, IP, and other network parameters through host computer software or serial port commands.
- Supports four working modes: TCP CLIENT, TCP SERVER, UDP CLIENT, and UDP SERVER.
- Supports the KEEPALIVE mechanism.
- Supports serial port baud rates ranging from 300bps to 921600bps.
- Equipped with a self-resetting fuse to ensure stable output of current and voltage, protect against overcurrent, overvoltage, and electrostatic discharge, with strong impact resistance.
- Equipped with three types of indicator lights:
- Power indicator light (red): Remains on as long as the power supply is connected normally.
- TX transmission indicator light (green): Flashes when data is received via the RJ45 Ethernet port.
- RX reception indicator light (blue): Flashes when data is received via the USB interface.
Product Selection
User Instructions
Function Introduction
- CH9120 is a network-to-serial transparent transmission chip that enables bidirectional transparent transmission of serial data and network data. It supports four working modes: TCP CLIENT/SERVER and UDP CLIENT/SERVER. The serial port baud rate supports a range of 300bps to 921600bps. Before use, the network and serial port parameters of the chip need to be configured through host computer software. Once configured, CH9120 saves the configuration parameters to its internal storage space. After resetting, CH9120 will operate according to the saved configuration values.
- The basic parameters of CH9120 include: name, MAC address display, automatic IP address acquisition setting, manual IP address setting (including CH9120 IP address, subnet mask, default gateway), and serial port negotiation configuration. The name is mainly for convenient management of CH9120 modules within the local area network, with a length not exceeding 20 bytes. The MAC address field displays the MAC address of the currently selected module. CH9120 has two ways to set network parameters:
- 1) DHCP, which automatically obtains network parameters from a gateway device with DHCP SERVER functionality;
- 2) Manual setting. The serial port negotiation configuration function refers to the ability to enter the serial port configuration mode through serial port handshaking, which is disabled by default.
- The port parameters of CH9120 include: network mode, local port, target IP/domain name, destination port, serial port baud rate/data bits/stop bits/parity bits, network cable disconnection handling, RX packet length, RX packet timeout interval, and network connection operation. Network mode (TCP SERVER/CLIENT, UDP SERVER/CLIENT), destination IP address, and local/destination port are the basic parameters for network communication. The destination IP address can also be accessed using a domain name.
- The serial port baud rate range of the chip is 300bps to 921600bps (the baud rate error of the serial port transmission signal is less than 0.5%, and the allowed baud rate error of the serial port reception signal is not less than 2%). It supports 5, 6, 7, or 8 data bits, as well as 1 or 2 stop bits. It supports odd, even, no parity, space 0, and mark 1 parity modes.
- Network cable disconnection handling refers to whether CH9120 actively closes the connection internally or takes no action when the network cable is disconnected.
- The RX packet length range is 1 to 512. When the serial port of CH9120 receives data of the set length, CH9120 will immediately package the serial port data and send it out through the network. The timeout setting range is 0 to 200, with a timeout unit of approximately 5ms. For example, when the timeout is set to 1, if the data length in the serial port reception buffer does not reach the RX packet length and no new data is received within 5ms, a serial port timeout occurs. After the serial port timeout, CH9120 will send the data received by the serial port out through the network. When the timeout is set to 0, an internal hardware timeout (no new data received for more than 4 data times) mechanism is enabled, which is suitable for scenarios with high real-time requirements and large-scale data transmission and reception.
- The setting for clearing the serial port buffer refers to how to handle data received by the serial port before the network connection is established. It can be cleared (discarded) or retained when a TCP connection is established.
Default Configuration
Product Testing
Note: If you encounter issues with Ethernet port connectivity, please try the following steps:
- Disable the firewall and antivirus software on your computer (usually found in the Control Panel), and also close any security software such as Safe Guard if installed.
- Check the hardware connections for any errors, such as ensuring the Ethernet port is securely connected and the Ethernet cable is functioning properly.
- Verify that the IP address of your computer is on the same subnet as the IP address of the module.
Hardware Preparation
- Type-C data cable x1
- Ethernet cable x1
- PC x1
- USB ETH x1
Testing Method
Direct Connection with Computer
- Hardware Connection:
- Driver Installation:
- Download the CH340 driver and install it.
- Check Module Configuration:
- Open the Network Configuration Software, click "Search Device", and the searched devices will appear in the dialog box above. Double-click the searched device, and the configuration information of the corresponding device will appear below and to the right of the software.
- Modify Computer IP Address:
- Control Panel (or File Explorer) -> Network and Internet -> Network and Sharing Center -> Double-click the network connection -> Properties -> Internet Protocol Version 4 (TCP/IPv4) -> Properties -> Use the IP address below, configure the computer's IP address, subnet mask, and default gateway, then click OK.
- After setting, you can check if the computer's IP is successfully set by going to Control Panel (or File Explorer) -> Network and Internet -> Network and Sharing Center -> Double-click the network connection -> Details.
- Communication Test:
- Open the Serial Port Debugging Assistant, select the corresponding port (which can be viewed through Device Manager), set the serial port baud rate (default for the module is 9600), stop bits (default is 1), data bits (default is 8), and parity (default is None), then open the serial port.
- Open the Network Debugging Assistant, configure the network parameters, click Open to establish a connection.
- Protocol Type: Configure according to the module's working mode. The default working mode of the module here is TCP CLIENT, so the protocol type is set to TCP Server.
- Local Host Address: Set it according to the actual computer IP address. Here, the computer IP is 192.168.1.100.
- Local Host Port: Set it according to the destination port number configured when setting up the module. Here, it is the default value of 1000.
- Use the network debugging assistant and serial port debugging assistant to send data respectively, and check if the data is correctly received on the other end.
Connecting to the Router
- Hardware Connection:
- Checking the Computer's IP Address:
- Installing the Driver:
- Download the CH340 driver and install it.
- Changing Module Configuration:
- Open the Network Configuration Software, click "Search Device", and the searched devices will appear in the dialog box above. Double-click the searched device, and the configuration information of the corresponding device will appear below and to the right of the software.
- Modify the device IP, gateway, destination IP, and destination port number respectively. After the modifications, click "Configure Parameter Settings" and wait for the settings to complete.
- Device IP: Set it to an IP in the same subnet as the computer. Here, the computer's IP is 192.168.0.37, so set the module's IP to 192.168.0.200. Also, when setting the IP address, ensure that the IP address is not already in use.
- Gateway: Set the corresponding gateway based on the IP address.
- Destination IP: Set it based on the actual IP address of the connected computer. Here, the computer's IP is 192.168.0.37.
- Destination Port Number: Modify as needed. The default value of 1000 is used here.
- After configuration, click "Search Device" again, double-click the searched device, and check if the configuration was successful.
- Communication Test:
- Open the Serial Port Debugging Assistant, select the corresponding port (which can be viewed through Device Manager), set the serial port baud rate (default is 9600), stop bits (default is 1), data bits (default is 8), and parity (default is None), and then open the serial port.
- Open the Network Debugging Assistant, configure the network parameters, click "Open" to establish a connection.
- Protocol Type: Configure it based on the module's working mode. The default working mode of the module here is TCP CLIENT, so set the protocol type to TCP Server.
- Local Host Address: Set it based on the actual computer's IP address. Here, the computer's IP is 192.168.0.37.
- Local Host Port: Set it based on the destination port number configured when setting up the module. The default value here is 1000.
- Use the network debugging assistant and serial port debugging assistant to send data respectively, and check if the data is correctly received on the other end.
Mode Description
TCP SERVER
- TCP Server refers to a TCP server. In TCP Server mode, the module listens on a local port, accepts and establishes a connection for data communication when a connection request is received. When the module's serial port receives data, it simultaneously sends the data to the client device connected to the module. It is commonly used for communication with TCP clients within a local area network. Like TCP Client, it distinguishes between connections and disconnections to ensure reliable data exchange.
- When the module operates as a TCP Server, it first listens on the locally set port, responds to connection requests, and establishes a connection. After the serial port receives data, it sends it to the device connected to the USB ETH network port. It can accept up to 1 TCP Client connection.
- When the module operates as a TCP Server, it actively listens on the local port number and does not monitor the connected IP and port number. When the number of connections exceeds the maximum, it actively disconnects the oldest connection.
- Application Example:
- Set the module's operating mode to TCP Server, with a local port number of 2000 and a remote port number set to random. Click to configure device parameters, and after setting, search for the device. Upon finding the module, verify if the set parameters are correct.
- Open the module's Ethernet port and connect to a network debugging assistant on a PC. Set the protocol type to TCP Client, with the PC's IP address as 192.168.1.100 and the remote host address as 192.168.1.200:2000, to establish a connection.
- Set the correct serial port parameters, click to open the serial port, and click to send. Receive bi-directional data transmission.
TCP CLIENT
- TCP Client refers to a TCP client. It actively initiates a connection and connects to a server to facilitate the interaction of serial port data with server data. According to the relevant provisions of the TCP protocol, TCP Client distinguishes between connections and disconnections, thereby ensuring reliable data exchange. It is commonly used for data interaction between devices and servers and is the most commonly used method of networked communication.
- When the module operates as a TCP Client, it needs to connect to a TCP Server. The parameters that need to be considered are the destination IP and destination port number, where the destination IP is a device within the same local area network.
- When the module operates as a TCP Client, it actively connects to the target port of the target IP and does not accept other connection requests.
- When the module operates as a TCP Client, the local port number of the USB ETH should be set to random. This allows the USB ETH to access the server with a random port number, which can resolve issues where the server judges the connection status as abnormal and blocks reconnection requests from the USB ETH, leading to failed reconnections.
- Application Example:
- Set the module's operating mode to TCP Client, with a destination IP of 192.168.1.100, a remote port number of 1000, and a local port number set to random. Click to configure device parameters, and after setting, search for the device. Upon finding the module, verify if the set parameters are correct.
- Open the module's Ethernet port and connect to a network debugging assistant on a PC. Set the protocol type to TCP Server, with the PC's IP address as 192.168.1.100 and the listened-on port number as 1000. The testing software's network side displays connection information: 192.168.1.200:2093 (randomly assigned port number).
- Set the correct serial port parameters, click to open the serial port, and click to send. Receive bi-directional data transmission.
UDP SERVER
- A UDP Server operates on the basis of standard UDP without verifying the source IP address. After receiving each UDP data packet, it changes the destination IP to the source IP and port number. When sending data, it sends to the most recently communicated IP and port number.
- This mode is typically used in data transmission scenarios where multiple network devices need to communicate with the module and TCP is not preferred due to high speed and frequency requirements.
- Application Example:
- Set the module's operating mode to UDP Server with a destination IP of 192.168.1.100, a remote port number of 1000, and a local port number of 2000. Click to configure device parameters, and after setting, search for the device. Upon finding the module, verify if the set parameters are correct.
- Open the module's Ethernet port and connect to a network debugging assistant on a PC. Set the protocol type to UDP, with the PC's IP address as 192.168.1.100 and the listened-on port number as 1000, to establish a connection.
- Set the correct serial port parameters, click to open the serial port, and click to send via serial port. After the network debugging assistant receives the serial port data, the remote host will change to the module's IP and port. Then click to send via network, sending data to the serial port.
UDP CLIENT
- UDP Client is a connectionless transmission protocol that provides a simple, unreliable message delivery service for transactions. There is no establishment or disconnection of connections; data can be sent to the recipient simply by specifying the IP and port. It is commonly used in data transmission scenarios where packet loss rate is not a requirement, data packets are small, sending frequency is high, and data needs to be transmitted to a specified IP.
- In UDP Client mode, the module will only communicate with the target port number of the target IP. If data does not come from this channel, it will not be received by the USB ETH.
- Application Example:
- Set the module's operating mode to UDP Client with a destination IP of 192.168.1.100, a remote port number of 1000, and a local port number of 2000. Click to configure device parameters, and after setting, search for the device. Upon finding the module, verify if the set parameters are correct.
- Open the module's Ethernet port and connect to a network debugging assistant on a PC. Set the protocol type to UDP, with the PC's IP address as 192.168.1.100 and the listened-on port number as 1000, to establish a connection.
- Set the correct serial port parameters, click to open the serial port, and click to send via serial port. After the network debugging assistant receives the serial port data, the remote host will change to the module's IP and port. Then click to send via network, sending data to the serial port.
Software
- Network Debugging Assistant
- Serial Port Debugging Assistant
- Network Configuration Software
- CH340/CH341 Windows Driver (supports 32/64-bit Windows 11/10/8.1/8/7/Vista/XP)