G120 + SIM900 PPP + SSL error

Hi guys.

I’m trying to use the SIM900 ( with PPP ) module to create a SSL connection, but the request fails.
The code works fine when requesting a normal web page, but SSL seems to fail.
I’ve had a look at the SIM900 datasheet, and it seems to support SSL, so I must be missing something.
I have updated the SSL seed, and the code works fine using the ethernet ENC module - so it is specific to the PPP connection with the SIM900

I’m using the library from @ Dave McLaughlin to use the modem , and the firmware is 2016 pre-release

Below is a code snippet which illustrates the problem.

            string url = "https://httpbin.org/";
            using (var req = System.Net.HttpWebRequest.Create(url))
            {
                using (var res = req.GetResponse()) // throws exception
                {
                    Debug.Print("HTTP Response length: "
                      + res.ContentLength.ToString());
                }
            }

the exception:

The thread ‘’ (0x5) has exited with code 0 (0x0).
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (1) ####
#### Message:
#### Microsoft.SPOT.Net.SocketNative::getaddrinfo [IP: 0000] ####
#### System.Net.Dns::GetHostEntry [IP: 0008] ####
#### System.Net.HttpWebRequest::EstablishConnection [IP: 00e1] ####
#### System.Net.HttpWebRequest::SubmitRequest [IP: 0019] ####
#### System.Net.HttpWebRequest::GetResponse [IP: 000c] ####

I’m hoping somebody can point me in the right direction?

@ robert42 - Can you post a complete and minimal example that shows the issue? Ideally without any libraries except GHI.Networking.

Hi @ John

After doing some more testing, I have found it to be sporadic. once in a blue moon, it gets a result back.
I have read in the manual that flow control is necessary to ensure proper data transmission. I suspect this is my problem - flow control does not work in 2016 R1 for the G120, and i cant downgrade to 2015 SDK, because SSL does not work in 2015.

I will need to use a third party option for now…

@ robert42 - We have noticed in generally that network calls when using SSL can non-fatally fail. If you can an exception from a call, try it again. This usually occurs around read.

Can you more precise?

@ John, thanks for the suggestion - I will give that a shot.

@ njbuch, at this stage, until the next SDK release, my plan was to use an external 3G industrial router and the ethernetENC module from GHI.
Not as good as having it internal, but at least the show can go on :). They’re around $150 , so they are pricey, but not prohibitively so.

1 Like