SIM7020 - Error during execution of AT+CHTTPCON (based on example)

1.1k Views Asked by At

I have ordered a SIM7020 NB-IoT HAT from waveshare and I try to open an HTTP connection by using the example from the wiki.

I use the following AT commands to connect the device with the NB-IoT network:

AT+CFUN=0
AT*MCGDEFCONT="IP","iot.1nce.net"
AT+CFUN=1
AT+CBAND=8
AT+COPS=1,2,"26201"
AT+CIPPING="61.135.169.121"

The command AT+CSQ is answered with +CSQ: 9,0 so a network signal is available. I also checked the online status of the SIM card in the online portal from my SIM card provider and the card is displayed as online.

Now I use the following commands from the wiki to open a connection:

AT+CHTTPCREATE="https://www.waveshare.com/"
+CHTTPCREATE: 0

OK

AT+CHTTPCON=0
ERROR

What is wrong here? How can I figure out the issue?

Update

Enabling error messages doesn´t give any additional information.

OK
AT+CHTTPCON=0
ERROR

I have also added the output for CEREG:

AT+CEREG?
+CEREG: 0,5

Update 2

The SIM card is delivered by 1nce. The APN was delivered by 1nce (the SIM includes a small card with the APN).

The response for the ping is the following:

AT+CIPPING="61.135.169.121"
OK
+CIPPING: 1,61.135.169.121,5,40
+CIPPING: 2,61.135.169.121,5,40
+CIPPING: 3,61.135.169.121,7,40
+CIPPING: 4,61.135.169.121,5,40

The SIM is also marked as online in the portal

enter image description here

I also can not establish an MQTT connection:

AT+CHTTPCON=0
ERROR

So it looks like a general issue...

2

There are 2 best solutions below

0
On

AS the previews reasons already mentioned, the main issue is the nonexisting support for SNI.

I would recommend checking out the 1NCE Developer Hub. In the recipes section are examples of using the SIM7000G, which works very much in the same way and can be compared. You find all the recipes here: https://help.1nce.com/dev-hub/recipes and look for SIM7000G.

The example showing the full AT commands for an HTTP post should be helpful -> https://help.1nce.com/dev-hub/recipes/sim7000g-http-post The SIM7020 works with

0
On

I've investigated this hands on and the error appears at least when attempting TLS connection with Cloudflare based hosts using an SNI certificate (like www.waveshare.com).

Using the TLS commands instead of HTTP we can get an error code: -30592 - "A fatal alert message was received from our peer". There are many underlying reasons that can cause this, but no further information is given by the SIMCOM module. One possible reason and a very likely one, is a handshake failure. SNI is required by Cloudflare in TLS handshake. There's nothing about SNI in the 7020 manual. Manuals for 7000 and 7080 mention it and with those modules it needs to be explicitly enabled.

Based on this partial information I'm going to guess the answer to the question is that SIMCOM 7020 doesn't support SNI in a TLS handshake and therefore is not compatible with servers that require SNI to be present in the TLS handshake. TLS/HTTPS connections to non-SNI servers appear to work as expected.

I've sent an enquiry about this to SIMCOM and will update if I get a response.

Edit: The answer from SIMCOM to my query was

HI Sir

You could download the app note from our website

thanks

I chose not to follow up.