Problem Statement

  • A standard mechanism is required to control appliances using Micro Controller, Network and Desktop PC to build Smart Home, Office and Production houses.
  • The solution should provide Transparent, Secure, Extendible and Reliable communication between devices.
  • Reusability of approach to further enhance implementation in similar scenarios.

Solution

  • A SPOT (Smart Personal Object Technology) Services framework that allows Micro Controller devices to host and consume services supporting Remote Method Invocation.
  • SPOT Services framework is available for standard .NET Framework as well as .NET Micro Framework to host and consume services in any combination of host and client.
  • Uses TCP protocol for network communication.
  • Service calls can control output on Micro Controller GPIOs which in turn controls switches that can be connected to Appliances appropriately.

Source Code Documentation

Here is a brief description of all projects in this solution.

  1. Kaushik.Spot.Library.MF : This is the actual SPOT Services Class library for .NET Micro Framework.
  2. Kaushik.Spot.Library.Windows : This is the actual SPOT Services Class library for .NET Regular Framework.
  3. Kaushik.Spot.Library.WinPhone : This is the actual SPOT Services Class library for Windows Phone 7.1.
  4. Kaushik.Spot.CodeGenerator : This project provides a desktop based tool to be used to code generate Proxy Class in C# for client application
  5. Kaushik.Spot.MicroServer : This is a sample server project that is deployed on Netduino Plus in the demo video.
  6. Kaushik.Spot.ControllerApp : This is a sample client project for PC that is used to control operations on Netduino Plus in the demo video.
  7. Kaushik.Spot.PhoneControllerApp :This is a sample client project for Win Phone that is used to control operations on Netduino Plus like a PC version does.
  8. Kaushik.Spot.ConsoleClient.TestApp : This project was simply added to do some very basic performance evaluation of the work.

For further details of code please refer to SPOT Library Documentation and Sample Server Documentation

Here is 5 Step simple process to write and consume SPOT Services.

  1. Define an Interface that acts as a Service Contract. Interface should be marked with attribute SpotService and respective RPC/RMI methods should be marked SpotMethod
  2. Implement interface defined in step 1 in a class
  3. Register the class defined in step 2 using SpotServices.RegisterService(new <serviceclassname>());
  4. Start Spot Services server using SpotServices.StartServer(<socketport>);
  5. Code Generate proxy class using Kaushik.Spot.CodeGenerator (steps are explained in Demo Video) and include in your client app (like Kaushik.Spot.ControllerApp)
     

Last edited Dec 3, 2011 at 4:34 PM by vishalkaushik, version 10

Comments

No comments yet.