Dingtian IOT Relay

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Dingtian IOT Relay

#1 Post by iron » 25 Dec 2021, 19:23

Season Greetings !!

I bought one of these a few days ago

https://www.aliexpress.com/item/4001232 ... 4c4dIETQ8P

A board with either 2+2, 4+4 or 8+8 IOs, WiFi, LAN. and/or either RS485 or CAN, supports Http, Https, MQTT, CoAP has Domoticz plugin and an extensive how-to Home Assistant support.

Initially those boards came with an STM processor + LAN chip and used an ESP-O1 for wifi.

In the last hardware revision both have been replaced by an ESP32 + LAN chip

I got the 8 I/O version (8xRelays + 8xInputs) but there are also 2 SPI chips (1 for the 8xOUT and another for the 8xIN) most likely due to the GPIO count of the ESP32 is less than the previously used STM

The so called SDK from the manufacturer is here :

http://www.dingtian-tech.com/sdk/

The User Manual (in the .zip) goes in depth about all aspects.

At a first glance seems to be a product targeted to "our crowd" well priced for what it does out of the box.

Of course ESPEasy is our goal, so in the next couple of days will see what needs to be supported before flashing it.

Time for some turkey left overs :)
-D

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#2 Post by TD-er » 25 Dec 2021, 21:27

Hmm strange board.
Ethernet alone does need quite a lot of pins on an ESP32, so if it needs only an ESP-01 then I wonder what is running on that large chip next to the lan chip.

There are pictures too of a version with an ESP32 on it, which looks like it might be easy to make it work in ESPEasy.
But the one for ESP-01 is very likely not going to work without an incredible amount of work.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Dingtian IOT Relay

#3 Post by iron » 25 Dec 2021, 22:08

TD-er wrote: 25 Dec 2021, 21:27 Hmm strange board.
Ethernet alone does need quite a lot of pins on an ESP32, so if it needs only an ESP-01 then I wonder what is running on that large chip next to the lan chip.

There are pictures too of a version with an ESP32 on it, which looks like it might be easy to make it work in ESPEasy.
But the one for ESP-01 is very likely not going to work without an incredible amount of work.
The version I have is the ESP32 one. As quoted on the image as "Version 2" (the one on the right)

Image

This is ESP32 only (no STM, no ESP-01) therefore I assume they used the SPI chips for the 8+8 GPIOs
-D

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#4 Post by TD-er » 26 Dec 2021, 01:10

Hmm apparently they ship at random either a version with ESP32 or the 8-pin header for an ESP-01.
You can't select the one with ESP32 to be shipped.

From an ESPEasy point of view, only the ESP32 version could be useful.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Dingtian IOT Relay

#5 Post by iron » 26 Dec 2021, 10:28

Those are the 8 x Input and 8 x output chips. We support those ?
Attachments
Pinout-74HC595-Shift-Register.png
Pinout-74HC595-Shift-Register.png (18.22 KiB) Viewed 30873 times
Pinout-74HC165-Shift-Register.png
Pinout-74HC165-Shift-Register.png (174.22 KiB) Viewed 30873 times
-D

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#6 Post by TD-er » 26 Dec 2021, 12:28

74hc595 and 74HC165 are shift register chips, not really a GPIO extender.
Not supported though.

Those can be useful, but are rather tricky to use.
For example if you want to update 1 output you may need to rewrite all of them, depending on their current state.
This means they may toggle their state during update.
They can also be used to store a burst of serial bits, but I doubt that's how they are connected.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#7 Post by Ath » 26 Dec 2021, 17:13

For those shift registers there was a request a couple of months back, and if we add that, also the 74HC151 series of input registers should be considered (there is already a start in the Playgound) (thought they do not have much resemblance, other than also being shift registers but then for input :D)

These output shift registers are latched, so the state has to be kept in memory to be able to update a single output, and all outputs are updated simultaneously after the data is shifted in.
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#8 Post by Ath » 27 Dec 2021, 10:34

While investigation the possible use of 74HC595, a couple of months back, I already found this Arduino library (OSS) that supports these chips quite comfortably.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#9 Post by TD-er » 27 Dec 2021, 10:55

I would like to see hoe these are being used in this board first.
So if you can dig up some schematic, that would be the first step I guess.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Dingtian IOT Relay

#10 Post by iron » 01 Jan 2022, 20:23

