Main Site Documentation

Embedded device with WiFi as access point


#1

Hello Wireless Network Specialist,

I have an ideal solution in mind to configure a wireless embedded device for those end users who does not have too much affection with computers. Unfortunately I did not find a solution so far to get started realizing that idea. Hopefully someone can give me some suggestions or keywords to get started.

Here’s what I like to realize.
I want to create a device using an EMX board with a WiFi module, but without any display for user interaction. Initially when the end user receives such a device for the first time he/she needs to configure its WiFi settings in order to have that device connect to his wireless router/network.

Initially I like to have the device acting as an router access point, so that the user can use his laptop, tablet or WiFi enabled smart phone to easily connect to the device. Once connected it can use his browser to go to a configuration page to enter the wireless router/network settings. Once setup has been completed the device can be rebooted. The device will start in normal mode and connect as a client to the wifi router.

I looked at the AD HOC mode which is now available at GHIs WiFi module based on Redpine. I have made a small test program to setup an EMX as an ad hoc creator, but from there I don’t know how to exchange data with an application running for example on a PC. Can I for example bind a socket to the connection?

Hopefully I expressed my idea well enough and I’m looking forward for some suggestions.

Thanks in advance.


#2

I believe, you will not find any option for this anywhere you look. So I would not bother and look. But I could be wrong.

But AdHoc is available already for you so you can go this route.


#3

Yes, you will use a socket to communicate. When you install the .net micro framework(http://msdn.microsoft.com/en-us/library/ee435988.aspx), there is a samples directory (Documents\Microsoft .NET Micro Framework 4.1\Samples\SocketClient). Look at the SocketClient and SocketServer samples.


#4

Thanks for your reply Gus and Daniel6,

Daniel6 i am familiar with sockets and wrote a few communications applications using them. I was more wondering how to communicate with a .net mf app that have WiFi configured as AdHoc creator. For example if i add a listening socket in my EMX app… How does my app on another device knows how to access that EMX app, what kind op protocol is used??

Thanks, Rob


#5

Here is a bit of code(C#) I used to learn how to connect to the wifi device from my smart phone.

Hope this answers you question.

	void testWiFi()
	{
		
		
		
		
		System.Net.Sockets.Socket _socket = new System.Net.Sockets.Socket
			(System.Net.Sockets.AddressFamily.InterNetwork
			 ,System.Net.Sockets.SocketType.Stream
			 ,System.Net.Sockets.ProtocolType.Tcp);
		
		System.Net.IPAddress _address = new System.Net.IPAddress(new byte[]{11,11,11,100});
		
		System.Net.IPEndPoint _endpoint = new System.Net.IPEndPoint(_address,80);
		
		
		try
		{
		
			_socket.Connect(_endpoint);

			byte[] _msg = System.Text.Encoding.ASCII.GetBytes(DateTime.Now.TimeOfDay.ToString());
			
			_socket.Send(_msg);
		}
		catch (Exception ex)
		{
			UIAlertView _alert = new UIAlertView("Error",ex.Message,null,"Ok",null);
			_alert.Show();
			
		}
		if (_socket.Connected)
		{
			_socket.Disconnect(false);	
		}			
		
		
	}

#6

Hi mrPositive,

Without understanding 100% it is you wanting to do.

I recommend looking at the technology, Devices Profile for Web Services (DPWS)

http://msdn.microsoft.com/en-us/library/ee435793.aspx


#7

Sorry should maybe have add this URL instead.

http://msdn.microsoft.com/en-us/library/ee435393.aspx


#8

Thanks Robbin,

But its more that i want to realize an easy way to setup a wireless connection between an embedded device and a wifi router.


#9

For those interested, the solution was easier as expected :slight_smile: Just assign a static IP address starting with 169.254 to the network interface and you are able to communicate in ad-hoc mode.