Has “soon” finally arrived? Yes it has and it did on both ends, ours and Microsoft’s. First, let us introduce you to NETMF-PPP support. With today’s release you will now be able to use the network over PPP (Point to Point Protocol) to establish a connection to a mobile cellular network, right from your NETMF device, and using standard .NET sockets. Besides PPP, the SDK covers some small issues, like supporting virtual machines and improvements on the newly introduced Cerb-family USB Host. This SDK package is also optimized for a better user experience and it is a lot smaller in size! There are new NETMF and Gadgeteer SDK releases to support VS2013, with alpha support for VS2014. Those releases are still in beta so they are not part of our SDK shipping today, just yet.
We want to take this opportunity to thank all of you for your patience while we pulled all this together. The changes were major and difficult as explained in previous news posts, http://www.ghielectronics.com/community/forum/topic?id=16274
Other good news is that TinyBooter should be optional from now on, unless there is a major release or an unexpected deep issue that needs to be addressed. We will include a note with the release notes when TinyBooter is needed. What does this mean? No need to run the device in any special mode to update the firmware, just open MFDeploy (or our FEZ Config), select the new firmware and click deploy! No buttons to press and no switches to move! But how is it optional? For example, this SDK includes the same TinyBooter for G120, EMX and Cerb-family as the last release. For G400 and Hydra, there is a small update to support VM (virtual machines). If you are not using a VM, there is no need to update TinyBooter…enjoy!
edit
How do I start with PPP to connect my device to a mobile network?
First you need one of our supported devices (G120, EMX, G400) and a PPP modem. We recommend our cellular modem, http://www.ghielectronics.com/catalog/product/322 If using a Gadgeteer mainboard, just plug the modem in. If not, wire it using the breakout module. Please also note that currently the Seeed Cellular Radio Module does not support PPP through the Gadgeteer driver, it is only supported through pure NETMF. However, this is something that we will be providing in a future release. Here is a minimal code example showing the connection, easy!
using GHI.Networking;
using Microsoft.SPOT;
using Microsoft.SPOT.Net.NetworkInformation;
using System.IO.Ports;
using System.Net;
using System.Text;
using System.Threading;
public class Program
{
public static void Main()
{
NetworkChange.NetworkAvailabilityChanged += NetworkChange_NetworkAvailabilityChanged;
NetworkChange.NetworkAddressChanged += NetworkChange_NetworkAddressChanged;
var port = new SerialPort("COM2", 115200, Parity.None, 8, StopBits.One);
port.Open();
//Your initialization AT commands may differ.
SendAT(port, "AT+CGDCONT=2,\"IP\",\"your APN\"");
SendAT(port, "ATDT*99***2#");
var netif = new PPPSerialModem(port);
netif.Open();
netif.Connect(PPPSerialModem.AuthenticationType.Pap, "", ""); //This differs based on your SIM card.
//Network ready once NetworkAvailabilityChanged and NetworkAddressChanged fire (this may take up to a minute depending on your board/SIM).
Thread.Sleep(-1);
}
private static void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
{
Debug.Print("Network address changed.");
}
private static void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e)
{
Debug.Print("Network availability changed: " + e.IsAvailable.ToString());
if (e.IsAvailable)
{
Debug.Print(Dns.GetHostEntry("bing.com").AddressList[0].ToString());
}
}
private static void SendAT(SerialPort port, string command)
{
var sendBuffer = Encoding.UTF8.GetBytes(command + "\r");
var readBuffer = new byte[256];
var read = 0;
port.Write(sendBuffer, 0, sendBuffer.Length);
while (true)
{
read += port.Read(readBuffer, read, readBuffer.Length - read);
var response = new string(Encoding.UTF8.GetChars(readBuffer, 0, read));
if (response.IndexOf("OK") != -1 || response.IndexOf("CONNECT") != -1)
break;
}
}
}
What’s Next?
As many of you know by now, there has been a renewed focus on IoT and NETMF from Microsoft. Microsoft has recently released a new website, VS2013 support, alpha VS2014 support and a new Gadgeteer release to work with the new NETMF release. The next step for GHI Electronics is to release a beta SDK taking advantage of the VS2013 and VS2014 support. That and concentrating on improving networking, which is something that Microsoft and GHI Electronics are currently working on.
As always, we would like to thank our community and customers for their loyalty and support throughout the years.
NETMF and Gadgeteer package 2014 R4: http://www.ghielectronics.com/support/netmf/sdk/23/netmf-and-gadgeteer-package-2014-r4