Support for IOTTIMER WiFi Clock #21376
Replies: 25 comments 80 replies
-
The protocol for TM1640 looks very simple. Happy to provide you any needed support to develop the drivers. Since it's ESP8266 based, no possibility to use Berry. You will need to go for C++ |
Beta Was this translation helpful? Give feedback.
-
Interesting - thanks for sharing and good luck with the drivers, although I find it a bit on the expensive side with 27€ here from AliExpress. Roughly 4 times the price of XYclock, although the enclosure is nice of course. Similar "non wifi" models are available for about 1/3 of the price. Also I´d be interested to understand how "dark" you can dim the LED as I was looking for this being my night clock with only very dim light at night (the XY is way to bright even on lowest level). Looks like we will be seeing more and more "wifi clocks" from Chinese manufacturers (here is another one https://de.aliexpress.com/item/1005006744696913.html), guess it is only a matter of time until some with ESP32 crop up too. I´ll keep watching - but although being a wifi-clock aficionado I´m currently not getting that model :-) - good luck! |
Beta Was this translation helpful? Give feedback.
-
Awesome. About Led darkness, the current Tasmota implementation uses 10 bits (1024 levels), so the darkest you can get out-of-the-box is 1/1024th of the full power. This might seem too light for a night clock. The bad news is that we are quite limited on ESP8266, because it is entirely interrupt driven. The PWM interrupt driver took years to stabilize. While in theory we could do better, nobody is willing to reopen the interrupt driver implementation. On ESP32 (including ESP32C3), PWM is hardware based so we could much more easily tweak the resolution. I'm just hoping that the manufacturers will quickly move to ESP32C3 or even ESP32C2 (ESP8684) |
Beta Was this translation helpful? Give feedback.
-
For clock addicted people ;-) This one looks nice too. Could imagine that the matrix LEDs are driven from the esp8266 |
Beta Was this translation helpful? Give feedback.
-
As we seem to be the "wifi clock addicted self-help group" here - just today I found a very nice "nixie" style clock that uses small LCD or OLEDs to fake real nixie tubes. It´s driven by an ESP32 as you can see from a video here: The "original" design is fairly expensive, but there are several clones that start at around 34€ at AliExpress: Some guys already developed alternat firmware here: Would be interesting to find out if that could run Tasmota as well. Does Tasmota support more than one display at a time? I´m tempted to get one to add to my wifi clock collection ;-) |
Beta Was this translation helpful? Give feedback.
-
Another good candidate for a Tasmota clock is the Unexpected Maker Bling! with 8x40 neopixels (spacing 2 mm), RTC chip, I2S audio (speaker connector and onboard mic), ESP32-S3 with PSRAM, buttons, battery connector, SD card and Stemma connector. Somewhat similar to the Ulanzi TC001, but better specs and much smaller. Still not cheap.... |
Beta Was this translation helpful? Give feedback.
-
I'm surprised to see discussions about this clock here. As a technical person, I know that creating a good product is not easy, and issues can arise in various aspects, such as the confusion with model naming. I'm providing the hardware schematic of this clock, hoping it will be helpful. If needed, I can also provide a sample program for the display board driver later. Although it's known that the TM1640 is used, creating a driver requires a code table, and testing and organizing this takes a lot of time. I noticed some comments about pricing. I don't have the time or resources to manage international sales channels, so currently, it's only sold in China. The domestic price is significantly lower than similar products. Considering the completion, functionality, performance, and price, it's a highly cost-effective clock, and the software is continuously updated. As for the pricing in your region, I can't do much about it for now. I understand that traders have additional costs like shipping, after-sales service, and product loss, and they also need to ensure some profit, which raises the price. SCH_WHEN_V3_2024-09-13.pdf |
Beta Was this translation helpful? Give feedback.
-
@stefan-oskamp any progress on the drivers? If not I'll focus on the rtc chip. Just ordered one clock module today based on the @master-gong info. |
Beta Was this translation helpful? Give feedback.
-
The RTC (R8010) and the TM1640 are connected on separate I2C buses: Is that actually possible with Tasmota on ESP8266? |
Beta Was this translation helpful? Give feedback.
-
I updated my original post and added the link to the schematics and documentation about the wiring of the LED segments (traced by me). The driver will be very specific for this clock because of how segments are wired to the TM1640B. I'm thinking of using xdsp_20_tm1650.ino as a basis. I don't think it makes sense to merge support for the TM1640B and how it is wired into that code. So, I would create a new xdsp_... driver for it. @master-gong, if you could provide sample code containing the mapping between digits and segments, that would be great. |
Beta Was this translation helpful? Give feedback.
-
Hi @stefan-oskamp any progress? I received mine recently and verified it seemed to work fine with provided code. I then installed Tasmota-4M.bin and alas fail to see the M1601B (should be DS18B20 compatible) and the I2C RTC. In fact I don't see anything on the I2C bus and as it uses GPIO16 I never expect to see anything on the bus either as I2C is not suppose to work on this pin on ESP8266. Wonder if it ever worked in the original code. This is the config I use based on the schematics: And this is the power on log:
I hope you have more luck. BTW the buttons and buzzer work OK. NOTE1: A test for I2C on a wemos using GPIO16 and GPIO14 fails as expected. Bad board design. |
Beta Was this translation helpful? Give feedback.
-
Latest dev branch v14.2.0.5 now supports M1601B configured as DS18x20. |
Beta Was this translation helpful? Give feedback.
-
Hello
|
Beta Was this translation helpful? Give feedback.
-
Update:
Source: Binary: To do:
|
Beta Was this translation helpful? Give feedback.
-
Hi Stefan @stefan-oskamp : what should I do to display the temperature from a remote sensor? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Again, the simplest would be to have the device with the sensor publish a command to set the temperature. Or you can subscribe to MQTT payloads, and pick a field from there, to locally issue the same command to set the temperature. |
Beta Was this translation helpful? Give feedback.
-
@arendst @sfromis Thanks for pointing out GlobalTemp, I haven't come across this feature yet. |
Beta Was this translation helpful? Give feedback.
-
Have compiled with these settings (KNX is currently not in use):
and this rule enabled:
One observation is that these logs are displayed every second (using log level "2 Info"):
Is that intentional or should these messages be suppressed in “2 Info”? The rule listed above does not work correctly because |
Beta Was this translation helpful? Give feedback.
-
Update: @arendst, merged the TM1640 driver and the IoTTimer display driver into one new file xdsp_13_tm1640.ino that he sent me. Theo also suggested to use the following template:
This treats the photo resistor as light sensor with a different range and unit The temperature display converts to Fahrenheit if To show a temperature from a different source, it can be set or sent as displaymode 2 switches to showing the date (dd-mm yy, or mm-dd yy if AM/PM timeformat ( The many buttons for the TM1640 digits on the web GUI main page are gone (thanks Theo). Source is here: Binary: TODO:
|
Beta Was this translation helpful? Give feedback.
-
Support released in v14.3.0.7 on 20241120 |
Beta Was this translation helpful? Give feedback.
-
sorry for the delay. Compiled dev using TasmoCompiler (selected: ESP8266 Generic, Displays (I2C/ SPI), Rules, Timers, Web Interface) but the clock doesn't update the time... will have a detailed look next weekend. |
Beta Was this translation helpful? Give feedback.
-
Ups, this is the current source and not Tasmota development, isn't it? |
Beta Was this translation helpful? Give feedback.
-
No need for tricks. Iottiner is merged in dev last week you need define USE_DISPLAY_TM1940 and USE_IOTTIMER. |
Beta Was this translation helpful? Give feedback.
-
Something is missing using these settings:
Compiled lasted dev using |
Beta Was this translation helpful? Give feedback.
-
The following ESP-12 based alarm clock looks very nice and is very hacking-friendly.
Product developer page:
https://mastergong.cn/archives/364.html
Aliexpress:
https://www.aliexpress.com/item/1005006684061080.html
The naming of the item is not very consistent. IOTTIMER seems to be a series of similar items. This model is called "WHEN" but the print on the back says "THEN" -- logical isn't it.
I have bought one and I would like to run Tasmota on it. I currently use an XY-Clock with Tasmota as my smart-home-integrated alarm clock. (I had contributed the TM1650 display driver for it.) The IOTTIMER clock has a bigger display and, most importantly, has a proper enclosure.
Initially, the clock opens its own WiFi. The description explains how to enter your WiFi credentials. The form is in Chinese. Filling it in is not complicated, but you have to know that the left button (at the bottom) is the OK button. Once the clock is in your WiFi, you can look up its address in your router and connect to it. The second entry from the bottom in the main menu is "System" settings where you can change the language to English (just search for the drop-down list that contains "English" and press OK. The language does not change immediately, though.
The software is rather complete for an alarm clock, but a bit complicated. For integrating it in your smart home environment, you could trace the POST requests of the web GUI in your browser and mimic settings from you smart home central by sending the proper JSON to it. However, I prefer replacing the firmware with Tasmota.
To flash new firmware, you could just open the RTC battery compartment on the back and connect to the D0/GND/TX/RX/VCC pads that are marked accordingly. But, of course, you wouldn't know how to configure Tasmota.
For reverse engineering, you can open the clock by peeling off the display cover. (Leave the protective film on the display cover.) Slide in a prying tool at the edge and carefully lift it off the LED mask. There are two narrow strips of double-sided tape; one between the two hour digits and one to the right of the minute digits. You can then unscrew and remove the display board. After that, you can remove the controller board. The display mask is snapped onto the display board and can be easily removed. The whole thing is very nicely designed and easy to disassemble and re-assemble.
The controller board contains an ESP-12 module (ESP8266) and an RTC (R8010). It also holds the RTC battery, the three push buttons, a buzzer, and a temperature sensor (M1601).
On the display board there is a TM1640 controller, the LEDs, and the ambient light sensor.
The two boards are connected by six wires with a connector on either end.
The designer of the clock provided schematics in a post further down:
https://github.com/user-attachments/files/16987817/SCH_WHEN_V3_2024-09-13.pdf
I traced the wiring of the display board:
Segment wiring
TM1640B pinout
Non-standard segment numbering
Digit segments are wired to the TM1640B in a non-standard way:
This is the same for all digits.
Main display area (left)
The digits in this area have two LEDs per segment, controlled by separate grid lines. From the software perspective, you can think of it as two displays on top of each other and with four digits each. You could control brightness in 15 steps instead of just 7, but it would look strange and would be cumbersome to implement.
Temperature display area (upper right)
Seconds display area (lower right)
arendst implemented a driver for the R(X)8010 (see post further down). However, the clock has been designed with two separate I2C buses for the display board and the RTC. Tasmota on ESP8266 does not support two I2C buses, so we cannot use the RTC for now.
Edit:
Beta Was this translation helpful? Give feedback.
All reactions