My expectation & question is: My expectation is to connect to the GCP IoT Core through GPRS. Somehow I get this certain message Command failed: AT+CGDCONT=1,âIPâ,âAPNâ. I canât connect to my GCP server as well.
You should first connect your GSM module to your computer, open a terminal emulator software, manually try the AT commands the module will use to connect, and once you know that works, then see why it doesnât work with your device.
Besides the tutorial, you should have the docs for your module.
If we assume your module is a commom one and will take commonly used AT commands, then the APN is usually an APN name, not the acronym APN itself. That is provided by your cell phone provider (Globe ?) somehow in their documentation. A useful workaround is to search the Internet and manually try on a terminal emulator the AT commands until the combination is successful.
The next thing to check is the dial command to go PPP.
PS: The library is expecting âREADYâ but it is seeing âEADYâ something might be wrong on your serial hardware, also.
I was able to get it to work using SIM800L module. When I am using the A9G module, the mgos_pppos.c:702 Command failed: AT+CGDCONT=1,âIPâ,âAPNâ is now gone but I am getting an error âError 6 (phase 0), reconnectâ. Do you have any idea what the error 6 phase 0 means or at least reference?
phase 0 may refer to the PPP session establishment, you can check that in lwIP forums (the TCP/IP stack in use, including PPP, is lwIP).
I donât recognize your dial command for PPP initiation and that is a probable cause. As I said, you should connect with a terminal, type commands manually, and check the module behaves as expected. There are many variations in the way each module will start a PPP session, and how to configure the module to carry that session data over the cellular network.
Here is the commands from the module documentation.
While these are the commands I sent to the module. The last 2 commands from the documentation was not included but I was able to get it to work.
.
When I try to use the Mongoose OS PPPoS library I get this error .
I still donât get why I am receiving EADY instead of READY. The baudrate is the same/correct.
The commands and APN seem to be fine, but I donât like that CONNECT alone, you should see a PPP handshake (some string of unreadable characters) unless your âserial toolâ is filtering that out.
I also donât like that âEADYâ when it is expecting âREADYâ nor its companion âproceeding anywayâ; but âŚ
Now, are you sure the library sends those commands ?
Can you the opposite process ? That is, connect to the processor (with the terminal emulator) and simulate the module responses
Ok was able to run the AT commands from the Mongoose OS PPPoS library. All seems fine however I got stucked after the ATD99**1# command. Seems like I having problem at sending PPPoS messages. I donât have an idea what PPP messages that Mongoose sends.
I would get an error from this part of the Mongoose library.
That is why I told you to check your hardware.
Long thin wires + âa serial resistor just in caseâ form an RC filter that may disrupt comms, sometimes just the first char in the row.
PPP is used to carry IP through the serial connection, you need to signal the module you want to establish a PPP session and that is usually done via some fancy ad hoc number you âdialâ.
If the number is correct and the module supports PPP, it starts sending the required frames to establish the session, that is HDLC and starts with the character 0x7E so you should usually see some â~â chars. The library should stay waiting for the HDLC initiation and then respond and establish the session.
I donât like not seeing anything after the dial command, that may not be the correct one, check your module docs. The command weâve used so far for PPP over GPRS has been ATD*99**#
I use a shorter version of the regular male to male pin. I donât have any electronics component added. I am just connecting the 2 modules (A9G and ESP32). The A9G module is powered by external 5V 2A power, while the ESP32 is powered through the micro USB. I also tried to reprogram the ESP32 just to echo the messages from the Serial of the A9G using the same setup. It was able to show +CPIN: READY message just as stated in the module. When I am using Mongoose OS demo project, I am only getting EADY.
Ok looks like I found out why it only shows EADY. The SIM800L returns +CPIN: READY, with a space before +CPIN, while A9G returns +CPIN:READY no space. I am starting to feel that this issue is more on the firmware of the A9G module.
EADY vs READY: then it is not a hw problem, the parser could be better.
PPP: to develop networking systems, sometimes you need to have some tools of the trade.
You should be able to sniff the serial port and decode the PPP frames and see what is going on. Try to initiate the PPP session from a client on a computer and sniff it with Wireshark.
Perhaps you can also raise a debug level somewhere and see some extra info on the logs, but I canât help you there.
Perhaps someone might be able to help on the lwIP forum
I was able to get it to work. I just changed the pppos settings from - ["pppos.user", ""] - ["pppos.pass", ""] to - ["pppos.user", " "] - ["pppos.pass", " "]. Just added space to the settings.. The no spaces works in SIM800L but not on A9G module. I am using the same SIM card. Thanks for the help.