Manual IP switch II

Difference between revisions from 2020/12/28 19:10 and 2020/12/28 19:09.

[<-- Order page|https://remoteqth.com/order.php#ip-sw-mk2]
[<-- Web|https://remoteqth.com/ip-switch-mk2.php]
<-- Remote relay board [rev0.2|IP Switch with ESP32-GATEWAY] | [rev0.4|https://remoteqth.com/w/doku.php?id=ip-switch]

Manual IP switch MK2 is delivered with two parts - IP relay diver KIT (needs to assemble) and assembled IP control. Both parts have firmware installed and automaticaly pair in local network with available DHCP server.

!Quick start guide in two step
[https://remoteqth.com/img/wiki-manual-ipsw-06.png|noborder]
Manual IP switch is consists of two parts
# '''IP Switch relay driver KIT'''
** Assembly KIT by this instructions [rev0.2|IP Switch with ESP32-GATEWAY] | [rev0.4|https://remoteqth.com/w/doku.php?id=ip-switch].
** Connect ethernet to local LAN with available DHCP server
** Connect DC Power
*** rev 0.2'''{.redka#id0.2 '''{.redka#id color: #f23f37}5V{/}''' DC adapter - higher voltage damage both electronics!
*** rev 0.4'''{.redka#id0.4 '''{.redka#id color: #f23f37}12V{/}''' DC
** Set NET-ID-sufix with BCD switch in the range 0-7, for example 0.
# '''IP control'''
** This part is assembled and tested.
** Connect ethernet to local LAN with available DHCP server
** Set NET-ID-sufix with bottom side BCD switch in the range 0-7, '''the number must be the same as on IP-switch relay driver.'''
** Connect micro USB cable for power supply.
** Wait to pair and start to use.





!The hardware
* '''IP Switch relay driver KIT''' is on its own page [rev0.2|IP Switch with ESP32-GATEWAY] | [rev0.4|https://remoteqth.com/w/doku.php?id=ip-switch].
* '''IP control'''

[https://remoteqth.com/img/wiki-manual-ipsw-01.png|noborder]
* '''1 - rotary Encoder''' switch one from 2-16 outputs
* '''2 - status LCD''' display{br}[https://remoteqth.com/img/wiki-manual-ipsw-02.png|noborder]
** Points in the first row indicate the scope of the encoder.
* '''3 - NET-ID''' BCD, switch sufix in range 0-7{br}[https://remoteqth.com/img/wiki-manual-ipsw-04.png|noborder]
* '''4 - 25 pin D-SUB''' (inputs outputs not use)[https://remoteqth.com/img/wiki-manual-ipsw-03.png|noborder]
** '''PIN-1''' DC power, typicaly '''13,8V from transceiver'''
** '''PIN-18''' PTT input
** '''PIN-14''' GND
* '''5 - '''Ethernet
* '''6 - micro USB''' for upload firmware or power
* '''7 - '''eight light button - '''light after receive confirming from remote relay'''

!!Circuits
* Based on universal NANO module
** [Schematics rev 1.0 .pdf|https://remoteqth.com/hw/nano-module-10.pdf]
** [BOM|https://remoteqth.com/hw/nano-module-10-ibom.html]
* And expanding light keypad
** [Schematics rev 0.4 .pdf|https://remoteqth.com/hw/nano-keyb-04.pdf]
** [BOM|https://remoteqth.com/hw/nano-keyb-04-ibom.html]

!!Pinouts 25 pin D-SUB
[https://remoteqth.com/img/wiki-bd2-02.png|noborder|right]
| pin-1 | in | '''Input power''' 8-18V DC from Transceiver |
| pin-2 | in | ICOM CI-V |
| pin-3 | out | TXD TTL |
| pin-4 | out | TXD TTL inverted |
| pin-5 | out | TXD 232 level |
| pin-6 | out | PTT output |
| pin-7 | out | Relay 2 |
| pin-8 | out | Relay 4 |
| pin-9 | out | Relay 6 |
| pin-10 | out | Relay 8 |
| pin-11 | in/out | BCD4 |
| pin-12 | in/out | BCD2 |
| pin-13 | in | AZ |
| pin-14 | - | '''GND''' |
| pin-15 | in | RXD TTL |
| pin-16 | in | RXD TTL inverted |
| pin-17 | in | RXD 232 level |
| pin-18 | in | '''PTT in''' |
| pin-19 | out | Relay 1 |
| pin-20 | out | Relay 3 |
| pin-21 | out | Relay 5 |
| pin-22 | out | Relay 7 |
| pin-23 | out | +5V |
| pin-24 | in/out | BCD3 |
| pin-25 | in/out | BCD1 |
| shield | - | GND |



!Firmware
!!Compile from source
# Download and install [Arduino IDE|https://www.arduino.cc/en/main/software]
# Install [library|https://www.arduino.cc/en/guide/libraries]
## Wire
## LiquidCrystal_I2C or LiquidCrystal_PCF8574 or LiquidCrystal_I2C
## Ethernet
## EthernetUdp
## SPI
## EEPROM
# Download Manual IP switch firmware source from [GitHub|https://github.com/ok1hra/Manual_IP_switch_MK2]
# Connect '''micro USB''' cable between IP control and PC
# Configure... (more in the chapter below)
# Select menu Tools/Board:'''Arduino Nano'''
# Select menu Tools/Processor:'''ATmega328P (Old Bootloader)'''
# Select menu Tools/Port/YOUR-CONNECTED-PORT
# Upload firmware

!!Upload default binary (Windows only)
Does not allow configuration firmware, only CLI
# Download [Xloader for Windows|http://xloader.russemotto.com/]
# Download latest [.hex from GitHub|https://github.com/ok1hra/Manual_IP_switch_MK2/releases]
# Connect micro USB and upload it

!CLI
!!Control box
May be preset via CLI (command line interface). How to access
* connect micro USB cable
* run terminal - for example Ctrl+Shift+M in Arduino IDE
* set baudrate to 115200 and No line ending.
[https://remoteqth.com/img/wiki-ip-sw-mk2-cli.png|noborder]
CLI contains some commands for set or show information.
*'''?''' - show status
*'''/''' - enable/disable trasfer PTT (pin 18 on D-SUB connector) as one button (default number 8), may be change in firmware source edited with line{{byte ButtonUseForPttTransfer= 8;  // 1-8
}}
*'''.''' - Listing detected/stored ip-relay by ID sufix, for switching between it
*'''+''' - Switch between source of network ID sufix eeprom/BCD switch
*'''#''' - set network ID prefix (four high bit) in hexadecimal format (0-f).
*'''&''' - send broadcast packet for find relay devices in local network

!!Relay driver
Is configure via [Telnet|https://remoteqth.com/wiki/index.php?page=IP+Switch+with+ESP32-GATEWAY#_Telnet_access_with_KEY]

!Configure
!!!Network-ID
'''In last firmware NET-ID may be configure from CLI'''
contains from two parts and defined pair device in network
*'''Prefix''' (four high bit) in hexadecimal format (0-f) set from CLI
**in '''standart mode''' prefix expanded range of network ID
**if enable '''Multi control''', diffrent for each master device for his idetifications
*'''Sufix''' (four low bit) in hexadecimal format (0-f)
***get from eeprom (0-f) or BCD switch (0-7) depenency to preset in CLI[https://remoteqth.com/img/wiki-manual-ipsw-05.png|noborder]
***in '''standart mode''' sufix diffrent for each device
***in '''Multi control mode''' same, for all shared devices (group id)


!!Remotely IP address and UDP port
ouside from local network write directly to firmware. IP control use this address according to the setting NET-ID sufix (BCD switch or CLI). For remote operation need [public IP or VPN|https://remoteqth.com/img/slide-ip-sw-mk2-05.png]{{{0,0,0,0, 0}, // IP:port ID 0
  {0,0,0,0, 0},   // IP:port ID 1
  {0,0,0,0, 0},   // IP:port ID 2
  {0,0,0,0, 0},   // IP:port ID 3
  {0,0,0,0, 0},   // IP:port ID 4
  {0,0,0,0, 0},   // IP:port ID 5
  {0,0,0,0, 0},   // IP:port ID 6
{78,111,124,210, 88}, // IP:port ID 7 - remoteqth test point}}

!!I2C display address
need preset in firmware{{#define LcdI2Caddress  0x27}}The most common are values 0x27 or 0x3F. If display dont work
** [Upload I2C scanner firmware|https://playground.arduino.cc/Main/I2cScanner]
** Open terminal Ctrl+Shift+M [https://remoteqth.com/img/wiki-bd2-22.png]
** Write detect addres to firmware
* Select '''I2C LCD chip'''
** If type of chip is PCF8574'''AT'''
*** Install library '''LiquidCrystal_I2C'''
*** Disable line {{// #define LCD_PCF8574T}}
** If type of chip is PCF8574'''T'''
*** Install library '''LiquidCrystal_PCF8574'''
*** Enable line {{#define LCD_PCF8574T}}

!!Fast power up
*without shown LCD information enable  with{{#define FastBoot}}

[<-- Order page|https://remoteqth.com/order.php#ip-sw-mk2]
[<-- Web|https://remoteqth.com/ip-switch-mk2.php]
<-- Remote relay board [rev0.2|IP Switch with ESP32-GATEWAY] | [rev0.4|https://remoteqth.com/w/doku.php?id=ip-switch]