Debug python script using CMUX on EVK2 problem

12 thoughts on “Debug python script using CMUX on EVK2 problem

  1. Hello,

     

    I am trying to use CMUX to debug python script. I am using Telit GE865 with EVK2 board on serial to usb converter. Using TelitSerialPortMux_32_3.0.0_TDK_2.0.27 on 32 bit Windows 7 professional with service pack 1.

     

    COM4 – is the port which is physically connected to the EVK-2.

    Then installed  TelitSerialPortMux and got four virtuals ports.

    COM9

    COM10

    COM11

    COM12

    Then referring “Telit_Easy_Script_Python_r13.pdf” guide enabled CMUX using following AT commands.

    AT#SSTRACE=0    (diabled SSC output)

    AT#CMUXSCR=1,115200

    AT#STARTMODESCR=1,10

     

    The problem is that there is no response of AT command using either virtual port(COM9/10/11/12) or main port(COM4). I used RSTERM, HyperTerminal, Teraterm but still AT commands does not respond when connected via any available ports.

     

    I have gone through Telit documents and other web search result articles but so far nothing helped to solve the issue.

    Any help and advice on the issue will be truly appreciated.

    Thanks in anticipation.

    1. If you don’t get an answer even from COM4 I suspect the serial to USB converter being the problem, or the EVK not starting?

      1. Hello,

        Thanks for your response. We have been using EVK2 for the last 1 year and was able to call EVK2 and revieve calls from EVK2, send/receive SMS, run AT commands including TCPATRUN commands. The problem with COM$ started after we installed  TelitSerialPortMux_32_3.0.0_TDK_2.0.27 SW on the PC where EVK2 is connected.

        I restarted the EVK2 several times and I see the STAT LED is blinking, still not able to get any AT Command response back. I am using rsterm to communicate with EVK2.

        Let me know how to proceed further on this issue.

         

        Thanks 

        1. Try to revert back to the situation with only the physical serial port, uninstalling the mux, make it work with this again; then proceed further, taking care of mux installation. Check communication through physical serial port without mux started, then with mux started.

          1. Hello,

            Here are the steps we tried to fix the issue.

            Procedure I

            1) Detach device from computer.

            2) Uninstall CMUX from the computer.

            3) Reattach the module.

            4) Open terminal emulator on main port and sent AT command.

            RESULT: AT command response not received

            Procedure II

            1) Detach device from computer.

            2) Uninstall CMUX from the computer.

            3) Switch off the module.

            4) Switch it on again after few seconds.

            5) Attach module with computer.

            6) Connect terminal emulator to main COM port and send AT command.

            RESULT: AT command response not received

            Procedure III

            1) Detach device from computer.

            2) Uninstall CMUX from the computer.

            3) Rest module using reset switch.

            4) Wait for few seconds and then connect terminal emulator to main COM port and send AT command.

            RESULT: AT command response not received

            So even though CMUX is not installed main COM port does not reply to AT command.

            It seems that resetting did not work due to CMUX setting stored directly on the NVM.

            To go back to previous state where AT commands were responding on main COM port without enabling CMUX a reset is required which also removes CMUX setting on NVM.

            How can we do this ?

          2. But you said you did reset in procedures above?

             Do you have a Python script enabled to start? It will start in 10 seconds, try an AT command, other than AT attention to disable its run.

          3. We did as you suggested.

            Restarted the module and tried to execute "AT+CMEE=2" command but there was no reply from the module.

            Reset the module and tried to execute "AT+CMEE=2" command but there was no reply from the module.

            Since both above approach did not fix the issue we decided to reflash the module with firmware upgrade. Here is what we did.

            1) Using XFP tool reflash the tool with firmware. We had 10.00.005 firmware present on the module so we downloaded same fimware bin file and reflashed it again.

            2) After reflashing opened main COM port(COM9) using RSTERM and executed AT commands. All the commands were responding properly.

            3) Then enabled CMUX withing the module.

                AT#CMUXSCR=1,115200

            4) Then installed CMUX software on the PC "TSPMux_32_3.0.0_TDK_2.0.27.msi".

            5) Configured it properly and got 4 virtual ports on the PC(COM12/13/14/15)

            6) After enabling and installing CMUX checked that AT commands are responding fine on the module using COM ports(COM9,COM12,COM13,COM14). COM15 did not respond to any AT commands.

            7) Since AT commands were working fine installed a python script using COM9 port with 115200 buadrate settings.

            8) Then changed script start mode from 0,10 to 1,15.

                AT#STARMODESCR=1,15

            9) Then restarted the module to check if script was executing fine.

                Print statements were not displayed on COM15.

                COM12,COM13,COM14 stopped responding to AT commands.

            10) Stopped CMUX software and opened main COM9 port.

                   AT commands were not responding on this port as well.

            It seems all above steps were correct but after installing and enabling python script AT commands stopped responding. What is wrong with above configuration.

          4. Is your script making use of SER module? Try to use the trick to print debug on SER instead of the normal pipe:

             

            import sys
            import SER

            class SERstdout:
                def __init__(self):
                    SER.set_speed("9600","8N1")
                def write(self,s):
                    SER.send(s)

            if(sys.platform != "win32"):       #
                sys.stdout = SERstdout()
                sys.stderr = SERstdout()
               
            while (1 == 1):
                print "Hellorn"

  2. Thanks for the reply Cosmin.

    Yes we are using SER. On our host device SER is connected to microcontroller and SER2 is connected to SE867-AGPS module. SER(ASC0) is used for communication between microcontroller and GE865 module. Using ASC0 microcontroller sends and receives data which is used within our application. This data is non-AT commands.

    This script did work fine on our EVK2 board.

    Before installing script start mode was set as following "AT#STARTMODESCR=2,50".

    The script executed fine and started printing "Hello" string on the rsterm window.

    But then it did not accept any AT commands thereafter.

    All at commands which used to delete or stop the execution of the script were not accepted.

    It seems once this script is executed ASC0 is only used for transmission from EVK2 board to PC.

    Also I checked the connection between EVK2 board and PC. It is done using USB HUB present on the EVK2 to USB port on the PC. So when ever it gets connected to PC we get 4 ports on the PC(COM8, COM9, COM10, COM11). We are trying to debug python script using this connection settings and activating CMUX. Applogize for the wrong information given earlier on the EVK2 to PC connection.

    So here is what we are trying to accomplish.

    1) Enable python script such that AT commands and script execution work side by side.

    2) Enable CMUX so that developed python script could be debug before moving script to our own host device.

    Please let us know if above functionality is possible with/without CMUX.

    1. CMUX will be helpful to debug application.

      Please let me know if you need more information on our setup which might help us to enable CMUX for testing.

    2. Hi Sujata,

      When you use the USB connector on the EVK2, that goes through a USB-to-serial conversion.  The 4 ports that are created from that USB connector are not all used.  The 2nd COM port is the same as the top serial connection on the EVK2 (main UART) and the 4th COM port is the same as the bottom serial connection on the EVK2 (AUX UART).  So, when setting up CMUX you need to point the main COM port to the 2nd COM port that was created this will allow CMUX access to the main UART of the module.

      We discourage developing in emulation mode, because there are too many differences with the Python behaviors of the Python engine in the module when compared to the Python emulator on a computer.  We suggest to debug Python code while running it on the module.