PPP with CellularRadio fails to connect for some modems

Some of you may be looking to use the PPP driver now that it works with other modems and may still not get a connection. I tracked this down to the CONNECT string. The SIM900 that the existing driver was developed for just sends CONNECT but other modems send CONNECT 115200 or with other baudrate. There is no way to pass in this string to the driver so you will need to get hold of the driver source and modify this and use it with your development.


public void UseThisNetworkInterface(string apn, string username, string password, PPPSerialModem.AuthenticationType authenticationType) {
    if (apn == null) throw new ArgumentNullException("apn");

    this.UseThisNetworkInterface(username, password, authenticationType, "CONNECT 115200", "AT+CGDCONT=1,\"IP\",\"" + apn + "\"", "ATDT*99***1#");
}

Or you can change the code in DoWork to this and only detect the CONNECT part of the response.


if (response.Substring(0, 7) == this.pppExpectedResponse)
    this.pppEvent.Set();


Actually, you need this as it just gave an exception when the string is too short.


if (response.Length > 7)
{
    if (response.Substring(0, 7) == this.pppExpectedResponse)
        this.pppEvent.Set();
}

I am finding quite a few issues with the PPP handling in the CellularRadio driver.

For one, if the GPRS network drops the PPP connection, any calls to the driver to reconnect fail as it returns because the driver is still open. It does not account for the link being down and just returns instead of closing it and make a new connection.

I think this was an issue that some had with it not being able to reconnect?

I am working on fixing this will and will post the changes once I have it sorted.

2 Likes

I did not have a chance to test it, but I guess @ John will be looking at this soon, as he has the driver in his short term memory… :whistle:

Quite a bit of work today and some tinkering with commands etc and at one point it would no reconnect after a disconnect throwing an error when you try to ATD99**1# after the last drop.

I found that I needed to send ATZ and then init again all the commands. After doing this, the modem will reconnect sometimes but certainly more often that before.

I am slowly getting there but some way to go as there are still some issues that are causing it to not always connect on the second attempt.

Great news Niels, I now have a rock solid (so far) PPP connection driver using a modified version of the CellularRadio driver. I’ve had to do a lot of work and make a lot of changes. I’ve just done 6 connects and disconnects in a row without a hitch. There are a lot of issues in the existing driver and I have contacted John to advise that I will send the file for them to update the Gadgeteer version. I don’t use Gadgeteer so they will have to integrate into that. :slight_smile:

If there are no issues in posting the Pure NETMF version I am working on, I will see about posting in codeshare. Will confirm with GHI on this first.

This has come about at the right time and now I have a way forward for remote monitoring solution using NETMF and GHI.

1 Like

@ Dave McLaughlin - This sounds terrific, actually I am really happy about your effort. Well done. I am looking forward to take it for a spin. What version of the cellular driver did you begin with, and what modem are you using? :smiley: :smiley: :smiley: :smiley: :smiley: :smiley:

Don’t know version but working with the 4.3 build.

I am using with a SIM5320E just now. A 3G and quad band modem. It is connected with HSDPA right now as I am testing :slight_smile:

I have your email so I will send you a version to play with next week when I finish testing.

I am going to strip out all off the TCP AT command stuff as this will be no longer required now that we have a working PPP. I may leave it in but a slimline driver would be nicer for me at least.

1 Like

@ Dave McLaughlin - Sounds good. I am NOT sure about ripping out the TCP AT stuff, as the G30 does not support PPP nor Gadgeteer, and I have plans to use that for an experiment… Maybe split into two?

I think is better to split into a PPP and TCP driver. This way you don’t have all of the PPP stuff when you want to use just TCP.

I have a AT command TCP system in the field but it is cumbersome to use and generally only 1 connection at a time. With the real PPP you can go and download a file whilst the other TCP stuff is also doing it’s thing.