-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tuya MCU V2 does not complete initialisation on WIFI-101 door/window contact switch. #17542
Comments
Datasheets for the key components on the WIFI-101 PCB: Charge Controller: Transistors/FETs: Wifi Module: Images of the PCB with WiFi module removed to enable reverse engineering of the schematic: |
Probably related to #17190 |
I'm fairly adept at coding, if there's anything specific in the codebase, or even just hints, let me know and I'll take a look. |
Due to lack of support Tuya V2 in development has been reverted to V1. Sorry. |
@arendst What do you mean by 'lack of support'? What's the issue? I also tried this particular device with V1 code by using the The 'https://github.com/sillyfrog/Tasmota-Tuya-Helper' bookmarklet tool doesn't work with either V1 or V2 code and always shows a backlog command. Any ideas on how to get either the device working with either V1 or the V2 code? |
See #17190 and other tuya related issues not being addressed by either original maintainers (as they moved on) or users willing and able to dive into the issues. The V2 version seems to be more error prone than the V1 version so that's why V2 never made it into production and was replaced by V1 in development recently. I don't own any tuya related hardware so cannot help here. |
@arendst ok, understood, thanks for the clarification. Today I did a new build on the latest For anyone else following along, here's the full set commands to get the Wifi-101 contact sensor working, once you've flashed
Here's two logs showing the output: Closed-To-Open:
Open-to-Closed:
This is the firmware I used: Source: Commit: Note that the MCU seems to become unresponsive after a few seconds after power-up even with the bench-psu connected to the battery terminals and the Wifi module powered on by connected the WiFi enable MOSFET Gate connected to GND. So you have to power-cycle the whole thing, then issue serialsend and/or other MCU commands in the web-ui console as soon as the device boots. |
Instructions for flashing:
Log:
Log:
b) Flash pre-built
^ this will cause a reboot.
you should see an MQTT message
you should see an MQTT message
To restore firmware:
Reconfiguring on battery: If you press-and-hold the 'Reset' switch for 5 seconds and release, the device will flash the red LED and stay powered on for about 2 minutes during which time the Wifi module is powered on and you can connect to it over the network. |
This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions. |
@arendst Is it worth noting somewhere on the site that a maintainer for the Tuya related code is needed? Is there a list of current maintainers for certain portions of the codebase? |
Listed here https://github.com/arendst/Tasmota/blob/development/CODE_OWNERS.md |
Myself and a few others have recently made some maintenance on Tuya V1 Regarding Tuya V2 it was a hit and run and it is now disabled by default. If you have some comments on V1, let us know and I may be in a position to help |
Hi @barbudor. Firstly, thanks for doing some maintenance! My observations with the setup above is that time-from contact opening/closing, to messages being received by my MQTT broker, is quite long, and sometimes they do not appear at all. I can see the contact switch light coming on, so I know it's powering on ok. For example, if I open or close a door sometimes I do not get any MQTT messages. If I then wait 10 seconds, and then close or open the same door the message may come though. Can the the process be sped up somehow? The original Tuya firmware on the wifi module was faster for sure, as my logic analyzer traces show. |
Have you retested since we disabled V2 and reverted to V1 ? |
yes, the my previous comment was relating to the V1 code, as detailed here: #17542 (comment) (above) |
This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue was automatically closed because of being stale. Feel free to open a new one if you still experience this problem. |
Could it be the case that the original issue of @hydra is that his device seems to be using the Tuya low power wifi protocol. Take a look at the responses messages of the Tuya mcu. The header including the version byte 3 is not equal to the Tuya standard wifi protocol. Take a look at #20608. The issue with either tuya v1 or tuya v2 seems to be the misinterpretation of the protocol commands of tuya mcu due to communicate with the wrong tuya protocol. |
PROBLEM DESCRIPTION
The TuyaMCU V2 initialisation sequence does not complete, it gets stuck at stage 8, the log reports:
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:Status 0
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:TO REPRODUCE
Flash 'tasmota-battery' that contains the new TuyaMCU V2 code to a Wifi-101 device.
Connect it to Wifi as usual using the web-ui.
EXPECTED BEHAVIOUR
Tuya Initialisation completes.
SCREENSHOTS
ADDITIONAL CONTEXT
I reverse engineered the schematic, PDF version attached:
schematic.pdf
I dumped the original firmware, attached:
20221228-2007-contact_sensor_1_1M.zip
I took trace logs of 3v3, Reed Switch, Wifi RX/TX from the original firmware using Logic, I exported the data as CSV and also created Excel comparisons and analyzed the data a little to find the details of which command the original firmware is using the get the status of the reed switch, logs attached:
20221230-1201-original-firmware-logic-trace-logs-and-csv-exports-and-comparisons.zip
I also compiled the same firmware but re-enabled the V1 code, logs attached:
log - v1 - reed closed.txt
log - v1 - reed open.txt
log - v2 - reed closed.txt
log - v2 - reed open.txt
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: