Currently, debugging is very rudimentary.
It consists of adding prints in the code and building with the DEBUG flag enabled.
(See make_scripts/make_debug_single.sh.)
After you flash the debug build, the device will output messages to the UART TX pin.
The TX pin is usually shared with the B1 GPIO pin. Check the diagrams: ZTU, ZT2S, ZT3L.
It is defined in app_cfg.h.
You can safely power and use the device with 3.3V DC from the programmer.
It behaves exactly the same way it does when powered with 220V AC.
Warning
Do not open the device while connected to mains!
Do not connect both mains voltage and 3.3V at the same time!
Attach a probe to the TX pin of the switch and connect it to the RX pin of the receiver.
(You no longer need the SWS and RST connections. These are only for flashing.)
There are multiple options available for keeping the wires connected:
soldering, pogo-pins, 3D printed jig, laser cut jig, PCBite kit, holding them with your hand.
You might need to desolder some components to access the pins.
Use this command to find the port:
ls -l /dev/serial/by-idMake sure the port is not already in use (stop the flasher) and
start the serial monitor with this command (update the port):
sudo minicom -b 115200 -o -D /dev/ttyUSB0