Author Topic: CH9121 based 2-CH UART TO ETH - Waveshare  (Read 2928 times)

0 Members and 1 Guest are viewing this topic.

Offline interflexoTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: pt
CH9121 based 2-CH UART TO ETH - Waveshare
« on: January 01, 2023, 11:12:15 pm »
Hi,
The main goal is to use a Raspberry Pi Pico to control several devices, send acquisition data and receive commands from a TCP Server (Windows PC) over a wired network.
The Pico would interface the wired network via a UART to Ethernet adapter configured as TCP Client. This will be replicated to more than 100 devices. The messages are a few bytes every other hundreds of milliseconds.
This is the CH9121 based UART to ETH: https://www.waveshare.com/wiki/2-CH_UART_TO_ETH
I managed to inspect and change the adapter configuration via UART and through NetModuleConfig.exe LAN utility. The device responds to pings (ICMP) over the network and DHCP works well.
Wireshark does not show any TCP packets.
The TCP Server code is tested against several TCP Clients on other PC over the same network. Used also other third party TCP Client and Server utilities for debug.
I understand the device configuration parameters and the packet send mechanism (packing buffer full and timeout).
This is an handy building block for the new generation of powerful small MCUs. It blows my mind the lack of online feedback about the usage of these devices (or should have seen the red flag). In my defense CH912X has an entry on Github Cursed Hardware Collection...
My question is. Did anyone managed to make one of these things to work properly?

CH9121 is a chip realizing transparent transmission between network and UART. It integrates TCP/IP protocol stack, which can realize bidirectional transparent transmission between network data packets and serial data. It has 4 working modes: TCP CLIENT, TCP SERVER, UDP CLIENT and UDP SERVER. The serial baud rate can be up to 921600bps. It can be easily configured by upper computer software or serial commands, which is convenient and quick.

● Internal Ethernet MAC layer and PHY layer
● Realize bidirectional transparent transmission between serial data and network data
● Support 10/100M, full/half duplex self-adaption Ethernet interface, compatible with 802.3 protocol
● Support automatic MDI/MDIX line conversion
● Support DHCP automatic access to IP address, and DNS domain name access
● Set the chip working mode, port, IP and other network parameters through upper computer software and serial commands
● Support four working modes: TCP CLIENT, TCP SERVER, UDP CLIENT and UDP SERVER
● Support up to two independent UARTs, independent transparent transmission
● Serial baud rate supports 300bps ~ 921600bps
● Serial TTL level, compatible with 3.3V and 5V
● UART supports full-duplex and half-duplex serial communication, and RS485 transceiving automatic switch
● Support and provide virtual serial software
● Support KEEPALIVE mechanism

« Last Edit: January 02, 2023, 08:01:47 am by interflexo »
 

Online tellurium

  • Regular Contributor
  • *
  • Posts: 232
  • Country: ua
Re: CH9121 based 2-CH UART TO ETH - Waveshare
« Reply #1 on: January 02, 2023, 05:03:27 pm »
If you do not consider using an alternative - a W5500 module, please ignore this message.

If you're open to use W5500 instead of CH9121, then please take a look at this example:
https://github.com/cesanta/mongoose/tree/master/examples/rp2040/pico-w5500

Cons:
- It is more complex software-wise
- Requires Mongoose library (GPLv2/commercial licensed)

Pros:
- Can implement multiple connection - server, client, etc
- Can talk multiple protocols - HTTP, MQTT, etc.
  (therefore your PC client/server can be a standard browser / Web server, not a custom TCP server)
- Can use TLS
- W5500 is comparable to CH912X price-wise

Disclosure: I work for a company that develops Mongoose library
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 
The following users thanked this post: interflexo

Offline interflexoTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: pt
Re: CH9121 based 2-CH UART TO ETH - Waveshare
« Reply #2 on: January 03, 2023, 07:44:52 am »
I ordered yesterday a Pi Pico with a fully hardwired W5500 on board just to be on the safe side.
In the meantime I opened a ticket on Waveshare regarding the CH9121 issue, let's see how it goes. I sure would like to get what I payed for (device order + time invested on sorting out the project solution and trying hard to get the device to work).
Quote from a movie: Time is the single most precious commodity in the universe.
 

Online tellurium

  • Regular Contributor
  • *
  • Posts: 232
  • Country: ua
Re: CH9121 based 2-CH UART TO ETH - Waveshare
« Reply #3 on: January 03, 2023, 09:00:04 pm »
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline interflexoTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: pt
Re: CH9121 based 2-CH UART TO ETH - Waveshare
« Reply #4 on: January 04, 2023, 02:43:12 pm »
Yes it is. Ordered it from Mouser and will be delivered next Friday.
 

Online tellurium

  • Regular Contributor
  • *
  • Posts: 232
  • Country: ua
Re: CH9121 based 2-CH UART TO ETH - Waveshare
« Reply #5 on: January 04, 2023, 05:16:50 pm »
Great.

An example mentioned works on that board with no changes.
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline interflexoTopic starter

  • Regular Contributor
  • *
  • Posts: 132
  • Country: pt
Re: CH9121 based 2-CH UART TO ETH - Waveshare
« Reply #6 on: January 05, 2023, 01:08:03 am »
I received word from Waveshare advising me to open the ports for SSCOM (TCP Server utility for this case) on the Windows Firewall.
My first text explained that I disabled the Windows Firewall for test purposes and every TCP server (including SSCOM they mention on their instructions) worked flawlessly with another PC (as TCP Client) over the same network. It's wild goose chase time.
 

Offline Sagar S M

  • Newbie
  • Posts: 1
  • Country: in
Re: CH9121 based 2-CH UART TO ETH - Waveshare
« Reply #7 on: November 19, 2023, 10:13:51 am »
Hi,
I am also trying to use a CH9121 board.
Could you please provide the link for NetModuleConfig.exe file to change the settings ?

thanks in advance
Sagar S M
 

Offline eb4fbz

  • Regular Contributor
  • *
  • Posts: 179
  • Country: es
Re: CH9121 based 2-CH UART TO ETH - Waveshare
« Reply #8 on: April 24, 2024, 08:47:51 pm »
Have you managed to make it work? I’m considering CH9121 for some future developments, although I’m only interested in using it as TCP Server.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf