EQSP32x

Updated at 22 March 2024

EQSP32 is a compact, powerful, and user-friendly Industrial IoT ESP32 PLC controller (Industrial Internet of Things (IIoT) controller), featuring WiFi and Bluetooth connectivity, that is ideal for a broad range of Industrial/Home IoT Automation, Remote Monitoring/Control, and Instrumentation applications. It offers the convenience of a Mini-Programmable Logic Controller (PLC) with its DIN-rail-mount and screw terminals design, coupled with the power and flexibility of an open-architecture embedded 32-bit computer.

At its core, the EQSP32 is powered by the ESP32S3, a widely used System on Chip known for its high-performance dual-core processor and integrated wireless radio. This open architecture allows users to leverage the extensive ecosystem of tools and software available for the ESP32, amplifying the capabilities of EQSP32.

Furthermore, with Erqos’ revolutionary No-Code Programming Technology, users can develop applications with only a fraction of the skills and time normally required in typical PLC or embedded computer development. By simply describing their needs in plain English, Erqos’ AI Assistant can generate the necessary code for this ChatGPT PLC in seconds, enabling extremely fast iot automation project development with minimal coding expertise.

The EQSP32 is equipped with 16 configurable I/O terminals for interfacing with all common types of sensors and actuators, RS232/485 communication, and an optional CANbus interface, making it suitable for a wide array of internet-connected automation and monitoring applications.

Erqos’ comprehensive approach makes the EQSP32 a complete end-to-end solution, from interfacing with the physical environment, to offering smartphone-operated User Interfaces, like no other ESP32 PLC. This includes a variety of interfaces for different sensors and actuators, a powerful processing unit, and intuitive software for seamless Wi-Fi connectivity and tools to develop custom smartphone apps.

Lastly, the EQSP32 features an expansion connector for easy addition of various future add-on modules, ensuring that the iot automation system can grow alongside the evolving needs of its users.

Key Features

  • Dual-core ESP32-S3 SoC running at 240MHz with 512k RAM and 8M Flash
  • Integrated WiFi and Bluetooth Low Energy (BLE) connectivity
  • Integrated 7V-26V power input DC/DC converter
  • 5V 1A output for supplying user sensors and devices
  • Continuous monitoring of power supplies voltages.
  • LED indicator for power and Bluetooth/WiFi connectivity status
  • Built-in Buzzer audio indicator
  • Front-facing USB-C connector for programming
  • Software selectable RS232/RS485 serial port
  • Modbus and DMX support on RS485
  • Optional CAN bus interface
  • Surge protection on RS232/485 and CAN Interfaces.
  • Optional dual 0V-5V analog outputs
  • Built in 16-channel PWM controller
  • 16 EQUniversal Inputs/Outputs terminals, with multiple software-configurable modes:
    • High Speed 0-5V Logic-Level Digital input
    • Digital Inputs with Debounce Delay
    • High Speed Data, Logic Levels Output up to 1Mbit/s
    • Open Collector On/Off Outputs
    • Open Collector PWM Outputs
    • Open Collector Output Power-Optimized for relay coils
    • 0-5V Absolute Voltage Analog inputs
    • Analog Inputs relative to the 5V Supply
    • NTC Temperature Sensor Analog Inputs
  • Analog and Temperature are available on inputs 1 to 8 only
  • Protected, 24V tolerant Inputs
  • 12-bit Analog Inputs resolution
  • 1A max per Open Collector Output
  • Current limited and thermally protected Output drivers.
  • Flyback diodes on each Output for safe and efficient switching of Inductive loads
  • Built-in watchdog timer. Disables the Open Collector Outputs in case of software failure
  • Expansion connector for up to 16 add-on modules for additional I/O or special function interface (ex. pH sensor, stepped driver, energy sensor etc.)
  • Integrated System Supervisor Software handling core functions:
    • Initial WiFi Setup using EQConnect Smartphone App
    • Connection to WiFi
    • Clock/Calendar sync over Internet
    • Input/Output and PWM updates
    • Status Check and LED indicators update.
    • Connection of Real-Time Database
    • IO State and Variables Synchronization with Cloud Database.
  • Library for efficient and transparent handling of pin, peripheral and connectivity control and configuration
  • Compatible with EPSHome
  • Generative AI Coding Assistant trained with System Supervisor and Library
  • Works with Arduino IDE, VS Code and all other IDE’s for ESP32
  • Compact, 4SU-wide (70mm), DIN-rail mount enclosure with 24 screw terminals
  • IP20 Protection
  • -20 Min to 55 Max Ambient temperature

Applications

  • Home Automation
  • Industrial Monitoring & Control
  • IoT Automation
  • Environmental Monitoring
  • Agricultural Applications
  • Energy Management
  • Healthcare Monitoring
  • Retail and Inventory Management
  • Robotics and Automation
  • Educational Projects
  • Entertainment and Art Installations

Block Diagram

EQSP32 industrial IoT controller functional block diagram. It demonstrates the dedication and effort put in the multipurpose IO and communication protection. The power management unit protection from ESD and inverse polarity, while the power supplies are continuously monitored. The multipurpose IOs (ADIOs) are protected and a dedicated PWM controller handles with precision the solid state switches for variable power outputs. Serial communications and can bus are surge protected and the mutlipurpose terminals have integrated flyback diodes for allowing the control of inductive loads like solenoid values and relays.

Product List

Model EQSP32C EQSP32A EQSP32I
Dual Core x 240MHz
512K RAM / 8M Flash
BLE, WiFi, Database Access
Protected Terminals
16 x Expansion Modules
16 x Multipurpose I/O
16 x Pull-Down Power PWM
8 x Analog Inputs
8 x TTL Push-Pull PWM
RS232/RS485
CAN Bus
2 x 5V Analog Output
2 x Additional Digital Inputs
Antenna
Internal
EQSP32C
EQSP32A
EQSP32I
External
EQSP32C-X
EQSP32A-X
EQSP32I-X

System Specifications

Sub-Module

Features

Software

Precompiled proprietary library for pin and peripheral modes and configurations

Transparent connectivity handling using BLE and WiFi

Transparent integrated database handling for IoT applications

Compatibility

ESPHome integration compatibility with provided YAML profile configuration file

Compatible with Arduino IDE, VS Code and all other ESP related IDEs

Processor

Dual-Core XTensa LX7 MCU

240 MHz frequency

Dedicated user program processor

512K RAM / 8M Flash memory

Power Management

Integrated DC/DC, 7V to 26V DC power input

Supply output 5V @ 1A for powering external peripherals

Input and output supply monitoring

I/O Terminals

16 x Multipurpose I/Os (digital/analog input/output)

TTL levels

Over voltage protection

8 x 12-bit ADCs

16 x Pull-Down Power PWM Outputs

Power PWM Output

16 x 1A power Pull Down PWM outputs

Externally supplied up to 26V for more flexibility

Integrated flyback diodes to VInput for inductive loads (like solenoids & relay coils)

Short circuit, over current, over voltage and over temperature protection

Communication

RS232

Half duplex RS485 with Modbus and DMX support

CAN Bus (optional)

Indications

Green LED for power indication

Red LED for device status

2 x Blue LEDs for BLE and WiFi connectivity status

Buzzer for audio indications

Mounting

Easy standard DIN rail push-fit mounting with spring mechanism

Expandability

Push fit expansion module mounting

Specialized expansion modules for niche applications

Automatic module detection and characterization

Software Architecture

EQSP32 Library Block Diagram - Functional block diagram of the software architecture used inside EQSP32 industrial IoT controller. The proprietary library provides the user with an API to easily access all EQSP32 digital/analog inputs/outputs and drive variable power loads using the power PWM modes. Also in the background the EQ System Supervisor or EQ Task manager, handles all invisible background tasks for communication, database synchronization and peripherals handling.

Electrical Specifications

Absolute maximum values

Pin

Type

Min.

Typ.

Max.

Unit

Supply In + to GND

Power In

  

28

V

5V Out + to GND

Power Out

  

2

A

Tx / A to GND

In/Out

-15

 

15

V

Rx / B to GND

CAN H to GND

In/Out

-21

 

21

V

CAN L to GND

ADIO to GND

In/Out

-0.5

 

VIn (*)

V

Out

  

1.3

A

Warning:

(*) ADIO voltage should never exceed the VIn voltage of EQSP for steady states, or else the flyback diodes will conduct continuously!

Recommended Operating Conditions and Typical Values

Pin

Type

Min.

Typ.

Max.

Unit

Supply In +

Power In

7

12 to 24

26

V

5V Out +

Power Out

4.98

5

5.02

V

  

1

A

RS232 Tx

Out

-12

 

12

V

RS232 Rx

In

-12

 

12

RS485 A

In/Out

0

 

5

V

RS485 B

CAN H

Out (dominant)

2.75

3.5

4.5

V

CAN L

Out (dominant)

0.5

1.5

2.25

CAN L to CAN H

In (differential)

0.5

0.7

0.9

ADIO

High (1)

In/Out

3.3

5 to VIn

VIn

V

Low (0)

-0.5

0

1.3

Analog

In

0

 

5.5

Power PWM

Out

  

1

A

Visual and Audio Indications

While the proprietary library is downloaded and running, the EQ System Supervisor will monitor EQSP32’s status and Bluetooth/WiFi status.

The visual indicator (LEDs) will be automatically updated to reflect the device’s state.

The internal buzzer will sound once at the beginning of the power cycle, indicating that the library is running. The user may utilize the audio indication in their program from the library’s API.

eqsp32 - Industrial IoT esp32 based controller visual and audio indications

Power LED

On           – Powered On

Off          – No Power

Status LED

Off          – No errors

Blink       – Supply under voltage

Flashing  – Supply over voltage

Blink       – Internal fault

On           – Default configs

Bluetooth LED

Off          – Bluetooth disconnected

Flashing  – Bluetooth advertising

On           – Bluetooth connected

Bluetooth LED

Off          – WiFi disconnected

Flashing  – WiFi scanning/trying to connect

On           – WiFi connected

Pinout

Industrial IoT Controller

X1 - Screw terminal connector 1

USB-C - Programmer port

X2 - Screw terminal connector 2

Industrial IoT Controller

EQSP32 - Wireless Industrial IoT Controller (IIoT) pinout. total of 24 terminals. Two of these are dedicated for power input and another two for power output. Embedded RS232/RS485 serial communication port and CAN-Bus port. 16 multipurpose IO terminals for digital input/output, analog input and power PWM output for 1A continuous loads up to 26V each. The Analog/Digital I/Os are also mentioned as ADIO terminals.

X1 - Screw terminal connector 1

X1 connector accommodates the power supply input pins, the serial communication and 8 ADIO pins.

Name

Pin

Function

Type

X1

GND

DC Power Input – (GND) (*)

POWER IN

VIn

DC Power Input + (10V-24V)

POWER IN

1, …, 8

Multipurpose I/O (**)

ADIO

Tx / A

RS232 Tx / RS485 A

SERIAL

Rx / B

RS232 Rx / RS485 B

SERIAL

Notes:

(*) DC Power Input GND is common with DC Power Output GND

(**) X1 ADIO pins also support analog input (AIN) functionality.


X2 - Screw terminal connector 2

X2 connector accommodates the power supply output pins, the CAN-Bus communication (or optional analog output) and 8 ADIO pins.

Name

Pin

Function

Type

X2

GND

DC Power Output – (GND) (*)

POWER OUT

5V

DC Power Output + (5V)

POWER OUT

9, …, 16

Multipurpose I/O

DIO

H

CAN H (**)

CAN-Bus

L

CAN L (***)

CAN-Bus

Notes:

(*) DC Power Output GND is common with DC Power Input GND

(**) Analog output 1 (built option instead of CAN driver)

(***) Analog output 2 (built option instead of CAN driver)

Powering EQSP32

To power the EQSP32 from the grid an AC/DC converter is needed. It is recommended that minimum of 5W AC/DC power supply is used to power EQSP32 main module.

For driving additional devices and loads either directly from the AC/DC or from EQSP32’s 5VDC out, the power supply’s rating must be calculated accordingly to meet or exceed the total power demand of the application.

When programming your industrial IoT controller, it is important that the VIn power is cut and EQSP32 is running only on USB-C’s 5V.

For safety and ease of use, it is strongly recommended that a main circuit breaker is used to completely isolate the AC/DC from the grid.

EQSP32 industrial IoT controller - Wiring example of connecting your esp32 based controller to the AC lines of your electrical panel

Warning:    Make sure that the appropriate ground fault circuit breaker, fuses or circuit breakers and any other necessary protective components are used if there is any risk of user electrocution.

Power Management

Power distribution and monitoring

The EQSP32, continuously monitors the power supply’s input voltage and the internally generated power supply 5V output. The 5V output supply is also used as a voltage reference, for example when connecting a thermistor, so internal monitoring results in more accurate measurements.

EQSP32 is also powered from the USB 5V but this voltage is only internally used. When programming EQSP32 it is recommended that the external VIn is shut down and only the USB 5V is used.

EQSP32 industrial IoT controller - Power supply and power management unit

Library Reference

Usage

eqsp32.readInputVoltage()

Returns the measured voltage on Vin (7V-26V)

eqsp32.readOutputVoltage()

Returns the measured voltage on VOut (5V)

Integrated 5V power supply

Any number of external devices, loads and sensors may be powered directly from the integrated 5V power supply, as long as the combined continuous power consumption is up to 1A.

The integrated 5V power supply is heavily filtered and monitored. The user has access to the internal 5V analog readings and it is recommended for best accuracy that this supply is used as reference.

EQSP32 industrial IoT controller - Powering external devices and peripherals example

Multipurpose I/O & Power PWM Outputs - ADIO

Equivalent ADIO Circuit

EQSP32 industrial IoT controller - ADIO / Multipurpose IO terminal equivalent circuit

ADIO Modes Overview

All ADIO pins support DIN, DOUT and POUT modes. In X1, pins 1-8 also support AIN mode. For X2, the pins 9-16 also support AOUT mode.

In addition to the 5 main modes, there are some extra special modes, which extend the pin’s functionality. For the pin to support each special mode, it has to support the corresponding main mode.

Mode

Type

Function

Digital Input (DIN)

Input

Digital

Switch Input (SWT) – {Special DIN}

Input

Digital

Analog Input (AIN) – {ADIO 1, …, 8}

Input

Analog

Relative Analog Input (RAIN) – {Special AIN}

Input

Analog

Temperature Input (TIN) – {Special AIN}

Input

Analog

Power PWM Output (POUT)

Output

PWM

Relay (RELAY) – {Special POUT}

Output

PWM

 

Digital Input (DIN)

When in digital input mode (DIN), the returned value when reading the pin is 1 (HIGH) if a voltage of 3.3V-24V is applied or 0 (LOW), when 0V-1.3V is applied.

Library Reference

Configuration

eqsp32.pinMode(nn, DIN)

nn: pin index

Usage

eqsp32.readPin(nn, mm)

Returns HIGH/LOW based on trigger mode

nn: pin index

mm: trigger mode (optional, default = STATE)

Switch Input (SWT) – {Special (DIN) mode}

This is a special DIN mode. All pins may operate as SWT, since all pins support digital input mode (DIN). In this mode the digital input value on the pin is debounced using the specified debounce time. If the debounce time is not specified, the default value of 100ms will be used.

The pin value must be stable for at least the debounce time period for it to be registered as the current pin logic level. If the pin values changes (bounces) more frequently than the debounce time is set, the last stable pin logic level will be returned on eqsp32.readPin(nn, mm) call.

EQSP32 industrial IoT controller - Digital input / Switch input wiring example

Library Reference

Configuration

eqsp32.pinMode(nn, SWT)

nn: pin index

eqsp32.configSWT(nn, tt) (*)

nn: pin index

tt: debounce ms (optional, default = 100)

Usage

eqsp32.readPin(nn, mm)

Returns HIGH/LOW based on trigger mode

nn: pin index

mm: trigger mode (optional, default = STATE)

 

(*) If this function is not called, the default values are applied, meaning the SWT pin’s debounce time will be set to 100ms.

nn: Is the pin index and it can be in range [1, 16].

tt: Is the debounce time in ms. This is an optional parameter with default value of 100ms, if omitted.

mm: This parameter sets the trigger mode while reading the pin. It is an optional parameter and the default value is STATE (returning the pin HIGH/LOW state) if omitted.

Analog Input (AIN)

The analog input mode (AIN), measures the analog value of the pin from 0V to 5V and returns the analog value in mV.

EQSP32 industrial IoT controller - Wiring example of analog input

Library Reference

Configuration

eqsp32.pinMode(nn, AIN)

nn: pin index

Usage

eqsp32.readPin(nn)

Returns analog value in mV

nn: pin index

 

Relative Analog Input (RAIN) - {Special (AIN) mode}

This is a special AIN mode. Only pins 1-8 may operate as RAIN, since only these pins support analog input mode (AIN). In this mode the analog value is automatically converted into 0-1000 range with 0 being the GND value and 1000 being the 100% of the reference 5V output supply voltage.

This is a very helpful mode to directly convert the analog input into a usable value. A simple example would to have 3 potentiometers to control the PWM values of an RGB LED strip. By configuring the potentiometers’ pins to RAIN mode, the values may be directly passed as control values for the 3 POUT pins to drive the RGB strip.

EQSP32 industrial IoT controller - Wiring example of analog input

Library Reference

Configuration

eqsp32.pinMode(nn, RAIN)

nn: pin index

Usage

eqsp32.readPin(nn)

Returns a 0 to 1000 value representing 0% to 100% of the 5V supply out reference

nn: pin index

 

Temperature Input (TIN) – {Special (AIN) mode}

This is a special AIN mode. Only pins 1-8 may operate as TIN, since only these pins support analog input mode (AIN). In this mode the analog value is automatically converted into temperature in degrees Celsius.

Although the eqsp32.configTIN() call is optional in pin setup, the temperature measurement will not be accurate unless the respective NTC thermistor parameters are configured using eqsp32.configTIN().

It is strongly recommended to call eqsp32.configTIN(), configuring the NTC beta and reference resistance values, when setting up the pin in TIN mode.

EQSP32 industrial IoT controller - NTC thermistor / Connecting temperature sensor wiring diagram

Library Reference

Configuration

eqsp32.pinMode(nn, TIN)

nn: pin index

eqsp32.configTIN(nn, bb, rr) (*)

nn: pin index

bb: NTC beta value (optional, default = 3988)

rr: NTC resistance at 25C (optional, default = 10000)

Usage

eqsp32.readPin(nn)

Returns the temperature in C

nn: pin index

 

(*) If this function is not called, the default values are applied, meaning for the TIN the NTC beta is set to 3988 and its reference resistance to 10000.

nn: Is the pin index and it can be in range [1, 8].

bb: Is the NTC’s beta value. This is an optional parameter with default value of 3988, if omitted.

rr: Is the NTC’s reference resistance parameter. It is an optional parameter and the default value is 10000, if omitted.

Power PWM Output (POUT)

The power PWM output mode (POUT) is meant to be used to drive up to 1A loads per terminal. In this mode the pin operates in pull-down (open collector) PWM.

Inductive and Non-Inductive loads

This industrial IoT controller incorporates protective diodes for protecting the mosfets from the overvoltage spikes induced by the switching of relays or solenoids. Thus, indictive and non-inductive loads may be connected on the power PWM outputs in the same way.

The following diagrams demonstrate various ways to use the ADIO in power PWM mode.

EQSP32 industrial IoT controller - Inductive load example
EQSP32 industrial IoT controller - Resistive loads wiring example

Driving LED Strips

Due to LEDs lighting up with even a very small current, it is recommended that an optional external pull up is used between the anode and the cathode of the LED strip.

The value of the resistor depends on the efficiency of the LEDs, their number and other factors. Generally, an 1k, 0.5W resistor would be appropriate for most cases.

Example: In the following example a 4.7k resistor is used. Assuming our system runs on 24V but our LED strip is rated for 12V, we may use a separate power supply for our LEDs.

EQSP32 industrial IoT controller - Driving LED strips wiring example

Library Reference

Configuration

eqsp32.pinMode(nn, POUT)

nn: pin index

Usage

eqsp32.pinValue(nn, pp)

nn: pin index

pp: power per 1000 (500 for 50%, 1000 is for 100%)

Relay (RELAY)

This is a special POUT mode. All pins may operate as RELAY, since all pins support Power PWM output mode (POUT). The unique feature of this mode is the automatic power derating to a specified value after a specified time. This drastically reduces the heat and power consumption on the relays, allowing for more relays to be driven from a smaller power supply.

If the minimum holding voltage (MHV) of the relay is not provided and only the nominal or trigger voltage is, then the holding voltage may be experimentally found.
One way to achieve this is by connecting the relay’s coil on an adjustable power supply and apply the nominal voltage. Once the relay is triggered, we slowly reduce the applied voltage until the relay disengages. After finding the voltage on which the relay disengages, we calculate the MHV by the following equation:

Minimum holding PWM ratio = (Vdisengage / Vsupply)

Note: Since the PWM range is from 0 to 1000, reflecting to 0% to 100% we need to multiply the MHV ratio with 1000.

Minimum holding PWM value = (Vdisengage / Vsupply) * 1000

Example:                We have a 24V relay, so for our test we will also use a 24V supply. We measure that the relay disengages at 6V after slowly reducing from 24V.

Minimum holding PWM value = (6V / 24V) * 1000 = 250

To be on the safe side, we don’t want to be exactly on the limit, so we will set the relay’s holding voltage at 50% more that the disengaging voltage.

Desired holding PWM value = 250 + 250 x  = 375

EQSP32 industrial IoT controller - Wiring example of using a relay to drive an AC load like a heater, jets, pumps etc.

Library Reference

Configuration

eqsp32.pinMode(nn, RELAY)

nn: pin index

eqsp32.configRELAY(nn, hh, tt) (*)

nn: pin index

hh: hold power (optional, default = 250)

tt: derate time ms (optional, default = 1000)

Usage

eqsp32.pinValue(nn, pp)

nn: pin index

pp: initial power (1000 is for 100%)

(*) If this function is not called, the default values are applied, meaning the RELAY pin’s hold power will be set to 25% (hh = 250) and the derate time will be set to 1000 (1 second).

nn: Is the pin index and it can be in range [1, 16].

hh: Is the holding power of the relay after the derate time has passed. The value’s range is [0, 1000] and it corresponds to 0% – 100%. This is an optional parameter with default value of 250.

tt: Is the time after which the relay’s power will drop to holding power in ms. This is an optional parameter with default value of 1000ms, if omitted.

pp: This parameter sets the trigger power of the relay. This parameter’s range is [0,1000]. The relay will be triggered at this percentage of its power and it will keep this value until derate time has passed. After the derate time has passed, the relay’s power will drop to holding power until it is set to 0 by the user’s program.

Industrial Communications

Serial - RS232

Standard RS232

For standard RS232 communication, connect EQSP32’s RS232 Tx pin with receiver’s RS232 Rx pin and vice versa.

EQSP32 industrial IoT controller - RS232 wiring example

RS232 to TTL

To communicating using EQSP32’s RS232 port with a TTL level device, like an Arduino, the RS232 Tx signal must be clipped between GND and 5V.

Use external clipping diodes connection the RS232 Tx signal to TTL device’s 5V and GND like shown in the following diagram. To restrict the current flow from the RS232 driver going to the clipping diodes, an in-series resistor is must be used.

EQSP32 industrial IoT controller - RS232 to TTL wiring example

Note:      RS232 signals are inverted by the RS232 driver.

In order for communication to work, apart from clipping the signals to TTL levels, it is also needed to setup the communication on either the EQSP32 or TTL device as INVERTED. For EQSP32 use RS232_INV as serial mode to invert the signal polarity.

Library Reference

Configuration

eqsp32.configSerial(mm, bb)

mm: serial mode RS232 or RS232_INV for inverted polarity

bb: baude rate (optional, default = 115200)

Usage

eqsp32.Serial.{Serial function}

Call Serial from eqsp32 class and use any Serial.{function} like we would normally do

Serial - RS232

Half-Duplex RS485

For standard RS485 half-duplex communication, the wiring is as shown in the following diagram. A termination resistor may be needed depending on the wire length.

EQSP32 industrial IoT controller - RS485 wiring example for half-duplex communication

Library Reference

Configuration

eqsp32.configSerial(mm, bb)

mm: serial mode RS485_TX or RS485_RX for Tx or Rx

bb: baude rate (optional, default = 115200)

