UND-ARC / BBE_Sensors

Interface, examples, and programs to use the BeagleBone Enhanced's onboard sensors.
0 stars 1 forks source link

Barometer `sysfs` files missing #2

Open mishaturnbull opened 5 years ago

mishaturnbull commented 5 years ago

Per the SanCloud barometer guide, the metholodogy to read the barometer part of the sensor (LPS331AP) is as follows:

  1. Identify the device in /sys/bus/iio/devices/ -- it should be either be iio:device0 or iio:device1.
  2. In the appropriate device folder, for us, iio:device0, the following contents should be seen:
    drwxr-xr-x 2 root root 0 Dec 8 18:24 buffer
    -r--r--r-- 1 root root 4096 Dec 8 18:24 dev
    -rw-r--r-- 1 root root 4096 Dec 8 18:24 in_pressure_raw
    -rw-r--r-- 1 root root 4096 Dec 8 18:24 in_pressure_scale
    -rw-r--r-- 1 root root 4096 Dec 8 18:24 in_temp_offset
    -rw-r--r-- 1 root root 4096 Dec 8 18:24 in_temp_raw
    -rw-r--r-- 1 root root 4096 Dec 8 18:24 in_temp_scale
    -r--r--r-- 1 root root 4096 Dec 8 18:24 name
    lrwxrwxrwx 1 root root 0 Dec 8 18:24 of_node -> ../../../../../../../firmware/devicetree/base/ocp/i2c@44e0b000/lps331ap@5C
    drwxr-xr-x 2 root root 0 Dec 8 18:24 power
    -r--r--r-- 1 root root 4096 Dec 8 18:24 sampling_frequency_available
    drwxr-xr-x 2 root root 0 Dec 8 18:24 scan_elements
    lrwxrwxrwx 1 root root 0 Dec 8 18:23 subsystem -> ../../../../../../../bus/iio
    drwxr-xr-x 2 root root 0 Dec 8 18:24 trigger
    -rw-r--r-- 1 root root 4096 Dec 8 18:23 uevent
  3. To read from the temperature sensor, use the in_temp_* files. To read from the barometer, use the in_pressure_* files.

The issue

The files in_pressure_raw and in_pressure_scale are missing.

The temperature files are present and working as expected, if not a little warmer than ambient but nothing that couldn't be accounted for by the computer board's heat.

mishaturnbull commented 5 years ago

This issue was originally opened via testing on one particular BBE device (65), as we had been having problems installing the OS on the second (32). That issue was isolated to a faulty MicroSD card, and BBE 32 is now in a working state.

However, it has the same problem. This indicates a software/kernel issue rather than failing hardware.

It may be worth noting that instead of following the expected device path as stated in the SanCloud guide, it appears that the device is connected over I2C in the folder /sys/devices/platform/ocp/44e0b000.i2c/i2c-0/0-005c/ which has the contents:

total 0
drwxr-xr-x  3 root root    0 Jul 19 13:58 .
drwxr-xr-x 11 root root    0 Jul 19 13:58 ..
-r--r--r--  1 root root 4.0K Jul 19 13:58 modalias
-r--r--r--  1 root root 4.0K Jul 19 13:58 name
lrwxrwxrwx  1 root root    0 Jul 19 13:58 of_node -> ../../../../../../firmware/devicetree/base/ocp/i2c@44e0b000/lps331ap@5C
drwxr-xr-x  2 root root    0 Jul 19 13:58 power
lrwxrwxrwx  1 root root    0 Jul 19 13:58 subsystem -> ../../../../../../bus/i2c
-rw-r--r--  1 root root 4.0K Jul 19 13:58 uevent

The contents of name are lps331ap. Unfortunately, nothing in this folder (or any of its children) are the necessary files to read from.

mishaturnbull commented 5 years ago

In re-reading the original issue, I believe the second device to have a slightly different problem. The iio:device0 folder does not contain any sensor inputs, pressure or temperature. There is no other relevant information in any of the other IIO folders, either:

debian@beaglebone:/sys/bus/iio/devices$ ls -la
total 0
drwxr-xr-x 2 root root 0 Jul 20 15:10 .
drwxr-xr-x 4 root root 0 Jul 20 15:10 ..
lrwxrwxrwx 1 root root 0 Jul 20 15:10 iio:device0 -> ../../../devices/platform/ocp/44e0d000.tscadc/44e0d000.tscadc:adc/iio:device0
lrwxrwxrwx 1 root root 0 Jul 20 15:10 iio:device1 -> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0068/iio:device1
lrwxrwxrwx 1 root root 0 Jul 20 15:10 trigger0 -> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0068/trigger0
debian@beaglebone:/sys/bus/iio/devices$ ls *
iio:device0:
buffer  in_voltage0_raw  in_voltage2_raw  in_voltage4_raw  in_voltage6_raw  name     power          subsystem
dev     in_voltage1_raw  in_voltage3_raw  in_voltage5_raw  in_voltage7_raw  of_node  scan_elements  uevent

iio:device1:
buffer                   in_accel_scale            in_accel_y_raw           in_anglvel_scale_available  in_anglvel_z_calibbias  in_temp_scale       sampling_frequency_available
current_timestamp_clock  in_accel_scale_available  in_accel_z_calibbias     in_anglvel_x_calibbias      in_anglvel_z_raw        name                scan_elements
dev                      in_accel_x_calibbias      in_accel_z_raw           in_anglvel_x_raw            in_gyro_matrix          of_node             subsystem
in_accel_matrix          in_accel_x_raw            in_anglvel_mount_matrix  in_anglvel_y_calibbias      in_temp_offset          power               trigger
in_accel_mount_matrix    in_accel_y_calibbias      in_anglvel_scale         in_anglvel_y_raw            in_temp_raw             sampling_frequency  uevent

trigger0:
name  power  subsystem  uevent
Device Folder Contents of name Contents of dev
iio:device0 44e0d000.tscadc:adc 247:0
iio:device1 mpu6050 247:1
trigger0 mpu6050-dev1 N/A