TD-er wrote: 27 Dec 2021, 10:55 I would like to see hoe these are being used in this board first.
So if you can dig up some schematic, that would be the first step I guess.
Information from Dingtian direct

Hope this helps with the implementation
Attachments
8ch_pinout.png
8ch_pinout.png (31.12 KiB) Viewed 30570 times
-D

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#11 Post by TD-er » 01 Jan 2022, 21:16

Hmm the one that seems a bit scary is GPIO-0.
A reset pin on the ethernet interface is very welcome, but that can also be done via a pwr pin
Not sure if it is essentially the same.
If not, then it might be a bit problematic to flash these units as the eth module does easilly take 100 mA if powered.
This may be too much for most USB flash boards.

syldes
New user
Posts: 4
Joined: 05 Jan 2022, 11:49

Re: Dingtian IOT Relay

#12 Post by syldes » 24 Jan 2022, 11:43

Hello, do somebody has news on this topic ?
I'm also wondering if this board could be used with ESP Easy.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#13 Post by TD-er » 24 Jan 2022, 11:48

See the progress on the support for the shift registers used on this board: https://github.com/letscontrolit/ESPEasy/pull/3917
So even though Ton doesn't have such a board (yet?), nor those chips, he still managed to make a very usable plugin for it.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Dingtian IOT Relay

#14 Post by iron » 24 Jan 2022, 13:13

TD-er wrote: 24 Jan 2022, 11:48 See the progress on the support for the shift registers used on this board: https://github.com/letscontrolit/ESPEasy/pull/3917
So even though Ton doesn't have such a board (yet?), nor those chips, he still managed to make a very usable plugin for it.
Does this plugin support the 74HC165 as well ?

Shall I try to flash the sample on hand or is it not time for this yet ?
-D

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#15 Post by Ath » 24 Jan 2022, 13:44

TD-er wrote: 24 Jan 2022, 11:48 So even though Ton doesn't have such a board (yet?), nor those chips, he still managed to make a very usable plugin for it.
Didn't order the board, and probably won't as you can't select having the ESP32 version explicitly (it's not even listed on their site :shock:), and that's the only one I'd want (though it is a bit pricey).
Do have a 74HC595 chip laying around, and can obtain a 74HC165 easily, so, OK, I'll bite, I'll reserve Plugin ID P129 for the Input - 74HC165 Shiftregisters, and create a plugin for that soon. :lol:
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#16 Post by Ath » 24 Jan 2022, 13:46

iron wrote: 24 Jan 2022, 13:13 Does this plugin support the 74HC165 as well ?

Shall I try to flash the sample on hand or is it not time for this yet ?
No, the 74HC595 plugin is for output only.

Yes, if you can test your board with P126, I'm very interested in your findings.
/Ton (PayPal.me)

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Dingtian IOT Relay

#17 Post by iron » 24 Jan 2022, 14:03

Ath wrote: 24 Jan 2022, 13:46
iron wrote: 24 Jan 2022, 13:13 Does this plugin support the 74HC165 as well ?

Shall I try to flash the sample on hand or is it not time for this yet ?
No, the 74HC595 plugin is for output only.

Yes, if you can test your board with P126, I'm very interested in your findings.
This will be going over UART, so will require an ETH-factory.bin that I can not locate in the plugin's Actions builds ?
-D

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#18 Post by Ath » 24 Jan 2022, 14:11

iron wrote: 24 Jan 2022, 14:03 This will be going over UART, so will require an ETH-factory.bin that I can not locate in the plugin's Actions builds ?
The factory bin file is included with every ESP32 build, so you can just pick the TEST_E build (or MAX if the ESP has 16 MB Flash), with _ETH in the name.

Just download the Binaries.zip file from here: https://github.com/letscontrolit/ESPEas ... 1737088879
/Ton (PayPal.me)

syldes
New user
Posts: 4
Joined: 05 Jan 2022, 11:49

Re: Dingtian IOT Relay

#19 Post by syldes » 25 Jan 2022, 22:48

I got in touch with "dtwonder Store" on Aliexpress regarding the random delivery between v1 or v2 of the board. They explained that if we send them a message, they will send v2.
Of course if it's not the case, I believe you're just out of luck, and not sure you could expect an exchange...
Attachments
aliexpress-relay-board-esp32.png
aliexpress-relay-board-esp32.png (30.62 KiB) Viewed 29720 times

timokovanen
Normal user
Posts: 10
Joined: 17 Feb 2022, 20:49

Re: Dingtian IOT Relay

#20 Post by timokovanen » 21 Feb 2022, 11:23

DT-R008_programming_header.png
DT-R008_programming_header.png (347.64 KiB) Viewed 28863 times
I tried to flash ESP32_4M316k_ETH-factory.bin to DT-R008.
Now serial is loopping:
rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

Trying next with stronger 3.3V source..

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#21 Post by Ath » 21 Feb 2022, 11:39

If no previous install of ESPEasy was flashed on the device, then it might be helpful to first flash blank_4MB.bin onto it, and after that has succeeded, flash the factory.bin you mentioned.
It might find incompatible configuration data during boot in places that are not overwritten by a normal flash write/update action.
/Ton (PayPal.me)

timokovanen
Normal user
Posts: 10
Joined: 17 Feb 2022, 20:49

Re: Dingtian IOT Relay

#22 Post by timokovanen » 21 Feb 2022, 12:52

Erase, blank_4MB.bin, factory.bin. Same problem.
esptool verify_flash passes ok.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#23 Post by Ath » 21 Feb 2022, 12:57

Does that error persist after a power-cycle? Sometimes the reboot doesn't work as intended
/Ton (PayPal.me)

timokovanen
Normal user
Posts: 10
Joined: 17 Feb 2022, 20:49

Re: Dingtian IOT Relay

#24 Post by timokovanen » 21 Feb 2022, 13:43

Ath wrote: 21 Feb 2022, 12:57 Does that error persist after a power-cycle? Sometimes the reboot doesn't work as intended
Sure, I power-cycled between all steps and afterwards.
Tried also flash simple Serial Hello World with Arduino IDE after blank_4MB but the problem persist.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Dingtian IOT Relay

#25 Post by iron » 21 Feb 2022, 14:14

IO0 is used by LAN (RMII_RST) so I tend to believe my failed attempts are due to this

https://docs.espressif.com/projects/esp ... ction.html

Steven's (Dingtian guy) exact words were :

"...For current relay board in your hand, it cannot support develop and program to your firmware by UART..."

I now, after many failed attempts, tend to believe he knows what he is talking about but I am still wondering what he does in his driver the get away with it ?
-D

timokovanen
Normal user
Posts: 10
Joined: 17 Feb 2022, 20:49

Re: Dingtian IOT Relay

#26 Post by timokovanen » 21 Feb 2022, 14:51

iron wrote: 21 Feb 2022, 14:14 IO0 is used by LAN (RMII_RST) so I tend to believe my failed attempts are due to this
Need to check closer. Anyway, I'll have to pull IO0 down before flashing..

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#27 Post by TD-er » 21 Feb 2022, 15:06

Looks like the LAN crystal is connected to GPIO-0.
But then there must be another pin on the ESP to delay starting the LAN (or the crystal) or else the ESP will boot in flash mode about half of the time.
Maybe you can also pull down that pin?
Not sure how the crystal is connected to GPIO-0.
Some would include a resistor in series, so you can pull down the pin without pulling down the crystal clock output too hard.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Dingtian IOT Relay

#28 Post by iron » 21 Feb 2022, 19:37

But Steven's software design works in this hardware setup.

I have been meaning to remove the ESP32 and flash it as a standard unit, then solder it back but not found the time yet.

I think once the node is initialized apart from the main PCB, then it will boot as expected.
-D

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#29 Post by TD-er » 21 Feb 2022, 19:50

But I think that's not needed.
As long as you can prevent the external crystal for the LAN adapter to start, you can flash it.
Maybe hard short circuit GPIO-0 and GND (or use a 470 Ohm resistor to be sure) and then power it on.
This will turn the ESP into flash mode for sure.
You then need to remove (or disconnect) this short to boot into normal mode again.

ESP32 does act different on the state of GPIO 0 at boot, when power cycled or during a warm boot.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Dingtian IOT Relay

#30 Post by iron » 21 Feb 2022, 19:56

Makes sense and will prove this point (or not).
Will try to make the time for this tomorrow.
-D

timokovanen
Normal user
Posts: 10
Joined: 17 Feb 2022, 20:49

Re: Dingtian IOT Relay

#31 Post by timokovanen » 21 Feb 2022, 20:13

TD-er wrote: 21 Feb 2022, 19:50 Maybe hard short circuit GPIO-0 and GND (or use a 470 Ohm resistor to be sure) and then power it on.
This will turn the ESP into flash mode for sure.
That's exactly what I did. Flash completes and you can even verify it. The problem is bring it alive after flashing.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#32 Post by TD-er » 21 Feb 2022, 20:19

Also after a power cycle?
Eventually you have to get it to boot, as there is a 50/50 chance it will boot with the GPIO-0 in a high state.

I assume you have flashed the "factory" build?

You can also try to flash a build from this pending PR: https://github.com/letscontrolit/ESPEasy/pull/3845
Those will have a new bootloader and the flash frequency is set to 40 MHz instead of 80 MHz.

timokovanen
Normal user
Posts: 10
Joined: 17 Feb 2022, 20:49

Re: Dingtian IOT Relay

#33 Post by timokovanen » 21 Feb 2022, 20:33

TD-er wrote: 21 Feb 2022, 20:19 Also after a power cycle?
Eventually you have to get it to boot, as there is a 50/50 chance it will boot with the GPIO-0 in a high state.

I assume you have flashed the "factory" build?

You can also try to flash a build from this pending PR: https://github.com/letscontrolit/ESPEasy/pull/3845
Those will have a new bootloader and the flash frequency is set to 40 MHz instead of 80 MHz.
No luck. And yes, with a factory build. Tested both with and without ETH. Tested build with WT32-ETH01 -> ok.
Tested also simple Arduino serial program that works with WT32-ETH01. Both Arduino IDE and PlatformIO can flash the relay board.
Flashed all kind of projects with separate bootloader.bin and partitiontable.bin without success.

EDIT: What I'm trying to say is, whatever I flash to the relay unit, I get same error after power cycle.

I'll try PR..

timokovanen
Normal user
Posts: 10
Joined: 17 Feb 2022, 20:49

Re: Dingtian IOT Relay

#34 Post by timokovanen » 21 Feb 2022, 21:08

TD-er wrote: 21 Feb 2022, 20:19 You can also try to flash a build from this pending PR: https://github.com/letscontrolit/ESPEasy/pull/3845
Those will have a new bootloader and the flash frequency is set to 40 MHz instead of 80 MHz.
Tested pull/3845:
esptool.exe --chip esp32 --port COM7 --baud 115200 write_flash 0x00000 ESPEasy\dist\bin\blank_4MB.bin
esptool.py v3.1
Serial port COM7
Connecting.....
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 94:xx:xx:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x003fffff...
Compressed 4194304 bytes to 4086...
Wrote 4194304 bytes (4086 compressed) at 0x00000000 in 27.0 seconds (effective 1240.8 kbit/s)...
Hash of data verified.

esptool.exe --chip esp32 --port COM7 --baud 115200 write_flash 0x00000 ESPEasy\build_output\bin\ESP_Easy_mega_20220221_normal_ESP32_4M316k_ETH.factory.bin
esptool.py v3.1
Serial port COM7
Connecting...
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 94:xx:xx:xx:xx:xx
Stub is already running. No upload is necessary.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00142fff...
Compressed 1321808 bytes to 864828...
Wrote 1321808 bytes (864828 compressed) at 0x00000000 in 76.3 seconds (effective 138.6 kbit/s)...
Hash of data verified.

Power Cycle (IO0 pull down & programming header removed)
Power On
Serial cable attached:
rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#35 Post by TD-er » 21 Feb 2022, 21:56

Could it be that the fuses are set to only accept a signed bin file?
Not sure how to read the fuses using the esptool.py, but I've read about those fuses.

Simply put, if you flash a signed image, the next signed fuse (one time programmable bit) is burned.
If the nr of "signed" fuses is odd, then you can only boot a bin which is signed with the same key as the current one.
To remove this, you need to burn the next fuse.

Only you can do this a (very) limited number of times.
Not sure, but I think there are like 6 or 8 of those bits/fuses to burn.

timokovanen
Normal user
Posts: 10
Joined: 17 Feb 2022, 20:49

Re: Dingtian IOT Relay

#36 Post by timokovanen » 22 Feb 2022, 12:15

DT-R008 Fuse summary

Code: Select all

