Entering to CMUX mode & enable Remote Sim using python script

7 thoughts on “Entering to CMUX mode & enable Remote Sim using python script

  1. Hello!

    I want to write a python script witch will be loaded to a module(GL865 QUAD) and each time during start up script  will do initialization procedure. Script must do next: send at commands to AT channel to enter to CMUX mode(ATE0V1&K3&D2, AT+IPR=57600, AT#CMUXMODE=1, AT+CMUX=0) , then enable remote sim on cmux VP1.

    Finally my application must work with ASC0 physical port with cmux virtual port 0(at channel) and with cmux VP1(remote sim).


    Is it possibly to realize? Can you
    give me some tips about realization?


    Thank you! 


  2. In document "Easy Script in Python" in chapter "CMUX and Python" is written:

    …it possible to run a Python script and at the same time use CMUX on ASC0 with the 

    following channels division: 

    it possible to run a Python script and at the same time use CMUX on ASC0 with the 

    following channels division: 

    •  The first CMUX port is reserved for SER module;

    •  The second CMUX port is available for AT command handling in case of MDM2 

    built-in module not being imported;

    •  The third CMUX port is available for AT command handling;

    •  The fourth CMUX port is used for debug (print statements); 


    So, to
    realize described goal I can do next:

    –  send AT#CMUXSCR = 2,

    this CMUX will  be enabled during start up(but I am not sure
    about some configurations: N1 – in AT+CMUX, it will probably not be
    run with previous set – N1 for AT+CMUX).

    then cmux will be a default option, during module start up the python script(wich was loaded earlier) will set up the 2-ond cmux virual port(through MDM2) as
    Remote Sim channel(send RSEN AT command).

    the third cmux virtual port will be used as at channel.


    the problem is  follow, the 2-ond cmux virual port after
    configuration through python script then must be switched to be used through ASC0 as
    remote Sim Channel but not through (MDM2). 

    it possibly to do or 
    are there some  other variants?


  3. Or
    another way.

    module start up, script will execute(AT#STARTMODESCR=2) – "import
    MDM", so python MDM will be use :

    Instance # 1" – MDM/VHWDTE0(Access Point) ,

    as shown in "Virtual
    Serial Device Application Note" and at that time AT command
    interface will be available on serial port ASC0 and connected to
    third AT parser instance. 


    Then the script execute next AT commands: ATE0V1&K3&D2,
    AT+IPR=57600, AT#CMUXMODE=1, AT+CMUX=0.  


    What will be
    after AT+CMUX=0 command? Such connection sheme will be as is
    shown in document "Easy Script in Python" in chapter "CMUX
    and Python"?(one post 


    such sheme witch is shown in  "Telit’s CMUX
    Implementation User Guide":

    Instance #1 – ASC0/VC1 

    Instance #2 – ASC0/VC2

    Instance #3 – ASC0/VC3

    – ASC0/VC4  

    MDM will connected at the same time with AT0 Instance #1?

    1. Before to investigate about the feasibility of your proposal, if you need to exchange data with the SIM using the CMUX channel with Python, you have to consider that the python has the lowest priority of the tasks, as written in the Easy script in Python user guide. That means that a GSM or GPRS task has to be done, the Python task is stopped and if you need exchange in real time data with your SIM, this is not possible in Python

  4. Python priority isn’t important for my task, because I want to use Python script just once during module starting up, for initial module configuration(it will send just a few AT commands).

    During module start up a  Python script must do the next:

    – enable CMUX;

    – enable RemoteSim on CMUX channel(AT#RSEN);


    Then script do nothing. Script must just enable CMUX and SAP(send appropriate at commands).

    After module starts up and the script enables CMUX & SAP Client then my application starts works through ASC0 with cmux VP 0(AT channel) and with cmux VP 1(2)  for SAP Client. 

     if you need to exchange data with the SIM using the CMUX channel with Python   

     I don’t need it, my application will exchange data with  cmux VP 0(AT channel) ,  cmux VP 1(2)(SAP Client )  through ASC0.

    And now I am trying to undestand if it’s possible to enable CMUX & SAP Client  using Python script during module starting up and then using my application as SAP Server without Python script through ASC0 .
    Can you give me some recommendation about it? 
  5. I started testing. I used  ‘LAB Scenario‘ which is pointed in:
    Virtual Serial Device  Application Note(2.3.1.Python Service vs. GPS).
    I did the next chain of actions:
    • load python script;
    • turned ON the module
    • then after script started up(CMUX service is started – AT+CMUX=0 command is simulated) and script executed  then my application started to work with CMUX VP3(AT INSTANCE 3). But when my application sent through ASC0 cmux command to the 3-rd virtual channel – OPEN CMUX chennel 3 – nothing was received. But when I sent any AT command without CMUX format before using the 3-rd virtual channel in CMUX format, all is ok. I received UA frame.
     Why it happens?
    I tried to do delay before using CMUX(VP3) instead of any AT command but nothing. 
    I would like to start use CMUX  without any auxiliary AT commands   after  CMUX service is started (AT#CMUXSCR=1).
    1. No, it’s not feasible what you wish to do with this platform.

      2.3.1.Python Service vs. GPS paragraph is related to explain hot to debug Python on GPS products.