EC21-E (quecopen version) USB serial port

Hi everybody,

I would like to use USB connection of EC21-E module as com port to send custom commands/data to my quecopen application.

Currently i’ m using main UART to receive such commands/data

Ql_UART_Open("/dev/ttyHS0",B_115200, FC_NONE);

I wonder if it is possbile to use a “USB port” (/dev/usb0 ???)

On PC side (windows) would it be enumerated an additional com port in “device manager” list?

Thanks

Nobody has encountered such a problem?

Thanks!

Hi Davide,

You could refer to codes below to add a virtual serial port over USB.

# Disable USB connection
echo 0 > /sys/devices/virtual/android_usb/android0/enable 
# Specify transport type
echo TTY > /sys/devices/virtual/android_usb/android0/f_acm/acm_transports 
# Enable ACM function on USB gadget driver
echo diag,serial,rmnet,ffs,acm > /sys/devices/virtual/android_usb/android0/functions
# Enable USB connection
echo 1 > /sys/devices/virtual/android_usb/android0/enable 

After above operation, then there’s a new comm port listed in device manager, and /dev/ttyGS1 is what you want.(see fig below)

Br,
Zach

Hello @Zach.zhang-Q,

Thank you for reply and explanation.

I’m trying to change the configurations as you reported me.
As soon as I disable USB connection via ADB shell in linux, the connection is closed and I need to reboot the module.
Should I do the procedure using Debug UART port?

Moreover, if I want to enable the virtual com port by default where should I modify the kernel such that I can “compile” it and install into the module using “Quectel_Customer_FW_Download_Tool_V4.31”?

Thank you

Hello @Zach.zhang-Q,

I was able to replicate your test using debug com port of the module. Very good!

I have only to setup by default the configuration in the kernel such that the module always export the virtual com port when connected to PC. In fact, if I reboot the module, then the virtual com port is not showed anymore.
Can you help me?

Thanks

Hi Davide,

You could try to write a script and put it into your initial task sequences to execute this script by default.

Br,
Zach

1 Like

Hello @Zach.zhang-Q,

thanks for the hint. I added a script in /etc/init.d folder. It seems to work!

However if you know a method to setup by the default the acm functionality in the kernel, please let me know.

Thank you and regards

Hi Davide,

Sorry, didn’t try to do that.

Br,
Zach