TCP Server Device Core

The TCP Server Device Core for Blue Pill, known as core-skaarhoj-tcpserver, enables users to connect one or multiple TCP clients to the device core, and read/write values to numerous internally stored data types. It's also an implementation of the data register section of the TCP Server device core for UniSketch, mainly for legacy purposes. The key attraction for Blue Pill users is likely the significantly improved capacities:

The device core is generally multi-directional. Most values are set to read/write, and alterations from any client - whether the connected TCP clients or the device core clients - are propagated to other connected clients, ensuring synchronization at all times.

Use cases

The Device Core is an essential tool for ad hoc interactions with Reactor, which is the panel management application found on the majority of SKAARHOJ products. This utility is particularly beneficial for addressing custom integration needs. Below are a few examples:

 

Device Core Setup

In Reactor you would add the device core to the device list. The setup page looks like this:

image.png

Connect as a TCP Client

Using Putty, telnet or nc depending on your platform, you connect to the TCP server by using the IP address of the Blue Pill device hosting the device core and the port number. Here is an example. Connection is silent, there will be no introduction message sent to the connecting client, but typing in "help" and ending with newline (\n or char 10) will show available commands:

image.png

If you are using Putty on Windows, make sure to set it up correctly to send newlines for line endings:

image.png

Try the different commands to get the feel for it.

Example in Reactor

Here is an example of how Reactor can interface with an integer from the device core:

Click a hardware component in Configuration tab and assign a new behavior with an IO reference pointing to the Integer Value parameter of the TCP Server. Select integer #2 for example:

image.png

You will see it in the display of the component, but it has no value:

image.png

Probably the "Change by Step" master behavior was assigned to the button as you selected the parameter, so if you press the button it should assume a value:

image.png

Simultaneously, you should see values reported in the connected TCP Client window:

image.png

In the TCP Client you can try to type in "Int#2=111" and you should see the value reported back in all connected TCP Clients as well as update in Reactor:

image.png

The same can be done with all the other registers.


Revision #5
Created 7 June 2023 19:05:08 by Kasper
Updated 18 December 2023 10:41:32 by Kasper