Yes.
Changelog:
1.0.32 Adds i2c support to control TOH
There’s an example how to use it in the community library of user claudeshannon.
Yes.
Changelog:
1.0.32 Adds i2c support to control TOH
There’s an example how to use it in the community library of user claudeshannon.
Maybe one could set the permissions for the I2C interface differently and/or add the user to a certain group? I haven’t tried that yet.
Yea some udev magic should be able to chgrp/chmod the device accordingly.
Maybe use the sailfish-system group? Or invent a new one sailfish-toh which only the “device owner” has.
i2c-tools does something like:
KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660"
An example for the FP2026 is already in /lib/udev/rules.d/998-leds-jp2601.rules.
Or maybe install symbiosis, create a config file and ask the bus file descriptor from org.sailfishos.tohd1 on D-Bus in your application? ![]()
Quite a bit of explanation of that already here. The configuration needs just tell a binary path to have access to i2c-dev like in blinker.yaml. Configurations are placed into per TOH directories like here.
Of course this wouldn’t work quite so easily for a Python script, but I suspect most would want to use something compiled. (And I’ve even compiled Python scripts into binaries for fun in the past.) Let’s see if we need to consider that too.
@tomin: Sorry if my questions are maybe obvious, but I’m already thinking of my own possible use cases and how I can realise them without much programming effort.
If I ever create TOHs for myself, they will likely be very simple ones. For example, a TOH with an environmental sensor IC which gives me temperature, humidity and atmospheric pressure readings. Most of these ICs don’t require complex communication protocols or strict bus timings. You basically just read and write registers whenever you want without having to develop a driver or kernel module first. The datasheet of the respective IC usually contains every information you need (register map). So I wonder:
The Python script from the Inari Blue thread [Proposal] Inari Blue TOH LED for notifications - #17 by cypherpunks does exactly that, it just reads and writes some registers.
It would be easy to adapt it to write anything you want.
As an alternative Automagic can directly write to registers on the TOH.
Thanks for the hint! I don’t have my new Jolla Phone yet, but it seems my brain is already in nerd mode. ![]()
I crated a pull request to add the documentation: Add documentation for D-Bus and config by Tomin1 · Pull Request #5 · sailfishos/symbiosis · GitHub.