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
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?
Nobody has encountered such a problem?
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)
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”?
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?
You could try to write a script and put it into your initial task sequences to execute this script by default.
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
Sorry, didn’t try to do that.