espefuse.py v3.2
EFUSE_NAME (Block) Description  = [Meaningful Value] [Readable/Writeable] (Hex Value)
----------------------------------------------------------------------------------------
Calibration fuses:
BLK3_PART_RESERVE (BLOCK0):                        BLOCK3 partially served for ADC calibration data   = False R/W (0b0)
ADC_VREF (BLOCK0):                                 Voltage reference calibration                      = 1121 R/W (0b00011)

Config fuses:
XPD_SDIO_FORCE (BLOCK0):                           Ignore MTDI pin (GPIO12) for VDD_SDIO on reset     = False R/W (0b0)
XPD_SDIO_REG (BLOCK0):                             If XPD_SDIO_FORCE, enable VDD_SDIO reg on reset    = False R/W (0b0)
XPD_SDIO_TIEH (BLOCK0):                            If XPD_SDIO_FORCE & XPD_SDIO_REG                   = 1.8V R/W (0b0)
CLK8M_FREQ (BLOCK0):                               8MHz clock freq override                           = 52 R/W (0x34)
SPI_PAD_CONFIG_CLK (BLOCK0):                       Override SD_CLK pad (GPIO6/SPICLK)                 = 0 R/W (0b00000)
SPI_PAD_CONFIG_Q (BLOCK0):                         Override SD_DATA_0 pad (GPIO7/SPIQ)                = 0 R/W (0b00000)
SPI_PAD_CONFIG_D (BLOCK0):                         Override SD_DATA_1 pad (GPIO8/SPID)                = 0 R/W (0b00000)
SPI_PAD_CONFIG_HD (BLOCK0):                        Override SD_DATA_2 pad (GPIO9/SPIHD)               = 0 R/W (0b00000)
SPI_PAD_CONFIG_CS0 (BLOCK0):                       Override SD_CMD pad (GPIO11/SPICS0)                = 0 R/W (0b00000)
DISABLE_SDIO_HOST (BLOCK0):                        Disable SDIO host                                  = False R/W (0b0)

Efuse fuses:
WR_DIS (BLOCK0):                                   Efuse write disable mask                           = 388 R/W (0x0184)
RD_DIS (BLOCK0):                                   Efuse read disable mask                            = 3 R/W (0x3)
CODING_SCHEME (BLOCK0):                            Efuse variable block length scheme
   = NONE (BLK1-3 len=256 bits) R/W (0b00)
KEY_STATUS (BLOCK0):                               Usage of efuse block 3 (reserved)                  = False R/W (0b0)

Identity fuses:
MAC (BLOCK0):                                      Factory MAC Address
   = 94:3c:c6:9b:e1:5c (CRC 0xd8 OK) R/W
MAC_CRC (BLOCK0):                                  CRC8 for factory MAC address                       = 216 R/W (0xd8)
CHIP_VER_REV1 (BLOCK0):                            Silicon Revision 1                                 = True R/W (0b1)
CHIP_VER_REV2 (BLOCK0):                            Silicon Revision 2                                 = False R/W (0b0)
CHIP_VERSION (BLOCK0):                             Reserved for future chip versions                  = 2 R/W (0b10)
CHIP_PACKAGE (BLOCK0):                             Chip package identifier                            = 1 R/W (0b001)
MAC_VERSION (BLOCK3):                              Version of the MAC field                           = 0 R/W (0x00)

Security fuses:
FLASH_CRYPT_CNT (BLOCK0):                          Flash encryption mode counter                      = 1 R/- (0b0000001)
UART_DOWNLOAD_DIS (BLOCK0):                        Disable UART download mode (ESP32 rev3 only)       = False R/- (0b0)
FLASH_CRYPT_CONFIG (BLOCK0):                       Flash encryption config (key tweak bits)           = 15 R/W (0xf)
CONSOLE_DEBUG_DISABLE (BLOCK0):                    Disable ROM BASIC interpreter fallback             = True R/W (0b1)
ABS_DONE_0 (BLOCK0):                               Secure boot V1 is enabled for bootloader image     = True R/W (0b1)
ABS_DONE_1 (BLOCK0):                               Secure boot V2 is enabled for bootloader image     = False R/W (0b0)
JTAG_DISABLE (BLOCK0):                             Disable JTAG                                       = True R/W (0b1)
DISABLE_DL_ENCRYPT (BLOCK0):                       Disable flash encryption in UART bootloader        = True R/W (0b1)
DISABLE_DL_DECRYPT (BLOCK0):                       Disable flash decryption in UART bootloader        = True R/W (0b1)
DISABLE_DL_CACHE (BLOCK0):                         Disable flash cache in UART bootloader             = True R/W (0b1)
BLOCK1 (BLOCK1):                                   Flash encryption key
   = ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? -/-
