0

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...

Kampi
  • 1,798
  • 18
  • 26
  • 1
    You can start enabling verbose errors with `AT+CMEE=2` before the command that fails. You will hopefully get a descriptive error. Furthermore: what is the response of `AT+CEREG?` ? Is the PDP context active (I'm not sure it's required in this module)? – Roberto Caboni Nov 23 '21 at 19:14
  • Please take a look at my updated question – Kampi Nov 23 '21 at 19:20
  • Very strange (or very poorly implemented, as `ERROR` is usually returned in verbose mode only when the command is not supported at all). The response of `+CEREG?` means you are registered to the network... in roaming. Is it what you want? Furthermore: what SIM you are using? Is `"iot.1nce.net"` the APN of the operator it belongs? What is the response of the previous PING attempt? – Roberto Caboni Nov 23 '21 at 21:25
  • Please take a look at my updated question – Kampi Nov 24 '21 at 17:52

2 Answers2

0

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.

voneiden
  • 457
  • 4
  • 8
0

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