Logo Banner

Velleman K8000 - [K8000 Standalone Usage] - [K8000 Wireless Server]

K8000 FEZ Server Software

Designing the server

This project is all about the FEZ Panda II that will control the Velleman K8000 through I2C commands.

The FEZ Panda II is a very compact system with only limited system resources. This is bad, because we want to use it as a server. A server means: multiple incoming connections which all run in a separate thread.

The FEZ Panda II uses the FEZ Connect Shield for the network communications. This card has an Ethernet connector and a chip (W5100) that handles all TCP/IP communications. Unfortunately this chip is very limited: it can only handle up to 4 communication sockets. This means the server will only be able to handle 2 connections at a time.

This shouldn't be a big problem: this project was designed to replace the parallel cable between PC and K8000 by a wireless link (Wi-Fi). It uses a TCP/IP server, but it was never meant to control dozens of connections.

Server Software

The server software is written in Visual C# Express .NET. This is the official programming language for the FEZ Panda II board. It is software for the FEZ Panda II so it has no GUI (Graphical User Interface). The server will perform this startup sequence:

You can download the server's source code by clicking the green button at the bottom of this page. This project can be opened in the free Microsoft Visual C# Express.

Setting Server Settings

You need to check the FEZ's network settings before you can execute the server on your network. The settings absolute need to match the settings of your own LAN network! You can find the settings in the Program.cs file:

      myServer.serverPort = 23;
      myServer.ip = new byte[] { 192, 168, 2, 150 };
      myServer.subnet = new byte[] { 255, 255, 255, 0 };
      myServer.gateway = new byte[] { 192, 168, 1, 1 };
      myServer.mac = new byte[] { 0x00, 0x88, 0x98, 0x90, 0xD4, 0xE0 };
    

You should choose a fixed IP address that is unique in your LAN network. You can copy the subnet/gateway settings from your desktop computer (open a DOS-box and type IPCONFIG /ALL to view the network settings. You should also set a MAC address. This can be any hexadecimal number, just make sure it doesn't already exist on your network.

Running the server

You can run the server for the first time when everything is set. (Here I assume your FEZ Panda II is installed correctly and the K8000 is connected to it). Just hit the F5 key in Visual C# to start the program. This will execute the program: Visual C# will make sure the server is first transmitted to your FEZ Panda II. It can take some seconds before the FEZ server is running.

Testing the server

First you should test if the FEZ Server is present on your network. You can do this by pinging its IP address. You can do this by opening a DOS box and typing the following command: PING 192.168.2.150. The PING command should show some ping results with a low response time. You will need to check your network settings in the case of any failure.

      C:\Users\bart>ping 192.168.2.150
      
      Pinging 192.168.2.150 with 32 bytes of data:
      Reply from 192.168.2.150: bytes=32 time<1ms TTL=128
      Reply from 192.168.2.150: bytes=32 time<1ms TTL=128
      Reply from 192.168.2.150: bytes=32 time<1ms TTL=128
      Reply from 192.168.2.150: bytes=32 time<1ms TTL=128
      
      Ping statistics for 192.168.2.150:
      Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
      Approximate round trip times in milli-seconds:
      Minimum = 0ms, Maximum = 0ms, Average = 0ms
      

Now it is time to create a real connection with the FEZ server. You can do this by creating a connection with my client software, but you can also use a Telnet client. For this you have to open a DOS window and type the following command:

      C:\Users\bart>telnet 192.168.2.150
      

Telnet will show you the following screen once a connection could be established:

    +OK Fez-to-K8000 TCP server
    

This means the server is up and running. You can even play a little bit by entering protocol commands yourself. View the server protocol for a list with the allowed commands. You can enter the following commands to login and set all I/O channels:

PASS bart!

SETALLIO

The resulting Telnet Window will look like this:

		
    +OK Fez-to-K8000 TCP server
    PASS bart!
    +OK Welcome to the K8000 TCP/IP server!
    SETALLIO
    +OK 1111111111111111
    

Information about the Telnet command in DOS

Please note the Telnet command might not work on your computer. You then need to activate it first through the 'Programs And Features' icon in the Windows control Panel (Windows 7). Then click the option "turn features on or off". Here you should find a checkbox to activate the Windows Telnet Client.

Confirmed: the server is working!

Now we are sure everything is working. So, let's play a little bit with the client software!


Copyright ©1998-2022 Vanderhaegen Bart - last modified: August 24, 2013