I2c app problems

Hi,
I am trying to run an app very similar to BatteryChargerReading which is in:
https://github.com/mangOH/mangOH/tree/master/samples/tutorials/mangOH_Red/i2c/BatteryChargerReading

The thing is: every time I try to run it on the Mangoh, I get these pieces of information on the log:

Jan 6 00:56:16 swi-mdm9x28-wp user.info Legato: INFO | supervisor[796]/supervisor T=main | app.c app_Start() 3377 | Starting app 'i2cReading’
Jan 6 00:56:16 swi-mdm9x28-wp user.err Legato: =ERR= | supervisor[796]/supervisor T=main | app.c GetDevID() 670 | Could not get file info for ‘/dev/i2c-0’. No such file or directory.
Jan 6 00:56:16 swi-mdm9x28-wp user.err Legato: =ERR= | supervisor[796]/supervisor T=main | app.c SetCfgDevicePermissions() 780 | Failed to set permissions (rw) for app ‘i2cReading’ on device '/dev/i2c-0’

I don’t know why the script is trying to access ‘dev/i2c-0’. I am using i2c-utils.h. Could someone help me?

I saw it here:

1 Like

Perfect! Thanks a lot!

How did you fix it? my 0 would not change.


requires:
{
    device:
    {
        [rw] /dev/i2c-0 /dev/i2c-0
    }

}

Yes, i changed it to 4 but the log error do not give the 4.

how is the error???

Jun 29 09:17:47 swi-mdm9x28-wp user.info Legato:  INFO | updateDaemon[943]/updateDaemon T=main | app.c app_InstallIndividual() 739 | App batteryReading <99356a70a58e8bf999d0c579351cfb72> was already installed
Jun 29 09:17:47 swi-mdm9x28-wp user.info Legato:  INFO | updateDaemon[943]/updateDaemon T=main | updateDaemon.c ApplyAppUpdate() 963 | App 'batteryReading<99356a70a58e8bf999d0c579351cfb72>' already installed. Discarded app installation.
Jun 29 09:17:55 swi-mdm9x28-wp user.err Legato: =ERR= | supervisor[907]/supervisor T=main | apps.c LaunchApp() 742 | Application 'batteryReading' is already running.
Jun 29 09:17:59 swi-mdm9x28-wp user.info Legato:  INFO | supervisor[907]/supervisor T=main | app.c app_Stop() 3596 | Stopping app 'batteryReading'
Jun 29 09:17:59 swi-mdm9x28-wp user.info Legato:  INFO | supervisor[907]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application 'batteryReading' has stopped.
Jun 29 09:18:00 swi-mdm9x28-wp user.info Legato:  INFO | supervisor[907]/supervisor T=main | app.c app_Start() 3471 | Starting app 'batteryReading'
Jun 29 09:18:01 swi-mdm9x28-wp user.err Legato: =ERR= | supervisor[907]/supervisor T=main | app.c SetCfgDevicePermissions() 777 | Failed to set permissions (rw) for app 'batteryReading' on device '/dev/i2c-0'.

It seems your modification did not take effect, probably you need to “make clean” first.

Or you need to use unsandboxed feature.

I already use the unsandboxed mode:

I don’t see problem with attached app running on WP76 FW13:
batteryReading.rar (106.8 KB)

In the rar you send me i get the following include error. He doesn’t find the file i think.

i’m using the wp77xx

of course you need to point to the file in your toolchain

I haven’t that file in my toolchain. Can i install this?

you can delete that line.

1 Like

I just replace some adresses and i get this error now.

try “make clean” or go back to what you have modified

afbeelding
I can’t use it. And i need to change it. I will read an external sensor.

no idea what you have changed.
But you need to debug yourself for your own modification

I’ve everything deleted and i started back from the beginning and i got the same error.