Open FaBjE opened 1 month ago
I don't have MHO-C122 and have no way to check its functionality.
You are the only owner of MHO-C122. :)
- LCD init delay is disabled Is this on purpose or?
On cold start, pin PB6 = PULL_UP
https://github.com/pvvx/ZigbeeTLc/blob/master/src/board_mho_c122.h#L39
As a result, the command gpio_setup_up_down_resistor(GPIO_PB6, PM_PIN_PULLUP_10K);
does nothing
The display controller is similar to LYWSD03MMC (B1.4, B1.7, B2.0). The only difference is the LCD panel segments.
Another difference is that LYWSD03MMC I2C bus frequency set higher. To optimize consumption. On C122 I don't know what elements are soldered on the printed circuit board on I2C bus. For example CGDK2 has soldered protective diodes with high capacity (useless parts that interfere with work), which does not allow to work with I2C bus above hundred kHz...
Zigbee firmware has a function to turn off the display. It is advisable to check whether the display is on or not.
Thanks for your response. I tried setting the "screen off" attribute to 0.
# Display On
service: zha.set_zigbee_cluster_attribute
data:
ieee: 'a4:c1:38:94:93:??:??:??'
endpoint_id: 1
cluster_id: 0x0204
cluster_type: in
attribute: 0x0106
value: 0
It was confirmed as successful
DEBUG (MainThread) [zigpy.zcl] [0xC86E:1:0x0204] Decoded ZCL frame: UserInterface:Write_Attributes_rsp(status_records=[WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)])
DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xC86E](MHO-C122-z): set: 0 for attr: 262 to cluster: 516 for ept: 1 - res: Write_Attributes_rsp(status_records=[WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)])
But no change unfortunately.
On C122 I don't know what elements are soldered on the printed circuit board on I2C bus
On the PCB I can not identify any diode or resistor. Only capacitors and a few inductors: https://pvvx.github.io/MHO_C122/ Any limits will be in the IC's itself.
But apart from that, the I2C speed is still configured at 100 Khz as far as I can see. So that should not be a problem.
Unfortunately I am quite limited in my debug options here. (I don´t have a debugger) or any connection points to connect a logic analyzer to the I2C bus. How would you debug an issue like this? Is there any debug UART/console available?
The display controller is similar to LYWSD03MMC (B1.4, B1.7, B2.0). The only difference is the LCD panel segments.
When porting the MHO-C122 I just flashed the LYWSD03MMC and by trial and error I was able to map the LCD. As I see nothing now, I think there is more of a low-level/generic issue.
If I may make a suggestion/request: If you have some spare time, could you maybe load the MHO-C122 build into your LYWSD03MMC and see if any LCD segments come up? In my opinion this should be the case.
Error found. When copying from BLE, the variable name "lcd_i2c_addr" was not changed to "i2c_address_lcd". ZigBee files for MHO-C122 have been replaced.
In https://github.com/pvvx/BZdevice the files are similarly corrected.
Great work @pvvx !
After flashing the latest binary it didn't work for me. I did some analyzing, changed some code, sw bricked device, erased all flash, switched back to BT firmware (LCD is still working) and back to zigbee. Now it is working!
I think the erase all flash in combination with the new SW did the trick. (Maybe the display was disabled after my tinkering to change the settings) I will monitor it's behavior in the coming days.
After a week it is still working fine 👍🏻
I have one feature/functionality suggestion.
At the moment the "bluetooth bond (|)
= Segment: 3.6" is always displayed.
The bit is set on the reboot-screen, but never cleared.
Maybe it is an idea to use: "(|)
= Segment: 3.6" for the zigbee network state.
and "BLE
= Segment 4.7" for the bluetooth state.
For (also for BZdevice) you would be able to see which one is connected.
LCD's that don't have the symbol can just use the BLE
icon for both.
I've updated one of my MHO-C122 to the ZigBee firmware as a test. After the upgrade there is nothing on the LCD.
I think the MCU is running OK, as I can pair it with ZHA and I get regular updates.
I did a quick diff between the ZigBee LCD driver: https://raw.githubusercontent.com/pvvx/ZigbeeTLc/master/src/lcd_mho_c122.c and the BT LCD driver: https://raw.githubusercontent.com/pvvx/ATC_MiThermometer/master/src/lcd_mho_c122.c
I noticed some differences.
The big question is: Should this be working (theoretically) or is the LCD not implemented yet in this beta firmware?
Upgrade log:
(Maybe to refresh your memory, I added the LCD driver for the MHO-C122 The BLE firmware is still working very well!))