Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot stop GPS session via AT commands #105

Open
PsySc0rpi0n opened this issue Oct 1, 2024 · 11 comments
Open

Cannot stop GPS session via AT commands #105

PsySc0rpi0n opened this issue Oct 1, 2024 · 11 comments

Comments

@PsySc0rpi0n
Copy link

Hello.

I'm using the example code from here and after the device is ready to take AT commands, it seems that I cannot stop the GPS session.

This is what I get:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1448
load:0x40078000,len:14844
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3356
entry 0x4008059c

# Startup #
# Sending "AT" to Modem. Waiting for Response
# .
# Response:
AT
OK
#

***********************************************************
 You can now send AT commands
 Enter "AT" (without quotes), and you should see "OK"
 If it doesn't work, select "Both NL & CR" in Serial Monitor
 DISCLAIMER: Entering AT commands without knowing what they do
 can have undesired consequences...
***********************************************************

AT+CGPS?
+CGPS: 1,1

OK
AT+CGPS=0,1
OK
AT+CGPS?
+CGPS: 1,1

OK
AT
OK
AT+CGPS?
+CGPS: 1,1

OK
AT+CGPS=0,1
OK
AT+CGPS?
+CGPS: 1,1

OK
AT+CGPS=0
OK
AT+CGPS?
+CGPS: 1,1

OK
AT+CGPS?
+CGPS: 1,1

OK

So, for some reason I cannot get the GPS session to stop. Why is this? Any common reason?

@TexeCode07
Copy link

i see similar result in case i respond before its 2s result :
AT+CGPS?
+CGPS: 0,1
OK
AT+CGPS=1
OK
AT+CGPS?
+CGPS: 1,1
--------if respond fast
AT+CGPS?
+CGPS: 1,1
OK
AT+CGPS=0 --- This Put
OK
AT+CGPS?
+CGPS: 1,1 ---- wrong result as respond before 2s
OK
+CGPS: 0 ---- prev command response i think
AT+CGPS?
+CGPS: 0,1 ---- now it works..

in AT Command module note:
After the GPS closed, it should to wait about 2s~30s for start again. Reason: If the signal
conditions are right (strong enough signals to allow ephemeris demodulation) or ephemeris
demodulation is on going, sometimes MGP will stay on longer in order to demodulate more
ephemeris. This will help the engine provide faster TTFF and possibly better yield later (up to 2
hours), because it has the benefit of more ephemeris available.
https://m2msupport.net/m2msupport/atcgps-start-stop-gps-session/

@PsySc0rpi0n
Copy link
Author

Yes, I also read about that note. But I also tried to wait longer than that period of time and it was still not working. So, I issued a AT+CFUN command to restart the modem, and after that I was able to start/stop GPS sessions almost freely! Like almost immediately one after the other! So, I have no idea what was keeping the GPS session stuck.
I'l still leave this issue open so that we can still discuss about it in the next days, if needed!

@PsySc0rpi0n
Copy link
Author

As a side note, I did something like this to wait for the modem response before issuing new AT command:

bool sendATCommand (const char* command, const char* expectedResponse,
                   unsigned long timeout){
    SerialAT.println (command);
    unsigned long startTime = millis();

    String response = "";
    while (millis() - startTime < timeout){
        while (SerialAT.available()){
            char c = SerialAT.read();
            response += c;
            if (response.indexOf(expectedResponse) != -1){
                Serial.print("Response: "), Serial.println(response);
                return true;
            }
        }
    }
    Serial.println("Timeout for response...");
    return false;
}

@lewisxhe
Copy link
Contributor

lewisxhe commented Oct 4, 2024

Give me the label on the modem and I will determine the hardware version and then test it. @PsySc0rpi0n

@PsySc0rpi0n
Copy link
Author

Give me the label on the modem and I will determine the hardware version and then test it. @PsySc0rpi0n

photo_5778576513778697112_y

@lewisxhe
Copy link
Contributor

@PsySc0rpi0n Send AT+SIMCOMATI to see what software version is returned.
Please power on again, use ATDebug, and tell me how to reproduce this problem

@PsySc0rpi0n
Copy link
Author

PsySc0rpi0n commented Oct 10, 2024

