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

Hello I am looking for payment via paypal or other someone able to connect my iot docassion gps lte to a server in it is to install a
Quectel bg96 is another iot a quectel ec21-e because it is beyond my skills despite the hours I spend trying to learn how it works I will have to take control of my computer remotely this connect to iot remove the old give the client server is countering the new server data and that’s it.

I am available at any time, it is a serious request. I use google translation to discuss with you, so small errors can be contained in the discussion.
to pleasure.
My email address

Kdeux@hotmail.fr
Sincerely friends , Kamel.
07.81.79.21.59