How to send AT command to EC20 module to read some data if gsm port already acquired by pppd service

When using PPP the device would have entered data mode. You need to temporarily exit data mode and then issue your AT commands in command mode.

As specified in the AT commands manual:

The +++ character sequence causes the module to switch from data mode to AT command mode. It
allows inputting AT commands while maintaining the data connection with the remote device.

  1. To prevent the “+++” escape sequence from being misinterpreted as data, it should comply to following sequence:
  • Do not input any character within T1 time (1000ms) before inputting “+++”.
  • Input “+++” within 1000ms, and no other characters can be inputted during this time.
  • Do not input any character within T1 time (1000ms) after “+++” has been inputted.
  • Switch to command mode, otherwise return to step 1.
  1. To return from command mode back to data mode: Enter ATO
  • Another way to change to command mode is through DTR, refer to AT&D command for details.