BLOCK2 (BLOCK2):                                   Secure boot key
   = ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? -/-
BLOCK3 (BLOCK3):                                   Variable Block 3
   = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W

Flash voltage (VDD_SDIO) determined by GPIO12 on reset (High for 1.8V, Low/NC for 3.3V).

timokovanen
Normal user
Posts: 10
Joined: 17 Feb 2022, 20:49

Re: Dingtian IOT Relay

#37 Post by timokovanen » 22 Feb 2022, 13:47

Well, It seems that the chip is programmed in Release Mode with Secure Boot V1, Flash Encryption and Fuse Write protection set.

https://docs.espressif.com/projects/esp ... lease-mode

I'm giving up with original chip, going to replace it with a fresh one. Just ordered some ESP32-WROOM-32D chips and programmer with a socket.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Dingtian IOT Relay

#38 Post by TD-er » 22 Feb 2022, 15:22

While you're at it, order them with 16M flash

bruno17
New user
Posts: 3
Joined: 10 Mar 2022, 22:58

Re: Dingtian IOT Relay

#39 Post by bruno17 » 10 Mar 2022, 23:40

I have replaced ESp32 by a new one on Dingtian IOT relay 8 and upload EPSEasy with Add 74HC595 Shiftregisters plugin. Somebody can explain me how work?
Attachments
ESPEasy1.PNG
ESPEasy1.PNG (53.76 KiB) Viewed 27705 times

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#40 Post by Ath » 11 Mar 2022, 08:52

bruno17 wrote: 10 Mar 2022, 23:40 I have replaced ESp32 by a new one on Dingtian IOT relay 8 and upload EPSEasy with Add 74HC595 Shiftregisters plugin. Somebody can explain me how work?
The pin configuration is shown here (above)

DS: GPIO 13
SH_CP: GPIO 14
ST_CP: GPIO 15

AFAIK, there is only 1 74HC595 on the board, so "Number of Chips: 1" seems correct.

After setting that up and enabling the plugin, you can use the commands as documented in the pull request. These commands can be entered in a rule, submitted from the Tools page or via a browser-url command to the ESP.
/Ton (PayPal.me)

bruno17
New user
Posts: 3
Joined: 10 Mar 2022, 22:58

Re: Dingtian IOT Relay

#41 Post by bruno17 » 15 Sep 2022, 15:16

Hello, It's not easy to use rule on ESPeasy, but I try this sample and the output of 74hc595 doesn't high level.
Capture d’écran du 2022-09-15 15-13-44.png
Capture d’écran du 2022-09-15 15-13-44.png (9.11 KiB) Viewed 13583 times
Capture d’écran du 2022-09-15 15-08-50.png
Capture d’écran du 2022-09-15 15-08-50.png (39.78 KiB) Viewed 13583 times
Could you help me please

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#42 Post by Ath » 15 Sep 2022, 20:11

Your syntax is incorrect, you can't do a compare on the value in the event definition.
Your event could look like:

Code: Select all

on entree#State_A do
  if %eventvalue1% < 0xFF // Hex numbers can be prefixed with 0x, binary with 0b
    ShiftOut,SetAllHigh
  endif
endon
This requires the Interval setting to be > 0 to generate the State_A event for the entree task.

But I don't understand what you want to achieve with that logic, maybe you can explain on what 'entree' condition all output pins on 'Sortie' should be set to high?
/Ton (PayPal.me)

bruno17
New user
Posts: 3
Joined: 10 Mar 2022, 22:58

Re: Dingtian IOT Relay

#43 Post by bruno17 » 16 Sep 2022, 00:48

Merci pour la réponse, J'essaye de comprendre comment fonctionne cette carte relais et la fonction règle de l'ESPEasy. Le plus facile est d'actionner tous les relais, pour voir, mais les sorties du 74hc595 restent au niveau bas. Le log me dit qu'ils sont à 1. Je mets juste l'entrée 1 au 0 de la carte relais. Entree state_A passe à 0x3F
Capture d’écran du 2022-09-16 00-39-09.png
Capture d’écran du 2022-09-16 00-39-09.png (189.06 KiB) Viewed 13550 times

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#44 Post by Ath » 16 Sep 2022, 08:47

bruno17 wrote: 16 Sep 2022, 00:48 Merci pour la réponse,
Can you please respond in English, the common language on this forum is English (besides a few exceptions in the RFLink section).

I do not own this hardware board, so am unable to validate if it works, though previous reports have indicated successful use of these plugins.
A peculiarity is that both chips have their OE pin connected to the same GPIO, according to the pinout list in reply #10, can't see if you configured that for the 74HC165?

Have you configured both plugins to support the correct number of chips?
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#45 Post by Ath » 18 Sep 2022, 21:38

Looking at the logs there are several possible causes for the strange values:
- Are you using a sufficient power supply for the board? Powering that number of relays can draw quite some current, so when the power supply isn't powerful enough can cause the chips to not respond
- Are the inputs of the 74HC165 supplied with pull-up resistors? (10 kOhm should be fine) Else the inputs may have an undefined/floating state, especially then the power isn't stable

An answer to the previous questions is also appreciated.
/Ton (PayPal.me)

oaotto
New user
Posts: 4
Joined: 10 Feb 2019, 17:09

Re: Dingtian IOT Relay

#46 Post by oaotto » 01 Oct 2022, 22:16

timokovanen wrote: 22 Feb 2022, 13:47 Well, It seems that the chip is programmed in Release Mode with Secure Boot V1, Flash Encryption and Fuse Write protection set.

https://docs.espressif.com/projects/esp ... lease-mode

I'm giving up with original chip, going to replace it with a fresh one. Just ordered some ESP32-WROOM-32D chips and programmer with a socket.
Hello, with what did you describe the ESP 32 Wroom 32D bring nothing on it and what image?
I can't bring it up (ESP32 DevKitC V4 with ESP32 WROOM 32D)

Greetings Otto

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#47 Post by Ath » 02 Oct 2022, 19:22

oaotto wrote: 01 Oct 2022, 22:16 Hello, with what did you describe the ESP 32 Wroom 32D bring nothing on it and what image?
I can't bring it up (ESP32 DevKitC V4 with ESP32 WROOM 32D)
You will have to do the initial flash of an ESP32 using the Espressif flash download tool as included in the ESPEasy Release download, and not the Esp.Easy.Flasher.exe. (You can also download the latest release from the Espressif site if desired)

Then you can select an ESP32 .bin file, that has '.factory.bin' as extension, as that includes the boot loader and partitioning of the unit, and it has to be flashed at address 0. (Later updates via the Update Firmware feature should use the .bin file without factory in it) The checkbox "DoNotChgBin" should be checked, the rest of the options can be left in the default state.
Depending on the board, either starting the flash will automatically enable the flash mode, or that should be manually enabled by holding the Boot button, and pressing the EN or Reset button shortly. After that the Boot button can be released.
The Start button in the Flash download tool can then be used to load the bin file on the ESP.

Once that's completed, the unit can be reset (or power cycled), and should boot ESPEasy, enabling the ESPEasy AP (you can use your smartphone, tablet or WiFi-enabled PC to connect to that AP, it can be named differently, but you'll recognize it when you see it) that you can log in to using the password: configesp
After that, you should be able to configure the WiFi AP the unit should connect to, so you can access it from your regular network connection.
/Ton (PayPal.me)

oaotto
New user
Posts: 4
Joined: 10 Feb 2019, 17:09

Re: Dingtian IOT Relay

#48 Post by oaotto » 08 Oct 2022, 13:59

Thanks,
I don't know what was wrong, I had 3 pieces, the first one took over half an hour to flash (I just let it continue) the others went straight away

Greetings Otto

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Dingtian IOT Relay

#49 Post by Ath » 08 Oct 2022, 19:17

Sometimes, wiring is kind of critical, it seems to work, but in fact it only partially does.

Great it all worked out eventually. :)
/Ton (PayPal.me)

sdke
New user
Posts: 1
Joined: 11 Dec 2022, 09:39

Re: Dingtian IOT Relay

#50 Post by sdke » 11 Dec 2022, 09:42

oaotto wrote: 08 Oct 2022, 13:59 Thanks,
I don't know what was wrong, I had 3 pieces, the first one took over half an hour to flash (I just let it continue) the others went straight away

Greetings Otto

Hey Otto

How did you flash this boards then? Did you have to replace the installed ESP32 or just the firmware?
Do you have a work around somewhere

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests