4 Replies Latest reply on Jun 2, 2015 1:07 AM by arfoll

    No i2c on board in node.js

    OneQ

      Hello developers.

       

      I'm working on an edison board to use an i2c sensor.

       

      I used the intel mraa library in the node.js.

       

      I also changed the number to 0~10 in m.I2c(x).

      The node.js code is

      var m = require('mraa');
      var i2c = new m.I2c(1);
      
      

       

      I got an error message :

      Platform not currently allowed for mraa use
      No i2c on board
      
      

       

      i2cdetect command result is

      root@user:~# i2cdetect -y -r 1
           0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
      00:          -- -- -- -- -- -- -- -- -- -- -- -- --
      10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      20: UU UU UU UU -- -- -- -- -- -- -- -- -- -- -- --
      30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      70: -- -- -- -- -- -- -- --
      
      

       

       

      How can I use the i2c sensor?

        • 2. Re: No i2c on board in node.js
          OneQ

          Thanks I checked port 6.

           

          Then I got this messages.

           

           

          root@soosang:~# i2cdetect -r -y 6

               0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

          00:          [ 2808.569600] i2c-designware-pci 0000:00:09.1: ===== REGISTER DUMP (i2c) =====

          [ 2808.569699] i2c-designware-pci 0000:00:09.1: DW_IC_CON:               0x65

          [ 2808.569774] i2c-designware-pci 0000:00:09.1: DW_IC_TAR:               0x3

          [ 2808.569846] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_HCNT:       0x2f8

          [ 2808.569919] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_LCNT:       0x37b

          [ 2808.569991] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_HCNT:       0x87

          [ 2808.570063] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_LCNT:       0x10a

          [ 2808.570135] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_STAT:         0x0

          [ 2808.570207] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_MASK:         0x246

          [ 2808.570279] i2c-designware-pci 0000:00:09.1: DW_IC_RAW_INTR_STAT:     0x10

          [ 2808.570351] i2c-designware-pci 0000:00:09.1: DW_IC_RX_TL:             0x20

          [ 2808.570423] i2c-designware-pci 0000:00:09.1: DW_IC_TX_TL:             0x20

          [ 2808.570494] i2c-designware-pci 0000:00:09.1: DW_IC_ENABLE:            0x1

          [ 2808.570565] i2c-designware-pci 0000:00:09.1: DW_IC_STATUS:            0x2

          [ 2808.570636] i2c-designware-pci 0000:00:09.1: DW_IC_TXFLR:             0x1

          [ 2808.570707] i2c-designware-pci 0000:00:09.1: DW_IC_RXFLR:             0x0

          [ 2808.570778] i2c-designware-pci 0000:00:09.1: DW_IC_TX_ABRT_SOURCE:    0x0

          [ 2808.570849] i2c-designware-pci 0000:00:09.1: DW_IC_DATA_CMD:          0x0

          [ 2808.570919] i2c-designware-pci 0000:00:09.1: ===============================

          [ 2808.571022] CPU: 0 PID: 7312 Comm: i2cdetect Tainted: G        W  O 3.10.17-poky-edison+ #1

          [ 2808.571027] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

          [ 2808.571035] task: f4f44850 ti: f4dce000 task.ti: f4dce000

          [ 2808.571096] Stack:

          [ 2808.571164] Call Trace:

          [ 2808.571582] Code: b3 ff ff 89 f8 09 d0 80 ce 04 83 ff 02 0f 44 c2 8b 15 54 ab b0 c1 89 82 00 b3 ff ff f7 c6 00 02 00 00 74 14 e8 67 f7 0a 00 56 9d <83> c4 04 5b 5e 5f 5d c3 90 8d 74 26 00 56 9d e8 51 f3 0a 00 83

          [ 2808.571607] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G        W  O 3.10.17-poky-edison+ #1

          [ 2808.571612] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

          [ 2808.571621] task: f6c83d30 ti: f6e1c000 task.ti: f6e1c000

          [ 2808.571682] Stack:

          [ 2808.571750] Call Trace:

          [ 2808.571956] Code: 8b 42 08 a8 08 75 24 31 c9 8d 42 08 89 ca 0f 01 c8 0f ae f0 89 f6 89 e0 25 00 e0 ff ff 8b 40 08 a8 08 75 07 b1 01 89 f0 0f 01 c9 <85> 1d 58 fd b3 c1 75 0d 8d 55 f0 b8 05 00 00 00 e8 8d 34 d9 ff

          [ 2808.572591] i2c-6: recovery ignore

          --

          Broadcast message from systemd-journald@soosang (Sun 2015-05-31 13:07:17 UTC):

           

           

          kernel[196]: [ 2808.571022] CPU: 0 PID: 7312 Comm: i2cdetect Tainted: G        W  O 3.10.17-poky-edison+ #1

           

           

           

           

          Broadcast message from systemd-journald@soosang (Sun 2015-05-31 13:07:17 UTC):

           

           

          kernel[196]: [ 2808.571027] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

           

           

           

           

          Broadcast message from systemd-journald@soosang (Sun 2015-05-31 13:07:17 UTC):

           

           

          kernel[196]: [ 2808.571035] task: f4f44850 ti: f4dce000 task.ti: f4dce000

           

           

           

           

          Broadcast message from systemd-journald@soosang (Sun 2015-05-31 13:07:17 UTC):

           

           

          kernel[196]: [ 2808.571096] Stack:

           

           

           

           

          Broadcast message from systemd-journald@soosang (Sun 2015-05-31 13:07:17 UTC):

           

           

          kernel[196]: [ 2808.571164] Call Trace:

           

           

           

           

          Broadcast message from systemd-journald@soosang (Sun 2015-05-31 13:07:17 UTC):

           

           

          kernel[196]: [ 2808.571582] Code: b3 ff ff 89 f8 09 d0 80 ce 04 83 ff 02 0f 44 c2 8b 15 54 ab b0 c1 89 82 00 b3 ff ff f7 c6 00 02 00 00 74 14 e8 67 f7 0a 00 56 9d <83> c4 04 5b 5e 5f 5d c3 90 8d 74 26 00 56 9d e8 51 f3 0a 00 83

           

           

           

           

          Broadcast message from systemd-journald@soosang (Sun 2015-05-31 13:07:17 UTC):

           

           

          kernel[196]: [ 2808.571607] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G        W  O 3.10.17-poky-edison+ #1

          • 3. Re: No i2c on board in node.js
            Eliot

            You have to setup the pins for i2c6 before you probe the port otherwise you'll get that error.

             

            root@edison:~# echo 27 > /sys/class/gpio/export 
            root@edison:~# echo 28 > /sys/class/gpio/export 
            root@edison:~# echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux 
            root@edison:~# echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux 
            root@edison:~# i2cdetect -y -r 6
                 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
            00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
            10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
            20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
            30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
            40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
            50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
            60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
            70: -- -- -- -- -- -- -- --                         
            
            • 4. Re: No i2c on board in node.js
              arfoll

              if you use requst bus 6 in mraa it will work. Requesing 0 will go to default which in this case is 6.