@PsySc0rpi0n Send AT+SIMCOMATI to see what software version is returned. Please power on again, use ATDebug, and tell me how to reproduce this problem

AT+SIMCOMATI
Manufacturer: SIMCOM INCORPORATED
Model: SIMCOM_SIM7600G-H
Revision: LE20B04SIM7600G22
QCN: 
IMEI: <hidden>
MEID: 
+GCAP: +CGSM
DeviceInfo: 173,170

OK

At this point I'm not being able to reproduce. Here is the current output, using ATDebug.ino from gituhb:

AT+GPS?
ERROR
AT+CGPS?
+CGPS: 1,1

OK
AT+CGPS=0
OK

+CGPS: 0
AT+CGPS?
+CGPS: 0,1

OK
AT+CGPS=1,1
OK
AT+CGPS?
+CGPS: 1,1

OK
AT+CGPS?
ERROR
AT+CGPS?
+CGPS: 1,1

OK
AT+CGPS?
+CGPS: 1,1

OK
AT+CGPS=0
OK

+CGPS: 0

In the meantime, I'll also keep an eye on this behaviour to see if I can catch it again, along the work I'm doing at this moment.

The only difference I notice from now and then is that back then, after the AT+CGPS=0 command an OK response and now I can see an additional +CGPS: 0 after the OK.

@lewisxhe
Copy link
Contributor

Please follow the upgrade guide to upgrade to the latest firmware before testing

@PsySc0rpi0n
Copy link
Author

Please follow the upgrade guide to upgrade to the latest firmware before testing

Is there a guide to upgrade the SIM7600G-H firmware on Linux (Debian Bookworm)?

@lewisxhe
Copy link
Contributor

Only Windows

@PsySc0rpi0n
Copy link
Author

PsySc0rpi0n commented Oct 11, 2024

I may have found a way to upload the firmware onto the device but I can't unrar the file you sent me.

I tried a bunch of possibilities:

$ 7z x ~/Documents/SmartBin/LE20B05SIM7600G22_240325.rar 

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_GB.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i5-1035G4 CPU @ 1.10GHz (706E5),ASM,AES-NI)

Scanning the drive for archives:
1 file, 83436126 bytes (80 MiB)           

Extracting archive: /home/carlos/Documents/SmartBin/LE20B05SIM7600G22_240325.rar
--
Path = /home/carlos/Documents/SmartBin/LE20B05SIM7600G22_240325.rar
Type = Rar5
Physical Size = 83436126
Solid = -
Blocks = 15
Encrypted = -
Multivolume = -
Volumes = 1

ERROR: Unsupported Method : LE20B05SIM7600G22_240325/appsboot.mbn
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/boot.img
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/contents.xml
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/ENPRG9x07.mbn
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/modem.img
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/NPRG9x07.mbn
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/partition.mbn
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/partition_nand.xml
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/recovery.img
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/recoveryfs.img
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/rpm.mbn
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/sbl1.mbn
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/system.img
ERROR: Unsupported Method : LE20B05SIM7600G22_240325/tz.mbn
                                      
Sub items Errors: 14

Archives with Errors: 1

Sub items Errors: 14
$ unrar x ~/Documents/SmartBin/LE20B05SIM7600G22_240325.rar 

unrar-free 0.1.3  Copyright (C) 2004  Ben Asselstine, Jeroen Dekkers


Extracting from /home/carlos/Documents/SmartBin/LE20B05SIM7600G22_240325.rar

Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  [�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
Extracting  c�p`                                                     Failed    
14 Failed
$ unrar-free x ~/Documents/SmartBin/LE20B05SIM7600G22_240325.rar 

unrar-free 0.1.3  Copyright (C) 2004  Ben Asselstine, Jeroen Dekkers


Extracting from /home/carlos/Documents/SmartBin/LE20B05SIM7600G22_240325.rar

Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
Extracting  �Q�V                                                     Failed    
14 Failed

Maybe it's my laptop. I'll try in a Windows laptop....

Edited;
Ok, I was able to decrompress the files in a Windows machine. But I still couldn't update the firmware! Somehow the tool I'm using is not recognizing the files format in the folder!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants