A16 IP Command Server May 2020 1
A16 IP Command Server May 2020 1
5 May 2020
S. Smyth
Introduction
Beginning firmware rev 1.90 the A16 now supports a simple TCP based command and response protocol that allows a
remote device to control and/or monitor certain operational aspects of the A16 in real time over a home network or over
the internet. The IP commands will initially only control the SVS headphone rendering and AV modes of operation. In the
future the IP command set may be expanded to control other aspects such as PRIR and HPEQ measurements. This
firmware development was undertaken in response to a request from an A16 owner wishing to add such commands to
their custom Centro Control application. To this end we have used the iOS Centro Control application by UK company
DemoPad Software Ltd, as a test bed throughout this development process. The Smyth Research example iOS Centro
Control code can be downloaded using the QR code included in this document (figure 7). Although we have used Centro
Control to test our IP commands, the purpose of this development was to generate a generic command set that is able to
run on many different IP control platforms, or indeed even from basic TCP packet senders.
Figure 1. The main control page of our example iOS Centro Control Application
Basic concept of A16 IP Control
We have implemented our IP control system using TCP as the delivery method. When a remote-control application
running on a PC, tablet or phone wishes to send an IP command to the A16, it must first know the A16’s IP address and
the TCP port number the A16 is listening on. Our TCP implementation uses fixed IP addressing. Hence the same IP
address and port number must be entered manually into both the A16 and the remote-control app before communication
can commence. On startup, the remote-control application will automatically determine the routing path to the A16 and
then open a connection with the A16 on the designated listening port. When a control button is pressed on the app the
associated IP command packet is then sent to the A16. The remote-control application will wait for an acknowledgement
from the A16 to say that the packet was received and will ordinarily close the connection shortly after. If the A16 wishes
to send additional data back to the application, say a delayed response triggered by an earlier command, then this data will
be missed by the app since the connection is now closed. To remedy this most remote-control apps have a persistent TCP
option that allows the connection with the A16 to stay open indefinitely or until the app is closed. Similarly, the A16 TCP
command server will also close the connection to the app after a certain period of inactivity. This time out period (TCP
timeout) can be adjusted under the A16’s network menu page.
A16 Network settings can be accessed under the ‘Settings’ menu in the home page.
The TCP command server can either be enabled or disabled. No other settings in this page can be adjusted while the TCP
command server is enabled. Settings that are important to the operation of the TCP command server are, 1) the TCP
command port number, 2) the IP address, 3) the TCP slave response and 4) the TCP timeout. The TCP command port
number can be selected from the range 512 through to 65535. The ADJ keys increment the port number by 1 whereas the
left and right arrow keys increment the port number in steps of 128. The IP address adjustment covers all the subnet
address space allocated by the IANA for private networks. The TCP slave response option causes the A16 to
automatically transmit IP response packets when a corresponding function changes in the A16. This is useful when the
A16 is being operated by the IR remote control as well as an IP controller and allows the IP controller display to stay in
sync with the A16 during periods of IR control. The TCP inactive timeout can be set between 30 and 250 seconds in steps
of 30 seconds. The A16 MAC address cannot be changed but is shown to aid advanced network debugging. For
preliminary command development and testing we use the Packet Sender tool. Different versions are available to run on
Windows, Mac, Android and iOS devices and may be downloaded for free from PacketSender.com. If you require only
very basic control of the A16, this tool could be used as an alternative to a full-blown control app. Packet Sender, as the
name applies, runs on the remote-control platform and sends individual IP command packets over the network to the A16.
An example of Packet Sender being used to send IP command packets to the A16 is shown above. This app is divided into
two windows. The top window holds a list of all the commands one has built for test - in this screen shot we have been
testing 17 different commands. Each command in this list was individually entered using the entry shown at the very top
and added to the list on pressing the Save button. The last command to be entered was the Assignments command. The
bottom window shows the network traffic that occurs when you send commands to the A16. Each A16 IP command
comprises a 2-digit hexadecimal number followed by \r\n. A list of numbers against command is given at the end of this
document. For example, the Assignments command sends 37\r\n to the A16. Assignments asks the A16 to send to the
remote-control the virtual listening room speaker IDs for each audio channel currently loaded in the User A and User B
presets. In the bottom window the network traffic associated with this command is shown. Under the ASCII column we
see that on pressing the Send button the first data packet (37\r\n) was sent from Packet Sender to the A16 (192.168.1.53
port 4101). The A16 then responded 18 milliseconds later by sending a list of the assignments, ACH1=L, ACH2=R,
ACH3=C, etc back to Packet Sender.
Figure 3. More advanced analysis of the TCP packets using Wire Shark
A more detailed traffic analysis of the Assignments command can be had by capturing the ethernet traffic using a
protocol analyser. Packet capture using Wire Shark is shown in figure 3. Protocol analysis is not required to make use of
the A16 IP command set, but is included here for completeness. In this screen shot the assignments data packet sent back
from the A16 is being highlighted and better shows the contents of the entire packet from ACH=L through to BCH16=Rtr.
IR remote commands
The IP command set comprise those commands that simply replicate IR remote control keystrokes and new commands
designed to implement specific functions. The 50 IR keystroke commands are listed in table 1 showing the IP command
code that must be transmitted to mimic the equivalent IR remote keystroke. The ASCII response data sent back by the
A16 is also shown for each command. For most of the IR remote commands the response is simply KEY=nn where nn is
the command code for that key. A binary zero (\00) is added to the end of each response to ensure the search algorithm at
the receiving end can properly extract responses. For example, the Menu key command (IR command #2) comprises the
digits 43 followed by \n\r. The response to this command is KEY=43\00. The purpose of any response is to give a textual
indication that the command was received and executed by the A16. Responses are often used in the remote-control app to
update among other things, button highlights, background colours or text content to indicate command success. While
most IR commands respond with KEY=nn\00, some give information specific to the command itself. For example, the
ALL key IP command (code 1a) causes the A16 to toggle between solo and mute modes. To confirm the ALL key state
following such a command, the A16 responds by sending MODE=SOLO\00 or MODE=MUTE\00. Typically, the IP
controller will capture the text following MODE= in order to change the mode legend displayed in the app.
Non-IR commands
Commands that do not correspond to IR remote control keystrokes are referred to non-IR commands and implement
specific functions that would ordinarily require multiple IR remote-control keystrokes. Table 2 lists these commands
together with the corresponding responses. As with the IR based commands, each response string is terminated with a
binary zero (\00). For more information on the specific data within each response packet we recommend using Packet
Sender, creating a packet for each command and then capturing the A16 response traffic.
The A16 TCP server activity indication is displayed in the speaker map rendering screen for either preset A or B. The
indication is located in small vertical strip in the bottom left of the screen and indicates four different states;
As soon as the TCP command server is enabled it immediately listens for any connection attempts over the specified TCP
port. In this state a connection has yet to be made and the indicator in the bottom left corner remains blank.
Black = TCP port not connected or TCP command server disabled
As soon as Packer Sender or an IP control app connects with the A16 the indicator will turn grey to indicate an active
connection has been established. Any time a connection is broken, the indictor will revert to a blank status. Typically, a
connection will be lost when the IP control app closes or the A16 inactivity timer is triggered, or in the case of Packer
Sender, when the TCP connection mode is not persistent.
Grey = TCP port connected and waiting to receive or send data packets
To indicate the reception and transmission of command and response packets, the grey indicator strip is divided in two.
The top half illuminates red when a response packet is sent from the A16 and the bottom half illuminates green when an
IP command packet has been received by the A16.
The A16 must be manually programmed with a (fixed) IP network address by the user. This means it is necessary to enter
an IP address not already in use on your local network in to the A16. If you have a PC running on the same network you
can list the IP addresses of all the devices on the network from the command prompt (for Windows type arp -a). You can
also scan the network IP addresses from your mobile device by downloading an IP Scanner or Network Analyser app.
Either of these will show all the addresses presently in use on your network. For example, figure 4 shows a screen dump
of IP Network Scanner (Lite) running from our iPAD test bed, listing the IP addresses in use on the network we used to
develop the A16 IP command server. This list is typical of a home network built around a broadband router and uses the
192.168.xxx.xxx subnet address range. The A16 appears on the second line (192.168.1.53) as an unidentified device with
an unknown DNS. Virtually all of the IP addresses associated with a home network will have been allocated dynamically
by the broadband router. Typically, dynamic addresses are restricted to a certain range of the available subnet addresses.
In our case it would appear the router prefers to allocate above 192.168.1.50. Hence if we were to choose a fixed IP
address it might be a good idea to use an address between 192.168.1.2 and 192.168.1.50.
Figure 4. IP addresses of all 10 devices identified on our LAN by IP Network Scanner (Lite)
Using the Smyth Research Centro Control iOS example app
Centro Control is a free iOS app shell that you download from Apple Store (figure 5). It only becomes a functioning IP
control app once you load controller code into the shell. Controller programs can be developed either by yourself using
the DemoPad Designer software package (free also for 30-day evaluation, then GBP £144 per annum), or by a third-party.
In either case the controller code is downloaded from cloud storage into the Centro Control app by scanning a QR code
generated by your DemoPad Designer software or supplied by the third-party. Thereafter, your Centro Control app will
always start up running the downloaded control program and no further communication with the cloud storage is required.
The idea behind this method is that it allows individuals to create their own custom controller, but without having to learn
how to code the low-level iOS application itself. A Centro Control app for the A16 can be developed and used completely
free of charge provided the app does not access more than one IP addresses (an in-app purchase is requested as soon as
two or more IP addresses are added to the app’s configuration page).
On downloading the Centro Control application (figure 5) for the first time, the app will ask permission to use your
device’s camera. Once permission is given the Load System page is displayed. To load the Smyth Research demonstration
control code (project filename Realiser_A16_rev2.0) you need to display (or print out) the QR code shown below (figure
7), and then press the Scan System QR Code option (figure 6) whilst pointing the camera at the QR code. On loading the
code, the app will start automatically. However, to connect to your A16 you need to enter the A16s IP address and port
number. Exit the Centro Control app, go to iOS Settings and select Centro Control. Select the Device Addresses page
(figure 8) and enter the IP address and Port number as the first entry into Device Locations. Now restart the Centro
Control app. Ensure also that the IP address and port number in the A16 and Centro Control app are the same, the A16 IP
command server is enabled and the A16 connected to your network using an ethernet cable. If it is necessary to download
the Smyth Research demonstration control code again, first go to iOS settings, select Centro Control, then select Project
Setup, then enable Show System Load Screen. Exit and restart the Centro Control app.
Figure 6. Loading the Smyth Research A16 IP controller demonstration code from the cloud
Figure 7. QR code for the Smyth Research A16 IP controller example code
Figure 8. Device Address setup page for the Centro Control app
Controlling the A16 from outside your home network
The Centro Control application can also control the A16 from the internet. The most common method for allowing a
device outside your home network to talk to a device on your home network is to enable port forwarding within your
broadband router. Please consult your router’s user manual if this mode of operation is desired. Port forwarding opens a
port in the router that is known to the external device. This together with the public IP address of your router allows an
app running on an external device to send TCP packets directly to the A16. Figure 9 is the individual port forwarding
menu page for the LINKSYS router used to connect our network to the outside world. Single Port forwarding has only a
few options - the A16’s IP address (Device IP#), the A16’s port number (Internal Port), the External Port which can be
made the same as the A16 port number, the Protocol which should be TCP or TCP/UDP. In order to allow Centro Control
to gain access to the A16 from the internet your broadband router’s IP address (public IP address) and the forwarding port
number (External Port) must be entered into the Remote Location fields of the Device Addresses settings page (figure 8).
Following this you must enable Remote Access in Centro Control’s home settings page. Your routers public IP address
can be found by going online and using a public IP finder application, for example www.whatismyip.com. Make sure the
PC or phone you are using to run this search is connected to your home network.
Summary
The A16’s new IP command server allows users to control many aspects of the A16 during headphone and AV playback
using simple TCP data packets. All the current IP command codes are listed in tables 1 and 2. We suggest that anyone
interested in developing their own IP command client application test the commands that interest them using a TCP
application such as Packet Sender. Packet Sender not only tests/analyses the packet payloads but also serves to illustrate
the timing of the commands and responses. We have used a Centro Control iOS app as a test bed for this development.
This example A16 control app can be downloaded into your own copy of Centro Control using the included QR code.
Anyone interested in developing their own Centro control app should proceed to DemoPad website (www.demopad.com)
and download the DemoPad Designer tool (note this only runs on Windows). Anyone who wishes to modify our example
app should email James ([email protected]) and we will send you a ZIP file of our project source files. Please
note that use of our example Centro Control app and/or our project source files are entirely at your own risk.
Figure 10. The main control page of our example iOS Centro Control Application
Figure 11. Home page of the Smyth Research example iOS Centro Control Application
Figure 12. Solo/Mute page of the Smyth Research example iOS Centro Control Application
Table 1. IR IP Commands
58
59
60 REQUEST User A volume 83 VA=27-99 TRI=1-3
61
62 REQUEST User A HT angle 85 AHT=string
63
64
65
66
67
68
69
70
71
72
73 User B preset #1 90 PB=01
74 User B preset #2 91 PB=02
75 User B preset #3 92 PB=03
76 User B preset #4 93 PB=04
77 User B preset #5 94 PB=05
78 User B preset #6 95 PB=06
79 User B preset #7 96 PB=07
80 User B preset #8 97 PB=08
81 User B preset #9 98 PB=09
82 User B preset #10 99 PB=10
83 User B preset #11 9a PB=11
84 User B preset #12 9b PB=12
85 User B preset #13 9c PB=13
86 User B preset #14 9d PB=14
87 User B preset #15 9e PB=15
88 User B preset #16 9f PB=16
89 REQUEST User B info a0 BUR=string (user name)
PB=string (preset number)
VB=string (volume)
BROOM=string (room description)
BNAME=string (subject name)
BSPKR=string (room layout)
BQFILE=string (HPEQ filename)
BQNAME=string (HPEQ subject)
BQTYPE=string (HPEQ filter type)
BQMOD=string (HPE headphone model)
BTACT=ON or OFF (tactile output)
90
91
92 REQUEST User B volume a3 VB=27-99
93
94 REQUEST User B HT angle a5 BHT=string
95
96
97
98
99
100
101
102
103 Request speaker key visibility ae V00,V01, etc Vnn
where nn=speaker ID
104 Request active speaker status af A00,A01, etc Ann
Where nn=speaker ID
105
106 Select speaker ID=1 B1 In solo mode A00 A01
In mute mode toggles between A01 and M01
107 Select speaker ID=2 B2 In solo mode A00 A02
In mute mode toggles btween A02 and M02
108 Select speaker ID=3 B3 In solo mode A00 A03
In mute mode toggles between A03 and M03
109 Select speaker ID=4 B4 In solo mode A00 A04
In mute mode toggles between A04 and M04
-
-
-
See Table 3 for ID 1-50 speaker designator and position
-
-
-