botletics / SIM7000-LTE-Shield

Botletics SIM7000 LTE CAT-M1/NB-IoT Shield for Arduino
https://www.botletics.com/products/sim7000-shield
GNU General Public License v3.0
477 stars 215 forks source link

Commands echo back instead of OK #57

Closed supersjimmie closed 5 years ago

supersjimmie commented 5 years ago

At several different point, sometimes the program goes into a loop, because the sim7000 starts to repeat the commands instead of replying with OK.

This happens at more places, during GPS, during Connect to cell, and more. Looks like:

Failed to get GPS location, retrying...
    ---> AT+CGNSINF
    <--- AT+CGNSINF
Failed to get GPS location, retrying...
    ---> AT+CGNSINF
    <--- AT+CGNSINF

Or:

Failed to connect to cell network, retrying...
    ---> AT+CGREG?
    <--- AT+CGREG?
Network status 0: Not registered
Failed to connect to cell network, retrying...
    ---> AT+CGREG?
    <--- AT+CGREG?

I tried to flush the fonaSS, send an extra AT, wait a while, I cannot find why and I cannot find how to get out of this strange state...

botletics commented 5 years ago

Did you set ATE1 which enables echo? For example, if you were trying to send AT commands via USB and set ATE1 so that you can see the stuff you're typing.

botletics commented 5 years ago

To disable echo, set ATE0 which should also be set during module initialization in the LTE_Demo code.

supersjimmie commented 5 years ago

Yes it does ATE0 at the beginning. Here's some more:

Attempting to open comm with ATs
    ---> AT
    <--- OK
    ---> ATE0
    <--- OK
    ---> ATE0
    <--- OK
    ---> ATI
    <--- SIM7000E R1351

OK

    ---> AT+CPMS="SM","SM","SM"
    <--- +CPMS: 0,0,0,0,0,0
FONA is OK
Found SIM7000E (European)
    ---> AT+GSN
    <--- 8652340xxxx
Module IMEI: 8652340xxxx
    ---> AT+CFUN=1
    <--- OK
    ---> AT+CGDCONT=1,"IP","cdp.iot.t-mobile.nl"
    <--- OK
    ---> AT+CGREG?
    <--- +CGREG: 0,5
Network status 5: Registered roaming
Connected to cell network!
    ---> AT+CGNSPWR=1
    <--- OK
Turned on GPS!
    ---> AT+CGNSINF
    <--- 
Failed to get GPS location, retrying...
    ---> AT+CGNSINF
    <--- +CFUN: 1
Failed to get GPS location, retrying...
    ---> AT+CGNSINF
    <--- AT+CGNSINF
Failed to get GPS location, retrying...
    ---> AT+CGNSINF
    <--- AT+CGNSINF

As you can see, there is also a strange thing happening here:

---> AT+CGNSINF
    <--- +CFUN: 1

Like it comes back with something from an earlier command. Then it starts to malfunction...

botletics commented 5 years ago

Looks like your shield is powering off. Messages like "+CFUN: 1" are usually displayed shortly after it boots up, and another piece of evidence is that you get an empty response from "AT+CGNSINF". Please make sure you are using a 3.7V LiPo battery with the shield.

EDIT: Also make sure battery polarity is correct. Some batteries have the wires reversed and may still work when you have the shield plugged into an Arduino, but only partially, and will act up.

supersjimmie commented 5 years ago

I have a newer version of the shield, it lacks things like the PWR push button and also the possibility to add the LiPo. When I asked them about it, Waveshare told me that I don't need that.... (looking at the PCB, there is no regulator for the LiPo too)

It works fine about 9 out of 10 times.

botletics commented 5 years ago

Newer version? The newest version of the Botletics SIM7000 shield has a LiPo battery connector. If you're using something else then sorry, I don't know.

botletics commented 5 years ago

Sounds like Waveshare didn't fully test their product then. From what you're experiencing, the module is definitely shutting down. If there's a power indicator LED you should be able to see it turn off. Also, try enabling GPS; this will probably make it even more likely for the module to shut off because GPS draws another 30mA of current.

supersjimmie commented 5 years ago

LOL, they've also changed the Power-LED. It's always on, regardless of the actual state of the module... (they also changed the PWR-pin behavior, but I am able to do the power down, while the LED stays on) I guess the only way to save some extra current during power down, is to kick that LED off the PCB... They only way so actually see the power down is via the current draw and the activity LED that really stops blinking. (and the module stops accepting AT commands when I test it)

There is a large 1000uF capacitor on the board, which they say should fix it. I will try to add an additional tantalum capacitor, which is also very helpful with power-peaking modules likes esp8266's. (tantal's are better for this kind of stabilization)

But just to clarify things a little bit, this is actually not exactly the arduino shield that you use, it's really a module made for the raspberry pi. It's had the same features (like the powerbutton) in the recent past, but because some people had trouble powering it on, they decided to change it. I had very recent contact with them by e-mail about several of those changes and some issues with the B05 firmware. They just keep saying that "The SIM7000E is updated", every time I complain.

botletics commented 5 years ago

Yea I understand you're using the Waveshare Raspberry Pi HAT instead of the shield I created (the Botletics one). Sorry, not much I can do to help there lol. I'm a firm believer that product support should come from the people selling it :)

supersjimmie commented 5 years ago

Sure, now we know that it's caused by the lack of lipo support, it's up to the sellers. But you helped me a lot by finding out that the device was restarting, before that I had no clue...

Fredovsky commented 5 years ago

@supersjimmie did you manage to solve/identify the issue ? I got the exact same problem, AT response is either : empty; echoes the command; or rarely I have the odd +CFUN: 1. I'm powering up through a separate supply able to handle high load so I don't think power is an issue here.

I know this is not related to Botletics as I'm using the Waveshare piHat board, but curious if others have resolved this problem.

Thanks

supersjimmie commented 5 years ago

@supersjimmie did you manage to solve/identify the issue ? I got the exact same problem, AT response is either : empty; echoes the command; or rarely I have the odd +CFUN: 1. I'm powering up through a separate supply able to handle high load so I don't think power is an issue here.

I know this is not related to Botletics as I'm using the Waveshare piHat board, but curious if others have resolved this problem.

Thanks

@Fredovsky After a lot of mails, I got the message that "the engineer went on holiday", then nothing... That was about a month ago. I think I will send them a mail to ask if the engineer ever came back.

supersjimmie commented 5 years ago

@Fredovsky they now replied that it is solved in firmware: https://www.waveshare.com/wiki/File:1351B06SIM7000E.rar But I told them last december that I already use that. Perhaps you can check to be sure?

AT+GMR
Revision:1351B06SIM7000E

OK
Fredovsky commented 5 years ago

Thanks I'll try again next week if I can flash the new firmware but last I tried the QPST tool was returning a "DUT 1" (not sure) error. I'll let you know ! Thanks.

Fredovsky commented 5 years ago

Ok so I updated to the B06 firmware. Problem remains the same. I noticed I don't have any problems when I type the AT commands manually through serial on the Sim7000 USB port (using Putty for exemple).

When using the Arduino and the Fona library, it starts echoing or giving blank replies after 5 or 6 commands...

botletics commented 5 years ago

Mhmm sorry I'm not sure what is happening. It should find it and communicate right away.