Skip to content

Confused by the naming convention on the device listed mode, and how to use combo modes #215

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

Open
galop1n opened this issue Feb 23, 2025 · 3 comments

Comments

@galop1n
Copy link

galop1n commented Feb 23, 2025

I am toying with the build hat with the intent to write a rust crate for it rather than using python. I got the basic right by uploading the firmware and signature and have a small REPL loop to toy with the interface and now trying to make sense of all I see.

Currently focusing on the light sensor. In all modes I see, they state SI = TYPE. What does SI even means ? And PCT ? Especially given that the min max reported have both PCT, SI and RAW ( so what does M2 AMBI SI = PCT even means ? )

Is there a finite list of type ? So far I encountered IDX, PCT, RAW, DEG, CAL and MIN.

Next question is how combo works ? When the sensor report C0: M0+M1+M5+M6, is it like a shortcut to ask the sensor to spill all mode ? Is it related to the combi command ?

For the 3x3 light matrix. how to do know the write1 byte header value ? The example always goes select X ; write CX p.... switching mode also reset the light matrix state, so how does the fade animation of mode 3 can work ?

And last for now, Is the firmware open source ? and what is the signature for ?

Thanks

@mutesplash
Copy link
Contributor

The mode information is reported by the device. SI for Système international (whatever SI units the device measures in).
PCT for percentage.
The type is also reported by the device, could also be anything. There's LOAD, POS, and SPEED for motors.
Combo is indeed a shortcut. Combi combo, same sort of thing.
How do we know the matrix data? For one, reading the documentation for BuildHAT. Two, experimentation. Three, hints given by the Lego BLE documentation If you want the fade animation, use matrix.set_transition() then set the pixels you want to fade in.
The firmware is not open source. There was supposed to be some communication last month about if that status would change, but it has not happened. muzkr / hachi may explain how the signature works, because it bypasses it...

@galop1n
Copy link
Author

galop1n commented Feb 24, 2025

Oh, shame on my French blood me on not figuring what SI was :) As for PCT, I would have not guess either, it took me years to realize what "X-ing" printed on the road meant "crossing" for my defense...

For the transition, I figured after posting that it actually worked once set, it is just a bit disappointing that the LED state reset tho. Once it will be set programmatically, i can use a shadow state to restore it, it may not be visible at all or a slight flicker, I will see.

And yes, I am also digging the python library to work out some details, like the expected checksum of the firmware.

Thanks for the hachi link, will look at that also

@mutesplash
Copy link
Contributor

Flicker? There are some notes in matrix.py about how to manage the transitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants