background image

ESP32SR88

                                                              User Manual v1.7

HTML Commands.

There are a set of HTML commands that can be used to control the module.
?Rly3=1This will turn on relay 3
?Rly3=0This will turn off relay 3
?Rly3=2This will toggle relay 3 to the opposite state.

You can enter the commands into a browser immediately after the IP address.

http://192.168.0.3/?Rly3=1

This will turn on relay 3. 
In response the module will return an XML file, which your browser will display.

<?xml version="1.0" encoding="UTF-8"?>
<ESP32SR88DATA>

<RELAYS>

<RLY1>off</RLY1>
<RLY2>off</RLY2>
<RLY3>on</RLY3>
<RLY4>off</RLY4>
<RLY5>off</RLY5>
<RLY6>off</RLY6>
<RLY7>off</RLY7>
<RLY8>off</RLY8>

</RELAYS>
<INPUTS>

<INP1>1</INP1>
<INP2>1</INP2>
<INP3>1</INP3>
<INP4>1</INP4>
<INP5>1</INP5>
<INP6>0</INP6>
<INP7>1</INP7>
<INP8>1</INP8>

</INPUTS>

</ESP32SR88DATA>

The XML file is generated after the command has executed, therefore will reflect the new status of the 
relays.

Copyright 

© 2021,

 Devantech Ltd.

All rights reserved.

www.robot-electronics.co.uk

12

Summary of Contents for ESP32SR88

Page 1: ...ESP32SR88 User Manual v1 7 ESP32SR88 User Manual Version 1 7 Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 1 ...

Page 2: ...I commands 7 MS Sets the MQTT broker address 7 MD Sets the MQTT ID for this module 7 MP Sets the MQTT broker s port 8 MU Sets the MQTT user name V1 6 8 MW Sets the MQTT password V1 6 8 R1 R8 Sets the MQTT topic this relay is subscribed to 9 N1 N8 Sets the MQTT topic this Input will publish to 9 TCP IP Commands 10 SR Set Relay 10 GR Get Relay 11 GI Get Input 11 AL Get All 8 inputs 11 HTML Commands ...

Page 3: ...he module 2 HTML commands 3 MQTT 4 A built in webpage WiFi The ESP32SR88 connects via 2 4GHz WiFi to your network therefore it must be located in a position where it gets a good WiFi signal The module should not be enclosed in a metal box cabinet as this will shield the WiFi signal You can check the signal level by looking at the RSSI figure which is reported by the ST STatus command Configuration...

Page 4: ...ic Relay2 Topic R2Topic Relay3 Topic R3Topic Relay4 Topic R4Topic Relay5 Topic R5Topic Relay6 Topic R6Topic Relay7 Topic R7Topic Relay8 Topic R8Topic Input1 Topic myNew TopicA Input2 Topic myNew TopicB Input3 Topic N3Topic Input4 Topic N4Topic Input5 Topic N5Topic Input6 Topic N6Topic Input7 Topic N7Topic Input8 Topic N8Topic When the IP address is set to 0 0 0 0 this means that the IP address is ...

Page 5: ...5 Q WiFi connected IP address 192 168 0 6 IP Sets the modules IP address Enter IP followed by the required IP address Entering address 0 0 0 0 means the IP will be obtained from your networks DHCP server The new IP address will take effect after the next re boot IP 192 168 0 123 OK Saved IP Address 192 168 0 123 SB Sets the SuBnet mask SB 255 255 255 0 OK Saved Subnet Mask 255 255 255 0 GW Sets th...

Page 6: ... use your ISP provided DNS You can also specify the DNS such as 8 8 4 4 for Googles DNS server SD 8 8 4 4 OK Saved Secondary DNS 8 8 4 4 SS This sets the SSID The SSID is the public name of your WIFI network Enter your WIFI s SSID here SS Devantech OK Saved SSID Devantech PW Sets your networks WIFI password PW K kCZUV UGA6SG OK Saved Password K kCZUV UGA6SG PA Sets the TCP IP port number for the A...

Page 7: ...ally this should be set to 1883 mp 1883 OK Saved MQTT port number 1883 If you are not using MQTT set the port to 0 This will turn off MQTT otherwise it will continuously try to connect if there is no MQTT broker MU Sets the MQTT user name V1 6 This is for MQTT brokers that are setup to require a username and password For open MQTT brokers that do not require a user name password these may be ignor...