Usage

eqsp32.Serial.{Serial function}

Call Serial from eqsp32 class and use any Serial.{function} like we would normally do

CAN-Bus

For CAN-Bus communication it is important to use two 120 Ohm termination resistors on the network.

EQSP32 industrial IoT controller - CAN bus wiring example

Note:      When setting up a CAN network, verify if any of the devices already have internal termination resistors before adding any external termination.

Library Reference

Configuration

eqsp32.configCAN(bb)

bb: baude rate (optional, default = CAN_250K)

Usage

eqsp32.sendCanFrame(mm)

mm: pointer to Tx CANBus message frame

eqsp32.receiveCanFrame(mm)

Returns number of can frames left in Rx queue. If it returns -1, the mm pointer will be null (no messages in queue to read. If it returns 0, the mm pointer has the received frame and no other frames are yet available.

mm: pointer to Rx CANBus message frame

 

Third party libraries – Native pin control

Direct pin control

There might be cases that a custom or an external library is needed for an application. For example, to control an addressable LED panel, run DMX master/slave protocol, Modbus, CANOpen, or other protocols, there are plenty available libraries in the esp32/Arduino community.

To take direct control of any of the ADIO pins or communication peripherals (CAN-Bus, RS232 and RS485), the system needs to be notified to release these pins from the internal control and setup the corresponding hardware for the specific process.

For this purpose, the eqsp32.getPin() function may be used, which will disassociate the corresponding pin from the EQ System Supervisor, prepare the corresponding peripherals and return the native pin mapping for the requested ADIO pin number.

Library Reference

Usage

eqsp32.getPin(pp)

Returns the native pin number (the actual MCU pin number for this ADIO or peripheral pin)

pp: ADIO pin number, can be from EQ_PIN_1, …, EQ_PIN_16 or EQ_RS232_TX, EQ_RS232_RX, …

To use getPin for any of the ADIO pins, the available input values are EQ_PIN_xx, where xx is from 1 to 16, for all 16 ADIOs.

To use RS232, RS485 and CAN peripherals with external/custom libraries the inputs values are:

EQ_RS232_TX       (prepares EQSP32 RS232 peripheral and returns the native TX pin number)

EQ_RS232_RX      (prepares EQSP32 RS232 peripheral and returns the native RX pin number)

EQ_RS485_TX       (prepares EQSP32 RS485 peripheral in receive mode and returns the native TX pin number)

EQ_RS485_RX      (prepares EQSP32 RS485 peripheral in receive mode and returns the native RX pin number)

EQ_RS485_EN      (prepares EQSP32 RS485 peripheral in receive mode and returns the native RS485 Enable pin number, when RS485_EN is HIGH, RS485 will enter transmit mode, when RS485_EN is LOW, it will enter receive mode)

EQ_CAN_TX          (prepares EQSP32 CAN peripheral and returns the native TX pin number)

EQ_CAN_RX          (prepares EQSP32 CAN peripheral and returns the native TX pin number)

Example:

int rs232Tx = eqsp32.getPin(EQ_RS232_TX); // Gets the ESP32 pin number for RS232 transmission.

int rs232Rx = eqsp32.getPin(EQ_RS232_RX); // Gets the ESP32 pin number for RS232 transmission.

 

// Put your custom setup and usage of RS232 by using rs232Tx and rs232Rx pins directly

Programming

The EQSP32 comes with a precompiled proprietary library that provides the user with an API to access all ADIO modes, communications, internal monitoring and database functionality.

When the program is deployed and the library is running, EQ System Supervisor takes care of all background tasks related pin and peripheral update, Bluetooth and WiFi connectivity, database connection and synchronization.

To program EQSP32 connect it with a USB-C and open visual studio code, Arduino IDE or any other esp32 compatible IDE. After installing EQSP32 library, the user should describe their wiring and preferred functionality to EQ-AI pal, start developing the code themselves or a combination of both. Then, simply download and power EQSP32 from the external power supply.

It is important that the .begin() function is called in the setup() section of the user program before any other EQSP32 operation is used.

EQSP32 industrial IoT controller - Programming block diagram

Library Reference

Configuration

eqsp32.begin(cc)

 

cc: proprietary type EQSP32Configs to define API key, database URL and system ID

eqsp32.begin(cc, vv)

 

cc: proprietary type EQSP32Configs to define API key, database URL and system ID (see example below)

vv: enabled verbose (optional, default = false)

eqsp32.begin()

Starts EQSP32 tasks, no IoT functionality enabled

 

Differences between begin() variations

  1. begin(): This is the easiest way to get started. It initializes EQ supervisor to run any local/offline processes. It is ideal if you are now building an IoT system.
  2. begin(cc) or eqsp32.begin(cc, false): Using begin() in either of these ways is suitable for production builds. This disables the verbose option, so no system or other messages will be printed on the terminal by EQ supervisor.
  3. begin(cc, true): It enabled the verbose option, so any system update or issue, will be printed on the USB terminal.

Initial system configurations: EQSP32Configs

#include “EQSP32.h”

EQSP32 eqsp32;

void setup() {

    EQSP32Configs myEQSP32Configs;

    myEQSP32Configs.databaseURL = “Your database URL”;       // Is used to connect to database

    myEQSP32Configs.databaseAPIKey = “Your API key”;             // Is used to connect to database

    myEQSP32Configs.devSystemID = “SystemID”;                         // Custom app needs to have the same “SystemID”

                                                                                                                // to only connect with compatible systems

    eqsp32.begin(myEQSP32Configs, true);                                    // Verbose enabled

   

    //         EQSP32 pin mode initializations and other initialization code

}

Connectivity

Once EQSP32 library is running, use “EQ connect” phone app to connect controller via Bluetooth and configure the WiFi network’s credentials.

Notes:

For EQSP32 to be discoverable via Bluetooth, the Bluetooth LED must be flashing.

If the Bluetooth LED is off, a short press on the boot button will enable BLE advertising for 2 minutes.

EQSP32 industrial IoT controller - EQ connect app to setup your eqsp32 with network credentials

The WiFi network credentials will be stored in the internal flash. Each time EQSP32 starts or restarts, it will automatically try to reconnect on the network.

Even if a new program is downloaded, if not a full flash erase is performed, the wifi credentials will be available for connection.

Note:

To force EQSP32 to disconnect from the WiFi network and erase the WiFi credentials from flash, press and hold the boot button for 3 seconds.

Once EQSP32 is connected to WiFi, it is ready to communicate with the custom user phone application. The provided template for developing customized user applications comes with the database connectivity and handling ready, so the user only needs to adjust the layout for their preference and map the virtual switches (user boolean variables) and virtual variables (user integer variables) for their custom application.

EQSP32 industrial IoT controller - Connecting, controlling and monitoring eqsp32 via a custom user smart phone application. The smart phone applications is supported in both iOS and Android mobile phones.

To access the user cloud parameters (user Boolean variables and user integer variables) use the following commands.

Library Reference

Usage

eqsp32.readUserBool(nn, mm)

Returns HIGH/LOW based on trigger mode

nn: parameter index

mm: trigger mode (optional, default = STATE)

eqsp32.writeUserBool(nn, mm)

nn: parameter index

mm: write value (true or false)

eqsp32.readUserInt(nn)

Returns the stored integer value

nn: parameter index

eqsp32. writeUserInt(nn, mm)

nn: parameter index

mm: write value (integer value)

Boot & Reset

Reset

Press and release the “Reset” button to restart the device.

Boot

A short tap on “Boot” button enables BLE advertising and EQSP32 will be discoverable from EQConnect app.

Press and hold “Boot” button for at least 3 seconds to force the device to disconnect and forget the currently configured WiFi network.

Expansion Modules

EQSP32 has an expansion connector for adding additional functionality for niche and tailor-made applications.

Warning:    Before connecting any expansion module, make sure that EQSP32 is powered off.

To add an expansion module, mount it on the DIN rail next to EQSP32 and gently slide it until the expansion module’s connector is completely inserted in the main EQSP32 controller.

After powering up the EQSP32, the expansion module detection will run automatically on boot by the proprietary EQSP32 library. Once boot is done, all additional values will be available locally and in the database.

EQSP32 industrial IoT controller - Expansion modules

Mechanical Dimensions

All dimensions are measured in mm with a +/-0.1 tolerance.