IoT Labs WiFi module now supports Websockets!

Just got this working, so I thought I would share! New SDK to be release soon.


using GTM = Gadgeteer.Modules;
using IotLabs.Gadgeteer;
using IotLabs.Net;
namespace WebSocketTest
{
	public partial class Program
	{
		private WebSocketServer _wss;
		void ProgramStarted()
		{
			_wifi.Connected += OnConnected;
			_wss = new WebSocketServer("IoTLabs");
			_wss.ClientConnected += OnClientConnected;
			_wss.ClientDisconnected += OnClientDisconnected;
			_wss.TextMessageReceived += OnTextMessageReceived;

			_wifi.Connect("SSID", "PASSWORD");
		}
		private void OnClientConnected(object sender, byte endpoint, string uri)
		{
			Debug.Print("Client (" + endpoint.ToString() + ") Connected at URI '" + uri + "'.");
		}
		private void OnTextMessageReceived(object sender, byte endpoint, string message)
		{
			Debug.Print(message);
			_wss.Broadcast("Echo - " + message);
		}
		private void OnClientDisconnected(object sender, byte endpoint)
		{
			Debug.Print("Client (" + endpoint.ToString() + ") Disconnected.");
		}
		void OnConnected(object sender, EventArgs e)
		{
			_wss.Start(_wifi);
		}
	}
}

12 Likes

Sweet! Good job!

Is the code open somewhere?

@ Architect - It will be available in a soon to be released update to the SDK.

1 Like

Nice job. Is this module for sale somewhere yet?

@ ianlee74 - I build the modules on demand and will be announcing another batch at the end of December (does this count as an annoucement?).

any news on the SDK front yet ?

Highlights ?

SSL, UDP Sockets ?

@ PiWi - No SSL yet, Bluegiga has still not released their updated firmware. Web sockets is the current big news. There are also improvements to the web server to support compressed html/css/js files. The web server now also supports files served from a SD card.

2 Likes

@ munderhill - Thanks for the update 8)

@ munderhill - on the bluegiga site they are annoucing wifi sdk 1.3 but I’ve found no dox for it yet, any links you might have ?

@ PiWi - No links or other information except their product announcement.

What’s the cost and can I sign up for one for testing?

[quote=“munderhill”]I build the modules on demand and will be announcing another batch at the end of December.
[/quote]
I’d be interested in one too please. Any idea when you think they’ll be ready to ship and what it might cost to get the to the UK?

I’d be interested in one too please. Any idea when you think they’ll be ready to ship and what it might cost to get the to the UK?
[/quote]

@ jason - I will be opening up the batch soon and will ship by the end of January. Cost of shipping to the UK and Europe is $25.00 US.

@ munderhill - I’ll keep my eyes and ears open. Thanks.