Giter Site home page Giter Site logo

iio-sensor-proxy's Introduction

iio-sensor-proxy

IIO sensors to D-Bus proxy

See https://developer.gnome.org/iio-sensor-proxy/1.0/ for developer information.

Installation

./configure --prefix=/usr --sysconfdir=/etc
make
make install

It requires libgudev and systemd.

Usage

With a GNOME 3.18 (or newer) based system, orientation changes will automatically be applied when rotating the panel, ambient light will be used to change the screen brightness, and Geoclue will be able to read the compass data to show the direction in Maps.

Note that a number of kernel bugs will prevent it from working correctly on some machines so please make sure to use the latest upstream kernel (kernel crashes on the Surface Pro, sensor failing to work after suspend on the Yoga Pro, etc.).

You can verify that sensors are detected by running udevadm info --export-db and checking for an output resembling this one:

P: /devices/platform/80860F41:04/i2c-12/i2c-BMA250E:00/iio:device0
N: iio:device0
E: DEVNAME=/dev/iio:device0
E: DEVPATH=/devices/platform/80860F41:04/i2c-12/i2c-BMA250E:00/iio:device0
E: DEVTYPE=iio_device
E: MAJOR=249
E: MINOR=0
E: SUBSYSTEM=iio
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:
E: USEC_INITIALIZED=7750292

You can now check whether a sensor is detected by running:

gdbus introspect --system --dest net.hadess.SensorProxy --object-path /net/hadess/SensorProxy

After that, use monitor-sensor to see changes in the ambient light sensor or the accelerometer. Note that compass changes are only available to GeoClue but if you need to ensure that GeoClue is getting correct data you can run: su -s /bin/sh geoclue -c monitor-sensor

If that doesn't work, please file an issue, make sure any running iio-sensor-proxy has been stopped: systemctl stop iio-sensor-proxy.service and attach the output of: G_MESSAGES_DEBUG=all /usr/sbin/iio-sensor-proxy running as root.

Accelerometer orientation

When the accelerometer is not mounted the same way as the screen, we need to modify the readings from the accelerometer to make sure that the computed orientation matches the screen one.

iio-sensor-proxy reads this information from the device's ACCEL_MOUNT_MATRIX udev property. See 60-sensor.hwdb for details.

References

Tested on

  • Apple MacBook Air (4,2)
  • Apple MacBook Air (6,2)
  • Apple MacBook Pro (8.2)
  • Asus Transformer Book TP500LB
  • Asus Zenbook UX31A, UX305
  • Cube i9
  • Dell Inspiron 13 7000
  • Dell Venue 11 Pro (7140)
  • Dell Venue 8 Pro
  • HP Pavilion X360
  • HP Spectre x360 (Kaby Lake)
  • Lenovo IdeaPad Yoga 13
  • Lenovo ThinkPad Twist
  • Lenovo X1 Carbon 2014 (rev2)
  • Lenovo X1 Tablet
  • Lenovo Yoga 2 13" and 11"
  • Lenovo Yoga 2 Pro
  • Lenovo Yoga 460
  • Lenovo Yoga 900
  • Microsoft Surface Pro 2
  • Onda v975w
  • Toshiba Portégé Z10t
  • Toshiba Radius 11 L10WC10C

iio-sensor-proxy's People

Contributors

hadess avatar jjardon avatar janbrummer avatar spandruvada avatar crrodriguez avatar soda0289 avatar zeenix avatar bentiss avatar bgaff avatar tofee avatar cosimoc avatar m0rf30 avatar djdeath avatar dos1 avatar valentindavid avatar vinilox avatar bricewge avatar

Watchers

James Cloos avatar Simon McVittie avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.