🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    UIFlow and CAT M MODULE SIM7080G

    UIFlow
    3
    14
    13.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • felmueF
      felmue
      last edited by

      Hello @Rob-Dor

      my tests confirm that after waking up SIM7080 from PSM with the PWRKEY and without disabling PSM, the modem eventually drops back into PSM. So yes, in this case all further AT command are ignored.

      So after waking the modem send AT+CPSMS=0 to disable PSM, send MQTT messages etc. and when you're done, enable PSM again.

      BTW: you should see the LED on the modem blinking slowly while not in PSM. And the LED should be off during PSM.

      Thanks
      Felix

      GPIO translation table M5Stack / M5Core2
      Information about various M5Stack products.
      Code examples

      T 1 Reply Last reply Reply Quote 0
      • R
        Rob.Dor
        last edited by

        Hi @felmue,
        thanks for your answer, could you please share the code you used? Because I cannot wake up the modem in any way so I think I'm wronging something or if you prefer I can share my code and you have a look at it
        Regards,
        Roberto

        1 Reply Last reply Reply Quote 0
        • T
          teiafra @felmue
          last edited by

          @felmue
          Thanks, this is teiafra, teammate of Rob.Dor. Please note that we're using this module https://docs.m5stack.com/en/base/iot_base_catm?ref=langship which does not show any kind of LED or light to our eyes

          1 Reply Last reply Reply Quote 0
          • felmueF
            felmue
            last edited by

            Hello guys

            @Rob-Dor : sure, I'll have a look. If possible, can you reduce your code to the minimum showing the issue? Thanks

            @teiafra : you are correct, the iot_base_catm module doesn't have an LED on the NETLIGHT output (which is a shame).

            However it does have a red LED for the STATUS output which can also be used as indicator.

            • STATUS LED on : modem is powered and on
            • STATUS LED off : modem is either off or in PSM mode

            Can you confirm that the red STATUS LED is on when the modem is powered on and off when it is in PSM mode?

            Note: I am using a modified catm unit for my testing - the iot_base_catm module is ordered and it is on its way.

            Thanks
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            T 1 Reply Last reply Reply Quote 0
            • T
              teiafra @felmue
              last edited by

              @felmue
              I confirm that iot_base_catm module contains a red led as you said: thanks!
              Indeed this is reported in the schematic and the led is connected to the STATUS pin.
              BUT it is not visible at all from outside and to see it you need to remove the Guide rail mount base plate and "spy" through the hole close to the antenna's connector: that's not confortable. See photo.
              We'll let you know if it behaves with PSM toggle, as you suggested.

              0_1665733414057_LED_STATUS_Capture.JPG

              1 Reply Last reply Reply Quote 0
              • felmueF
                felmue
                last edited by

                Hello @teiafra

                thank you for sharing. I wasn't aware that the STATUS LED is practically hidden. I guess I'll have to modify my CatM IoT base when it arrives. I probably will also add the NETLIGHT LED which is very useful to know in which state the modem is.

                Thanks
                Felix

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

                1 Reply Last reply Reply Quote 0
                • T
                  teiafra
                  last edited by teiafra

                  Hello @felmue
                  we confirm that that STATUS led is

                  • ON when module is active
                  • OFF when module is either off or during PSM sleeping time

                  Looking at that led when PIN 12 is toggled to get the module to wake up we noticed
                  0_1665995954193_13c74bcd-420c-4d9f-8540-431c250928ac-image.png

                  • HIGH then LOW: the led switches from off to on firmly
                  • LOW then HIGH: the led switches on but then goes off or blinks very slowly

                  Could you confirm us which of the two sequences is the right order?
                  Simcom says that the PWRKEY should be pulled low then up again, but we understood there is an inverter in between PWRKEY and GPIO12, so the logic to apply is flipped. Thus we guess the "HIGH then LOW" was good and indeed the led stays on.
                  If you do the opposite pulses the module would reset and we supposed that the LED bliking means that.
                  However the last "check module status" instruction return always False, as if the module stays down even if the led light is on. In addtion wherever we put the CPSMS=0 (before or after the two pulses) it seems that the content in the UART is ignored

                  We're now halted :-(

                  1 Reply Last reply Reply Quote 0
                  • felmueF
                    felmue
                    last edited by

                    Hello @teiafra

                    from the schematic I understand that the PWRKEY logic is inverted, so in my opinion the correct sequence is HIGH then LOW. (And the status LED being firmly on seems to confirm that.)

                    In my experience the first AT command after the modem wakes up from PSM sleep is always ignored / lost. Try issuing the Check module status command multiple times.

                    Thanks
                    Felix

                    GPIO translation table M5Stack / M5Core2
                    Information about various M5Stack products.
                    Code examples

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      teiafra @felmue
                      last edited by

                      @felmue
                      we found a sequence which is almost working. See picture.
                      0_1666172262943_5a51e2dd-6fab-49eb-8e75-9aedd66f8073-image.png
                      The right toggle is indeed from HiGH to LOW and should last not less than 1s nor longer than 12s ( the latter will force a reset). We used 5s.
                      According to the SIMCOM 7080G Hardware integration Guide the UART should be active after 1.8s from the first HIGH pulse.
                      Then the code checks iteratively the module status, which becomes True after 3 more seconds (according to the timer put in between and printed out).
                      At this stage we are pretty confident the UART is up & running and activate the connection and check IP address. Both UART reading are successful (connection setup and IP address returned).
                      NOTE: we saw that the very first AT command after wake up is caught with those timings above.

                      FAILURES:

                      1. there is not way to catch the unsolicited "EXIT PSM" message from the UART. We are able to catch +CPSMSTATUS: ENTER PSM (URC was enabled in advance with AT+CPSMSTATUS=1) at any try but never ever to get EXIT PSM (UART remains empty)
                      2. In addition, although the module gained again IP connectivity any attempt to move MQTT or HTTP traffic fails (the MQTT client of the new IoT Base CAT-M palette crashes, while perfectly work with no PSM at all)
                      1 Reply Last reply Reply Quote 0
                      • T
                        teiafra
                        last edited by

                        @felmue
                        I tried to implement a loop that scans the UART until there is some content and in this case decode it and print it out. See screenshot.
                        0_1666188441334_466fd72f-47d5-48de-9eff-9850985d5c21-image.png
                        Well, I put it soon after the wake up pulse sequence to catch the URC EXIT PSM. Nothing: label0 stamps "Empty UART" all the time and instead the "PSM_State" label never assumes "EXIT PSM" string.
                        I'm going to give up

                        1 Reply Last reply Reply Quote 0
                        • felmueF
                          felmue
                          last edited by

                          Hello @teiafra

                          please find my UiFlow implementation here.

                          • button A : wake the module from PSM
                          • button B : send AT
                          • button C : put module to PSM

                          BTW: my IoT Base has arrived and I've added an LED to the NETLIGHT output. See here.

                          Thanks
                          Felix

                          GPIO translation table M5Stack / M5Core2
                          Information about various M5Stack products.
                          Code examples

                          T 1 Reply Last reply Reply Quote 0
                          • T
                            teiafra @felmue
                            last edited by

                            Hi @felmue and many thanks: we'll have look.
                            From our side, good news. M5Stack guys gave us the tip to set ECHO OFF once the module is resumed from the sleep, so soon after PWRKEY sequence, our code checks module status and then set echo off.
                            0_1666679066256_e3bfac61-4206-487a-930f-5aaf52099931-image.png
                            In this way we're able to launch the MQTT client (provided with the new IoT Base CAT-M palette) and publish a topic.

                            We were not able to catch the "EXIT PSM" URC. We noted however that if the code invoked earlier the "network active" brick the URC shows +APP PDP DEACTIVE (we guess that TCP sockets are closed as well as any protocol layer above IP is terminated) while if the code never invoked "network active" before the PSM then we catch "ENTER PSM" URC.

                            At this stage our investigation around PSM is pretty satisfactory of the results achieved.
                            We'll keep you updated about any further progress.
                            Thanks!!

                            1 Reply Last reply Reply Quote 0
                            • felmueF
                              felmue
                              last edited by

                              Hello @teiafra

                              thank you for letting me know. I am glad you found a workable solution.

                              Thanks
                              Felix

                              GPIO translation table M5Stack / M5Core2
                              Information about various M5Stack products.
                              Code examples

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post