background image

ESP32LR42

                                                             User Manual v1.02

MS Sets the MQTT broker address

MS “192.168.0.121”
OK. Saved MQTT Server: 192.168.0.121

MD Sets the MQTT ID for this module

MS “UniqueModuleName”
OK. Saved MQTT ID:  UniqueModuleName

MP Sets the MQTT broker’s port.

Normally, 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.

R1-R4

Sets the MQTT topic this relay is subscribed to.

R3 "Workshop/Heater"
OK. Saved Relay 3 Topic: Workshop/Heater

In use, the payload for relay topics should be a string with the first character set to ‘0’ or ‘1’
(ASCII characters 0x31/0x30). 

N1-N2

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 

© 2018,

 Devantech Ltd.

All rights reserved.

www.robot-electronics.co.uk

7

Summary of Contents for ESP32LR42

Page 1: ...ESP32LR42 User Manual v1 02 ESP32LR42 User Manual Version 1 02 Copyright 2018 Devantech Ltd All rights reserved www robot electronics co uk 1 ...

Page 2: ... password 6 PA Sets the TCP IP port number for the ASCII commands 6 MS Sets the MQTT broker address 7 MD Sets the MQTT ID for this module 7 MP Sets the MQTT broker s port 7 R1 R4 Sets the MQTT topic this relay is subscribed to 7 N1 N2 Sets the MQTT topic this Input will publish to 7 TCP IP Commands 8 SR Set Relay 8 GR Get Relay 9 GI Get Input 9 AL Get All 2 inputs 9 HTML Commands 10 Webpage 11 Sch...

Page 3: ...ain text commands sent to the module 2 HTML commands 3 MQTT 4 A built in webpage WiFi The ESP32LR42 connects via 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 c...

Page 4: ...e IP address is set to 0 0 0 0 this means that the IP address is being provided by your networks DHCP server In that case the assigned IP address is also provided as above When the SSID and Password are setup they will be displayed until the next reset After that they will only show as RB ReBoot This will restart the module It may produce a lot of random characters as the ESP32 s boot logging runs...

Page 5: ... normally the IP address of your router GW 192 168 0 1 OK Saved Gateway Address 192 168 0 1 PD Sets the Primary DNS The can be the IP address of your router which will then use your ISP provided DNS You can also specify the DNS such as 8 8 8 8 for Googles DNS server PD 192 168 0 1 OK Saved Primary DNS 192 168 0 1 SD Sets the Secondary DNS The can be the IP address of your router which will then us...

Page 6: ...FI 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 ASCII commands PA 17126 OK Saved ASCII port number 17126 Copyright 2018 Devantech Ltd All rights reserved www robot electronics co uk 6 ...

Page 7: ...ere is no MQTT broker R1 R4 Sets the MQTT topic this relay is subscribed to R3 Workshop Heater OK Saved Relay 3 Topic Workshop Heater In use the payload for relay topics should be a string with the first character set to 0 or 1 ASCII characters 0x31 0x30 N1 N2 Sets the MQTT topic this Input will publish to N2 Workshop Heater OK Saved Input 2 Topic Workshop Heater The payload generated for input to...

Page 8: ...ring 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 ...

Page 9: ...t GI Get Input Will return the status of an input GI 2 0 Input 2 is low Green Led is on GI 2 Input 2 is high Green Led is off 1 GI 9 fail Only 2 inputs available AL Get All 2 inputs AL 10 Here Input 2 is low all others are high Inputs are numbered from left to right 1 to 2 Copyright 2018 Devantech Ltd All rights reserved www robot electronics co uk 9 ...

Page 10: ...mediately 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 ESP32LR42DATA RELAYS RLY1 off RLY1 RLY2 on RLY2 RLY3 on RLY3 RLY4 on RLY4 RELAYS INPUTS INP1 1 INP1 INP2 0 INP2 INPUTS ESP32LR42DATA The XML file is generated after the command has executed therefore will reflect the new status of the relay...

Page 11: ... 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 2018 Devantech Ltd All rights reserved www robot electronics co uk 11 ...

Page 12: ...chematics CPU Note The CPU schematic is the same for the ESP32LR20 ESP32LR42 and ESP32LR88 Relays 5 8 and Inputs 3 8 are not available on the ESP32LR42 Copyright 2018 Devantech Ltd All rights reserved www robot electronics co uk 12 ...

Page 13: ...ESP32LR42 User Manual v1 02 Power Supply Copyright 2018 Devantech Ltd All rights reserved www robot electronics co uk 13 ...

Page 14: ...uits shown The relays are capable of switching up to 16 Amps at 24vdc or 230vac A data sheet of the relay can be found here Only the normally open N O contact has the snubber circuitry Copyright 2018 Devantech Ltd All rights reserved www robot electronics co uk 14 ...

Page 15: ...up resistor to 3 3v and will operate with a simple contact closure to ground Alternatively they may be connected to 3 3v logic The clamping diodes prevent operation at voltages higher than 3 3v so don t connect to 5v logic Copyright 2018 Devantech Ltd All rights reserved www robot electronics co uk 15 ...

Page 16: ...ESP32LR42 User Manual v1 02 PCB dimensions Copyright 2018 Devantech Ltd All rights reserved www robot electronics co uk 16 ...

Page 17: ...ESP32LR42 User Manual v1 02 Notes Copyright 2018 Devantech Ltd All rights reserved www robot electronics co uk 17 ...

Reviews: