# I2c app problems

**URL:** <https://mangoh.discourse.group/t/i2c-app-problems/2398>\
**Category:** mangOH Red\
**Created:** [February 22, 2019, 5:31pm UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398 "2019-02-22T17:31:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugo\_secreto](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@hugo\_secreto](https://mangoh.discourse.group/u/hugo_secreto)\
**Post date:** [February 22, 2019, 5:31pm UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/1 "2019-02-22T17:31:49Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [February 26, 2019, 2:09am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/2 "2019-02-26T02:09:44Z")

</div>

I saw it here:

> <https://github.com/mangOH/mangOH/blob/master/samples/tutorials/mangOH_Red/i2c/BatteryChargerReading/batteryReading.adef>

---

<div class="post-metadata">

**Author:** ![hugo\_secreto](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@hugo\_secreto](https://mangoh.discourse.group/u/hugo_secreto)\
**Post date:** [February 26, 2019, 4:28pm UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/3 "2019-02-26T16:28:10Z")

</div>

Perfect! Thanks a lot!

---

<div class="post-metadata">

**Author:** ![lukasmertens](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lukasmertens](https://mangoh.discourse.group/u/lukasmertens)\
**Post date:** [June 29, 2021, 7:05am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/4 "2021-06-29T07:05:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [June 29, 2021, 7:15am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/5 "2021-06-29T07:15:52Z")

</div>

```auto

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

```

}

---

<div class="post-metadata">

**Author:** ![lukasmertens](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lukasmertens](https://mangoh.discourse.group/u/lukasmertens)\
**Post date:** [June 29, 2021, 7:17am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/6 "2021-06-29T07:17:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [June 29, 2021, 7:19am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/7 "2021-06-29T07:19:20Z")

</div>

how is the error???

---

<div class="post-metadata">

**Author:** ![lukasmertens](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lukasmertens](https://mangoh.discourse.group/u/lukasmertens)\
**Post date:** [June 29, 2021, 7:19am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/8 "2021-06-29T07:19:51Z")

</div>

```auto
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'.

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [June 29, 2021, 7:23am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/9 "2021-06-29T07:23:07Z")

</div>

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

Or you need to use unsandboxed feature.

---

<div class="post-metadata">

**Author:** ![lukasmertens](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lukasmertens](https://mangoh.discourse.group/u/lukasmertens)\
**Post date:** [June 29, 2021, 7:24am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/10 "2021-06-29T07:24:03Z")

</div>

I already use the unsandboxed mode:

 ![afbeelding](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/d/d11bcf9225459eafbab766d6c90e39fe1dc910a5.png)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [June 29, 2021, 8:09am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/11 "2021-06-29T08:09:18Z")

</div>

I don’t see problem with attached app running on WP76 FW13:  
[batteryReading.rar](https://mangoh.discourse.group/uploads/short-url/eR1pXgYK61CF7aFZ2WgeNeQ8opO.rar) (106.8 KB)

---

<div class="post-metadata">

**Author:** ![lukasmertens](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lukasmertens](https://mangoh.discourse.group/u/lukasmertens)\
**Post date:** [June 29, 2021, 8:14am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/12 "2021-06-29T08:14:45Z")

</div>

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

 ![afbeelding](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/e/e7a62b85f3f0782c506498384b9d295d59d1f4f0.png)

i’m using the wp77xx

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [June 29, 2021, 8:16am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/13 "2021-06-29T08:16:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lukasmertens](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lukasmertens](https://mangoh.discourse.group/u/lukasmertens)\
**Post date:** [June 29, 2021, 8:18am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/14 "2021-06-29T08:18:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [June 29, 2021, 8:20am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/15 "2021-06-29T08:20:39Z")

</div>

you can delete that line.

---

<div class="post-metadata">

**Author:** ![lukasmertens](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lukasmertens](https://mangoh.discourse.group/u/lukasmertens)\
**Post date:** [June 29, 2021, 8:50am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/16 "2021-06-29T08:50:04Z")

</div>

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

 ![afbeelding](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/a/ae8fb70a4e354a32f5fed7350be1acf01bd6b3c1.png)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [June 29, 2021, 9:00am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/17 "2021-06-29T09:00:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lukasmertens](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lukasmertens](https://mangoh.discourse.group/u/lukasmertens)\
**Post date:** [June 29, 2021, 9:01am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/18 "2021-06-29T09:01:15Z")

</div>

![afbeelding](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/d/d0ebeaf7102cff52bec9c3fae2be839919289d2e.png)  
I can’t use it. And i need to change it. I will read an external sensor.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [June 29, 2021, 9:02am UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/19 "2021-06-29T09:02:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lukasmertens](https://avatars.discourse-cdn.com/v4/letter/l/48db29/32.png) [@lukasmertens](https://mangoh.discourse.group/u/lukasmertens)\
**Post date:** [June 29, 2021, 12:30pm UTC](https://mangoh.discourse.group/t/i2c-app-problems/2398/20 "2021-06-29T12:30:58Z")

</div>

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

[Next page](https://mangoh.discourse.group/t/i2c-app-problems/2398.md?page=2)