Page 8: ...QTT password V1 6 This is for MQTT brokers that are setup to require a username and password MW mySuperSecretPassword OK Saved MQTT Password mySuperSecretPassword Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 8 ...

Page 9: ...er set to 0 or 1 ASCII characters 0x31 0x30 N1 N8 Sets the MQTT topic this Input will publish to N2 Workshop Heater OK Saved Input 2 Topic Workshop Heater The payload generated for input topics is a string with the first character set to 1 if the input is open or unconnected and 0 if the input pins are shorted ASCII characters 0x31 0x30 Copyright 2021 Devantech Ltd All rights reserved www robot el...

Page 10: ...ing USB configuration Do not use port 80 as that is reserved for the HTML commands and Webpage SR Set Relay This is used to turn a relay on or off To turn Relay 1 on SR 1 1 The first number is the relay number from 1 to 8 The second number is 1 or 0 on or off So turn turn relay 1 off again SR 1 0 The command will respond with ok or fail SR 1 1 ok SR 1 6 fail 6 is not valid only 1 or 0 for on off S...

Page 11: ...uts AL 11111011 Here Input 6 is low all others are high Inputs are numbered from left to right 1 to 8 Password From version 1 5 we have added a password to the ASCII commands this can be set with the AP command over the USB connection The password is passed as a prefix to any command For example if a password is set and relay 1 is required to be turned on start with the password example password o...

Page 12: ... response the module will return an XML file which your browser will display xml version 1 0 encoding UTF 8 ESP32SR88DATA RELAYS RLY1 off RLY1 RLY2 off RLY2 RLY3 on RLY3 RLY4 off RLY4 RLY5 off RLY5 RLY6 off RLY6 RLY7 off RLY7 RLY8 off RLY8 RELAYS INPUTS INP1 1 INP1 INP2 1 INP2 INP3 1 INP3 INP4 1 INP4 INP5 1 INP5 INP6 0 INP6 INP7 1 INP7 INP8 1 INP8 INPUTS ESP32SR88DATA The XML file is generated aft...

Page 13: ...or by specifying index htm The webpage contains the Javascript to send an HTML toggle command as described in the previous section It will send the toggle command each time a button is clicked It then uses the responding XML file to colour the buttons and set the Input buttons to indicate input status Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 13 ...

Page 14: ...ESP32SR88 User Manual v1 7 Schematics CPU Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 14 ...

Page 15: ...ESP32SR88 User Manual v1 7 Power Supply Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 15 ...

Page 16: ...8 User Manual v1 7 Relay Outputs 1 of 8 identical circuits shown The relays are capable of switching up to 1 Amp at 30vdc or 30vac Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 16 ...

Page 17: ...ESP32SR88 User Manual v1 7 Digital Inputs Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 17 ...

Page 18: ...ESP32SR88 User Manual v1 7 PCB dimensions Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 18 ...

Page 19: ... be achieved by using the Arduino studio and importing the required libraries Step 1 Arduino IDE installation Obtain and install the latest Arduino IDE from https www arduino cc en Main Software it should be the latest to ensure compatibility Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 19 ...

Page 20: ...ow we need to enter https dl espressif com dl package_esp32_index json into the Additional Board Manager URLs option If you already have libraries added you may need to add a comma between the URLs You can now click the OK button to finish with this screen Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 20 ...

Page 21: ...ESP32SR88 User Manual v1 7 Step 3 Install the ESP32 library Go to Tools Board Boards Manager Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 21 ...

Page 22: ...ESP32SR88 User Manual v1 7 Now filter by esp32 and install the Espressif Systems library Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 22 ...

Page 23: ...ESP32SR88 User Manual v1 7 Step 4 Board selection Go to Tools Board and select ESP32 Dev Module Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 23 ...

Page 24: ...ent and select PubSubClient by Nick O Leary then press the install button That s it Your Arduino IDE should now be able to program the ESP32SR88 module The factory shipped code is available Here https github com devantech Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 24 ...

Page 25: ...ESP32SR88 User Manual v1 7 Notes Copyright 2021 Devantech Ltd All rights reserved www robot electronics co uk 25 ...

Reviews: