UIFlow and CAT M MODULE SIM7080G
@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_catmmodule 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
catmunit for my testing - the
iot_base_catmmodule is ordered and it is on its way.
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.
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.
teiafra last edited by teiafra
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
- 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 :-(
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 statuscommand multiple times.
we found a sequence which is almost working. See picture.
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.
- 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)
- 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)
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.
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
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.
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.
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.
thank you for letting me know. I am glad you found a workable solution.