Avatar for user136941

user136941

Member since Nov 2021 • Last active Mar 2022
  • 3 conversations
  • 9 comments

Most recent activity

  • in ESP8266
    Avatar for user136941

    Thanks, is already edited the device is 0x68 trying to read the register 0x75 or WHO_AM_I.

    I didn't know that the second parameters accept Bytes.

    Now its works, but the library MPU9250 don't work.

  • in ESP8266
    Avatar for user136941

    Hello, I'm trying to figure out an error, when I realized that the problem is that I'm using wrong the I2C function. I need to read 8 bits from an address (0x75) in a i2c device (0x68). Following code is an example from libraries and docs:

    I2C1.setup( {scl: NodeMCU.D4, sda: NodeMCU.D5} );
    
    I2C1.writeTo(0x68,0x75);
    var data = I2C1.readFrom(0x75,8);
    console.log(data);
    

    Got the next error:

    Uncaught InternalError: I2CRead: No ACK 0
     at line 5 col 33
      var data = I2C1.readFrom(0x75,8);
                                    ^
    in function called from system
    

    The readFrom function doesn't take as parameter the internal address of the device, that's why the error, is pointing to a device no to the internal address.

    My device is an MPU9250, it works on Arduino and Micropython.

  • in ESP8266
    Avatar for user136941

    I'm trying to call WHO_AM_I, don't know if this is the correct way to read data, but this is how it works the module, the example in page doesn't explain well, I mean, how to read 8 bits from device 0x68 to the address 0x75 :

    I2C1.setup( {scl: NodeMCU.D4, sda: NodeMCU.D5} );
    
    I2C1.writeTo(0x68,0x75);
    var data = I2C1.readFrom(0x75,8);
    console.log(data);
    

    But still got the same error:

    Uncaught InternalError: I2CRead: No ACK 0
     at line 5 col 33
      var data = I2C1.readFrom(0x3B,8);
                                    ^
    in function called from system
    
  • in ESP8266
    Avatar for user136941

    I tested it, detects two devices in 0x68 (that is MPU) and 0x76 (Is the BMP).

    Here a full log of the error:

    Init MPU...
    Uncaught InternalError: I2CWrite: No ACK 0
     at line 1 col 15
    a.writeTo(12,c);return a.readFrom(12,d)
                  ^
    in function "rmag" called from line 1 col 49
    ...ew Uint8Array(this.rmag(3,7))).buffer),b=49­120/32760;return{...
                                  ^
    in function "readMag" called from line 1 col 63
    ...eadGyro(),mag:this.readMag(),new:this­.dataReady()}
                                  ^
    in function "read" called from line 3 col 23
          data = mpu.read();
                          ^
    in function called from system
    Uncaught Error: Unhandled promise rejection: InternalError: I2CWrite: No ACK 0
    
  • in ESP8266
    Avatar for user136941

    Espruino have some function for scan all i2c devices connected?

  • in ESP8266
    Avatar for user136941

    Hello,

    I'm trying to read a gyroscope (GY-91), that have an MPU-9250 inside with an BMP-280. I'm using this library But I have some problems.

    When I'm run the code throw the next error:

    Uncaught InternalError: I2CWrite: No ACK 0
    

    I'm trying with a LCD i2c, in case that if is the module that is wrong, but got the same error. Also, doesn't work with D pins (D0, D1, D2...) only with numbers

    //This doesn't work
    I2C1.setup({ scl: D4, sda: D5 });
    //This works
    I2C1.setup({ scl: 2, sda: 14 });
    

    After change the numbers the LCD works, but the MPU still don't.

    Edit: A full log of the error:

    Init MPU...
    Uncaught InternalError: I2CWrite: No ACK 0
     at line 1 col 15
    a.writeTo(12,c);return a.readFrom(12,d)
                  ^
    in function "rmag" called from line 1 col 49
    ...ew Uint8Array(this.rmag(3,7))).buffer),b=49­120/32760;return{...
                                  ^
    in function "readMag" called from line 1 col 63
    ...eadGyro(),mag:this.readMag(),new:this­.dataReady()}
                                  ^
    in function "read" called from line 3 col 23
          data = mpu.read();
                          ^
    in function called from system
    Uncaught Error: Unhandled promise rejection: InternalError: I2CWrite: No ACK 0
    
  • in ESP8266
    Avatar for user136941

    Well, the Github issue is interesting, but I cannot find how to improve my template there. My template works, but is not well designed, I mean, is ugly.

    • 3 comments
    • 529 views
Actions