For some applications (like when you want to connect the BIGTREETECH E3EZ* ) you might want to increase the timeout for the shutdown of the BIGTREETECH Relay 1.2* . Especially in the case of the E3EZ the issue is that the power of the PSU is also the power for the Onboard CPU (e.g. CB1* or CM4). So when this power cuts too fast, the PSU would be switched off before the CPU has shutdown. Lastly you might want to be able to start the relay through the pins (and not just shut it down) instead of resetting the device.

Research

I was researching that for a bit until i found some hints that this is possible. It all started with the finding of the original firmware  and a hint how to upload it . But then i found an Issue where the discussion went into the right direction: Obtaining the sourcecode  and an instruction how to update this . And finally also a hint how to extend the timeout .

Fortunately, the user sobieh had changed the firmware in his repository  so that the relay doesn’t need a reset but - and that made it unusable for me - he also changed a couple timeouts and the behaviour of the relay was modified so that it is enabled when the pin is pulled low. For regular cases (where the pc managing the printer is running 24/7) this makes sense but for mine (BTT E3EZ Board with a CB1 onboard) it doesn’t.

So i needed to get into assembly which - thanks to ChatGPT was less complicated than i thought.

Custom Firmware Description

So there it is - the firmware for the BIGTREETECH Relay 1.2 with the following features:

  • Shutdown Delay of 30 seconds (allows to shutdown a CB1 or CM4 embedded on your mainboard)
  • Startup delay of 30 seconds (allows to start towards klipper without triggering a shutdown)
  • Checks every 3 seconds for a changed pin (meaning that it can take up to 33 seconds to shutdown your relay)

Custom Firmware implementation

Prerequisites - Hardware

To implement the modified firmware you will need a serial adapter, e.g. a CH340 ( Aliexpress* or Amazon* ) and a Windows Host.

Prerequisites - Software

Build Firmware

  • Change to the cloned git repository
  • Run build.bat

Upload Firmware

This instruction is to be used at your own risk. We are not liable for any damage.

  • Disconnect any mains voltage
  • Connect the relay board to any USB to Serial adapter
  • Run upload.bat COM# where # is your COM port number. To find the number, check the Windows Device Manager
  • Reset the board with reset button