IP Switch with ESP32-GATEWAY

This revision is from 2019/01/25 07:59. You can Restore it.

UNDER DEVELOPMENT

This kit worked with ESP32-GATEWAY Ethernet/WiFi module from OLIMEX. Below step by step assembled manual for 16 outputs (two boards).

Hardware

DC power jack

  • 5 volt DC only - higher voltage damage both electronics!
  • Size 2,1/5,5mm diameter to connect input power 5V DC (center positive)
  • Consumption below 500mA

P3 output header

pin-1 in DC power supply +5V
pin-2 in DC power supply +5V
pin-3 in GND
pin-4 in GND
pin-5 out output 1
pin-6 out output 2
pin-7 out output 3
pin-8 out output 4
pin-9 out output 5
pin-10 out output 6
pin-11 out output 7
pin-12 out output 8
pin-13 in Vin, if use UDN driver
pin-14 in Vin, if use UDN driver

How to assembly

Top side PCB

❏ Solder 2x12 1k rezistors R1-R14

2x10 100n capacitors C19-C35

2x8 LED diodes D38-D45

One BCD ID switch P6 on LEFT board

One female pin header P5 on LEFT board

One male pin header P4 on RIGHT board

2x 74HC595 IO U8

2x DIP socket for U5

2x male 2x3 pin header P2

2x male 2x7 pin header P3

Bottom side PCB

One DC jack J1 on LEFT board

One male 1x20 pin header P1 on LEFT board

Put output driver to DIP socket by your preferency

  • ULN chip for switching by output collector (grounding) need use two Jumpers on left P2 pin strip
  • UDN chip for switching by output emitter (voltage from P3 Vin) need use two Jumpers on right P2 pin strip

ESP32-GATEWAY board

One femmale 1x20 pin header CON1 on TOP side OLIMEX ESP32-GATEWAY

LED1 on ESP32-GATEWAY show

  • three times flashes - receive IP from DHCP server - Ethernet
  • two times flashes - receive IP from DHCP server - Wifi
  • one time flashes - receive broadcast pair packet

How to mout to DIN rail

Firmware

UDP packet format

  1. Download and install last version Arduino IDE
  2. Download and install ESP32 support for arduino from GitHub - installation instruction included.
  3. Download IP switch firmware source from GitHub
  4. Edit source
    1. For use Ethernet wiring connection preset configuration
      #define ETHERNET               // Enable ESP32 ethernet (DHCP IPv4)
      //#define WIFI                  // Enable ESP32 WIFI (DHCP IPv4)
    2. For use WiFi connection use this settings
      //#define ETHERNET               // Enable ESP32 ethernet (DHCP IPv4)
      #define WIFI                  // Enable ESP32 WIFI (DHCP IPv4)
      and set your SSID and password for access
      const char* ssid     = "YOUR-SSID";
      const char* password = "YOUR-PASSWORD";
  5. Select menu Tools/Board:"OLIMEX ESP32-GATEWAY"
  6. Select menu Tools/Port/YOUR-CONNECTED-PORT
  7. Upload firmware

Setup

are available 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.

CLI contains some commands for set or show information

  • ? - show status
  • * - enable/disable debugging
  • # - set network ID prefix (four high bit) in hexadecimal format (0-f)
    • settings for sufix available if disble hardware BCD switch in firmware
      //#define HW_BCD_SW
  • n - set encoder range (0-g)
  • m - preset source to Manual IP switch
  • r - preset source to band decoder
  • o - preset source to open interface II

After select settings write to eeprom

For controlled from Open Interface III keyboard

  • Upload firmware by previous steps
  • Select Network ID with P6 BCD switch. ID 0-7 represent keyboard switching for eight independent IP switch by selected band
  • Connect to same local network with DHCP as Open Interface III
  • After power up both devices, is automaticaly pair and work

For controlled from Open Interface III rotary encoder

  • Upload firmware by previous steps
  • Select Network ID with P6 BCD switch. ID 8-F represent keyboard switching for eight independent IP switch by selected band
  • Connect to same local network with DHCP as Open Interface III
  • After power up both devices, is automaticaly pair and work

For controlled from Open Interface III band decoder

not implemented yet

Web status page

  • Show all outputs status
  • Parameter of WiFi or ethrnet IP connect
  • Firmware version
  • How source controled his - may be change and store on EEPROM
  • Notice - show this page can extend reaction latency IP switch

How IP addres got the device from the DHCP server?

  • show in serial terminal after reboot, or send h character
  • or find some network scanner