The short story is that I am looking for fellow Linksys MX4200 owners who can provide a few bits of info about their devices for an issue with the LED I am troubleshooting.
You'd need to install i2c-tools with apk add i2c-tools or opkg install i2c-tools and post the output of;
i2cdetect -y 0 strings /dev/mtd20 | grep modelNumber ls /sys/class/leds/
and whether it's a v1 or a v2 and if it's OEM or ISP-provided. Lastly, if the LED shows any other color apart from blue on OpenWrt. For example, it should go green when you are upgrading the firmware.
For example:
Warning: Can't use SMBus Quick Write command, will skip some addresses
0 1 2 3 4 5 6 7 8 9 a b c d e f
00:
10:
20:
30: -- -- -- -- -- -- -- --
40:
50: -- -- -- -- -- -- -- -- 58 -- -- -- 5c -- -- --
60:
70:
modelNumber=MX42BF-EU
ls /sys/class/leds/ shows nothing
I have an MX4200v2 ISP-provided. The model on the label is SPNMX42. The LED is always blue on OpenWRT and it's never shown any other color. It works normally on OEM firmware. I have another MX4200 with modelNumber=MX42CF-EU and the rest is the same.
The longer story is that it seems that the reg address used on target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8174-mx4200.dtsi for the pca9633 led controller is incorrect and it should be 0x58. Apart from the output of i2cdetect, and the fact that there are no leds under /sys/class/leds/, there are more clues on Linksys firmware to corroborate that theory. I am trying to establish if all MX4200 variants use this address on the i2c bus for the led controller, and the fix would apply to all, or it would need to be applied per variant.
When I use the address 0x58 the LEDs appear under /sys/class/leds/ but the led stays blue for around 35 seconds and then it goes off, seemingly when the router has fully boot up. It might be some OpenWrt configuration, I need to investigate that, but I would be grateful if you could share the above info with me. Thanks.
* LED driver for the PCA9633 I2C LED driver (7-bit slave address 0x62)
* LED driver for the PCA9634/5 I2C LED driver (7-bit slave address set by hw.)
I can dump data after unload leds_pca963x driver:
root@MX8500:~# i2cdump -y 0 0x62 b
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 10 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
10: 10 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
80: 90 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
90: 90 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
a0: b0 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
b0: b0 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
c0: d0 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
d0: d0 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
e0: f0 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
f0: f0 21 00 ff 01 00 80 08 00 e2 e4 e8 e0 XX XX XX ?!..?.??.????XXX
I flashed 24.10.0-rc2 from the currently running SNAPSHOT r27687-b62e6f5beb (resetting to factory defaults) and almost immediately after I confirmed in LuCI, the pattern went:
LED started to blink green (from solid blue) for about 20-25 seconds
LED started to blink blue (from blinking green) for about 10 seconds, with the first 2 seconds of this duration blinking VERY FAST
LED went back to solid blue and LuCI refreshed itself after about 5 seconds
I then flashed 24.10.0-rc2 again (resetting to factory defaults) and the same pattern repeated, so at least on my OEM MX4200V1 the LED seems to behave correctly.
root@OpenWrt:~# i2cdetect -y 0
Warning: Can't use SMBus Quick Write command, will skip some addresses
0 1 2 3 4 5 6 7 8 9 a b c d e f
00:
10:
20:
30: -- -- -- -- -- -- -- --
40:
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60:
70:
root@OpenWrt:~# ls /sys/class/leds/
blue:status green:status red:status
Also, here's the output of ubus call system board if it's needed. This is a spare unit so if more info is needed just holler, I can retest/reset/reflash it as many times as needed.
Thanks for the output and the kind offer of further testing. Mine doesn't do any of that and it stays blue all the time. It seems that the MX4200v2, or at least the ISP-provided version SPNMX42, uses another controller. I am currently investigating this.
Yes, I think it's another controller and the PCA9634 is my first suspect at the moment.
Yeah, I've already tried that and a few combinations with PCA9634 (as well as PCA9633) but so far it's not working.
From what I can see in some of the scripts from OEM's firmware, it's possible that this controller has 8 LEDs which would support the speculation that it is the PCA9634. In /etc/leds/lib_nodes_hw.sh
# Nodes HW has following
LedColors="red green blue purple yellow cyan white rgb"
On those scripts they use i2cset extensively to set up the LED colors, pulse and so on. In fact I have been able to change the color using those. They don't do that on the firmware for MX4200v1.
The fact that they use i2cset on the MX4200v2 for a lot of the stuff instead of /sys/class/leds/ like they do on the MX4200v1 makes me wonder if they are using something that is not available upstream and they resorted to write directly to the controller.
Anyhow, I'll keep investigating and report back. I still would like to see the results of an OEM MX4200v2.