background image

TCP access and commands

The command set designed to provide consistent expansion and new features, they are sent over TCP/IP on port 17494 
(0x4456). This is the default port, it can be changed in the configuration settings.
Five connections are allowed at any one time, these are independently protected but all using the same password as 
defined in the board configuration.

Command

Action

dec

hex

16

0x10

Get Module Info - returns 3 bytes. Module Id (21 for ETH8020), Hardware version, Firmware

version.

32

0x20

Digital Active - follow with 1-20 to set relay on then a time for pulsed output from 1-255 (100ms

resolution) or 0 for permanent. Board will return 0 for success, 1 for failure 

33

0x21

Digital Inactive - follow with 1-20 to turn relay off then a time for pulsed output from 1-255 (100ms

resolution) or 0 for permanent. Board will return 0 for success, 1 for failure

35

0x23

Digital Set Outputs - follow  3 bytes, first byte will set relays 1-8, All on = 255 (0xFF), All off = 0,

2nd byte for relays 9-16, 3rd byte for relays 17-20, Board will return 0 for success, 1 for failure

36

0x24

Digital Get Outputs - returns 3 bytes, the first corresponds with relays 1-8, 2nd byte for relays 9-16,

3rd byte for relays 17-20

37

0x25

Digital Get Inputs - returns 4 bytes, the first three bytes are always 0, the 4th bytes bits correspond

with the 8 digital inputs, a high bit meaning input is active (driven low)

50

0x32

Get Analogue Voltage - follow with 1-8 for channel and ETH8020 will respond with 2 bytes to form

an 16-bit integer (high byte first)

58

0x3A

ASCII text commands - allows a text string to switch outputs, see section below

119

0x77

Get Serial Number - Returns the unique 6 byte MAC address of the module.

120

0x78

Get Volts - returns relay supply voltage as byte, 125 being 12.5V DC

121

0x79

Password Entry - see TCP/IP password, board will return 1 for success or 2 for failure

122

0x7A

Get Unlock Time - see section below

123

0x7B

Log Out - immediately re-enables password protection,

 

board will return 0 for success

Digital Active/Inactive Commands

These are 3 byte commands, The first byte is the command, 32 (active means on) or 33 (inactive).
Second byte is the output number, 1-4 for the relays, or 9 - 16 for digital outputs (marked I/O1 to I/O8 on the board).
Third byte is the on time. Set this to zero for non pulsed mode, or 1-255 for a pulse in 100mS intervals (100mS to 25.5 
seconds).
For example:

     

0x20

 - turn the relay on command

     

0x03

 - relay 3

     

0x32

 (50) - 5 seconds (50 * 100ms)

Board will return 0 for success, 1 for failure.
Note - All bytes in a command must be sent in one TCP/IP packet . Digital outputs pull the output pin down to 0v when
active and pull up to 12v via a 10k resistor when inactive.

Analogue input read

Four analogue inputs of 0v-5v at 10-bit resolution are provided, the conversion is performed when you send the "Get 
Analogue Voltage" command 0x32 and the channel number. The resulting 16 bit integer will be transmitted back in two
bytes (high byte first), combine these for the result. The 10-bit conversion will be in the lower 10 bits of the 16 bit 
integer with the upper 6 bits being 0.

© Devantech Ltd  02/07/19

ETH8020 Documentation  

     9/17

Summary of Contents for ETH008

Page 1: ...8020 provides a red LED mounted immediately next to each relay to indicate whether it is in a powered state LED on there is also two LED s mounted in the Ethernet connector which will flash with Ethernet traffic Finally there is a green power LED next to the processor Relay power rating If the contact load voltage and current of the relay are in the region enclosed by the solid and dotted lines in...

Page 2: ...Free Contacts NC normally connected C common NO normally open Power relays Four 16A volt free contact relays are provided for switching a common input between a normally closed output and a normally open output The relay coil is powered by the 12vdc incoming supply on user command Coil C Relay in passive state NC NO Coil C Relay in powered state NC NO Devantech Ltd 02 07 19 ETH8020 Documentation 2...

Page 3: ...bit conversion will be in the lower 10 bits of the 16 bit integer with the upper 6 bits being 0 There is a 5v supply available on the 3 pin terminal block between the analogue inputs Examples Example input connecting a potentiometer Connecting a potentiometer should be the simplest of tasks either end of the pot should be wired to the 5v and 0v respectively the output pin of the pot is then wired ...

Page 4: ... there or any other used IP addresses on the network The subnet mask dictates what IP addresses the PC can communicate with we set this to 255 255 255 0 so the PC can talk to any module with an IP address of 192 168 0 x The default gateway is likely to be the IP address that the internet connection is located at and the DNS server can be either your router address or Google provide a DNS service a...

Page 5: ... bar please note this only works in windows You will be prompted for a password as shown below The default login is Username admin Password password The ability to change these settings is shown in the configuration section You should now see the following web page This web page will allow you to switch the relays on and off by clicking the relay buttons the red gray circles It also contains a lin...

Page 6: ...lso offers the option to set a password that will be required to change any of the relay states or digital outputs using TCP IP commands this is explained in the TCP IP password section All settings are saved to memory so be careful to remember the username and password Default password settings are shown in the picture below Version 2 now offers a latched outputs option this will automatically sa...

Page 7: ... accepts an IP address or hostname which will be converted to an IP address by the DNS server supplied in the board configuration above If the module is on the local network then you can use the assigned IP address if the target is over the internet then you need to supply the gateway in the configuration internet source IP like your router and the Address of target board is the IP address of the ...

Page 8: ...inputs to a PC it operates on the default port of 17494 the default password of password although both are easily changed in the source code and requires the ETH8020 input mapping to be pointed at the host PC IP address As it s having to constantly listen it s a multi thread program The input monitor program is available as Visual C express ready built installation files here or as project with so...

Page 9: ...ond with 2 bytes to form an 16 bit integer high byte first 58 0x3A ASCII text commands allows a text string to switch outputs see section below 119 0x77 Get Serial Number Returns the unique 6 byte MAC address of the module 120 0x78 Get Volts returns relay supply voltage as byte 125 being 12 5V DC 121 0x79 Password Entry see TCP IP password board will return 1 for success or 2 for failure 122 0x7A ...

Page 10: ...ade 1 30 seconds until TCP IP password protection is re enabled All authorised commands set the timer back to 30 seconds including this one 255 TCP IP password is not enabled ASCII text commands DOA and DOI V5 firmware needed Following customer request we have added a feature that allows the outputs to be switched using an ASCII string devices like a Mobotix camera can now switch relays with simpl...

Page 11: ...DG834 router After logging on to your routers setup page the first thing to do is create a new service Click on the Services menu then Add Custom Service Enter a name for the service select TCP and enter the ETH8020 s port address for both the start and finish ports Click Apply Now go to the Firewall Rules menu and click Add in the Inbound services section Select the ETH8020 service and ALLOW alwa...

Page 12: ...on Visual studio express is provided free from Microsoft http www microsoft com exPress download The test program is able to control an ETH8020 on the local network or over the internet using your router port forwarding an example of the setup procedure is described on the page above To point the example program at your router go to menu Setup Set Comport and click Custom IP then enter the Router ...

Page 13: ...y now on all http pages http set output commands added V5 08 13 14 Fixed ASCII command buffer overruns V6 02 25 15 Corrected issue with http password length of 12 characters V7 11 16 15 Digital input mapping functionality added html commands now respond with board relay and input status V8 29 11 16 HTML page now has relays numbered for easy identification V9 03 04 17 Mapped inputs socket closure c...

Page 14: ...ord the program will require it to be entered by clicking the password button Following a successful connection you will now be able to click the update button to select a file Devantech Ltd 02 07 19 ETH8020 Documentation 14 17 ...

Page 15: ... Devantech Ltd 02 07 19 ETH8020 Documentation 15 17 ...

Page 16: ... necessary to reset the ETH8020 to its shipped condition then the end two contacts of the row of 5 holes near the large chip on the side nearest the Ethernet connection must be shorted together at board power up Keep the pins shorted until the green power LED starts to flash this will take up to 5 seconds The green LED will flash as the settings are reset please wait until the LED finishes flashin...

Page 17: ...Board dimensions Devantech Ltd 02 07 19 ETH8020 Documentation 17 17 ...

Reviews: