UDOO Brick not found

Discussion in 'UDOO X86' started by Bert Casper, Aug 29, 2017.

  1. Bert Casper

    Bert Casper New Member

    Joined:
    Aug 29, 2017
    Messages:
    2
    Likes Received:
    2
    Just got my new UDOO x86 Advanced Plus, and put Linux Mint on it. Works great!

    I also bought a barometric pressure brick and attached it. However, even after resetting the Arduino and power-cycling, I can't see it on any bus with i2cdetect (tried several). Also, I can't find it under /sys/class/i2c-dev/i2c-x...

    I made sure that the i2c buses are enabled in the BIOS.

    Any thoughts on what might be wrong?
    Thanks.
     
  2. Laura

    Laura UDOOer

    Joined:
    Apr 22, 2016
    Messages:
    374
    Likes Received:
    155
  3. Nico

    Nico New Member

    Joined:
    Jan 19, 2016
    Messages:
    27
    Likes Received:
    5
    Hi guys !

    I've got the same problem, and I am not an expert with arduino or Linux...
    I am using a UDOO x86, and trying to use Barometer brick. I was able to get value from linux with my UDOO Neo by reading these files :
    /sys/class/i2c-dev/i2c-1/device/1-0060/iio\:device0/in_temp_scale and
    /sys/class/i2c-dev/i2c-1/device/1-0060/iio\:device0/in_temp_raw
    I think some packages were installed because I was using UDOObuntu, and I am now using a simple debian with my x86, so does anyone know if there is possible to read the value from the i2c using linux "cat" ?
     
  4. Laura

    Laura UDOOer

    Joined:
    Apr 22, 2016
    Messages:
    374
    Likes Received:
    155
  5. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,302
    Likes Received:
    575
    I must say the usage of the bricks is not very well documented. You have to get through a lot of pages to find basic information like:
    • Where to find a suitable arduino library for the brick
    • What is the I2C address so that arduino libraries can be modified accordingly
    • How to use it in combination with Neo (default connected to Linux side but can be connected to arduino side) or Udoo X86 (Fixed on Arduino side).
    Why not make a basic Docs Bricks section in resources?
     
    stecolumna likes this.
  6. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,302
    Likes Received:
    575
    And why is there no Bricks section in https://www.udoo.org/docs-x86/Arduino_101_(Intel_Curie)/Overview.html ?
     
    stecolumna likes this.
  7. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,302
    Likes Received:
    575
    I see the Udoo team is looking on the forum too, there is a Bricks section added here https://www.udoo.org/docs-x86/Arduino_101_(Intel_Curie)/Pinout.html

    It references to page https://www.udoo.org/docs-x86/Hardware_&_Accessories/Bricks_snap_in_sensors.html which only mentions the Light Brick. Are the other sensors (Temp, Barometer, Gesture, Humidity ) added too?

    For Light, Gesture and Humidity Bricks the datasheets and other information in the accessoires section of https://www.udoo.org/other-resources/ are still missing. Are they added too?
     
  8. Nico

    Nico New Member

    Joined:
    Jan 19, 2016
    Messages:
    27
    Likes Received:
    5
    Communicate using a serial connection is not a problem, but like said waltervl there is no UDOO documentation about barometer bricks...
    I have found this arduino library https://github.com/adafruit/Adafruit_MPL3115A2_Library but it does not seem to work...
    Do I need to make a change for an address inside the .h file ? Like for the Light sensor bricks according to waltervl link ?
    @waltervl : Thanks for your answers, I checked all your links, especially the one which give me the barometer brick documentation, but I did not understand anything inside of this documentation... I tried to find the sensor address to use inside the .h file for the library but this did not work...
     
  9. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,302
    Likes Received:
    575
    page 16 of that barometer brick pdf: The standard 7-bit I2C slave address is 0x60 or 1100000. 8-bit read is 0xC1, 8-bit write is 0xC0.

    I think you have to use 0x60 (but I am not familiar with this, could also be the 0xC1)

    The .h file states:
    Code:
    #define MPL3115A2_ADDRESS (0x60) // 1100000
    That seems to be in compliance with the documentation. So the library should work if the I2C adress is not changed by Udoo Team.
    @Laura can you confirm I2C adress of this brick?
     
  10. Nico

    Nico New Member

    Joined:
    Jan 19, 2016
    Messages:
    27
    Likes Received:
    5
    I have made some tests, using the example inside the Adafruit library and it is not working...
    Here is the library's example code :
    Code:
    #include <Wire.h>
    #include <Adafruit_MPL3115A2.h>
    
    // Power by connecting Vin to 3-5V, GND to GND
    // Uses I2C - connect SCL to the SCL pin, SDA to SDA pin
    // See the Wire tutorial for pinouts for each Arduino
    // http://arduino.cc/en/reference/wire
    Adafruit_MPL3115A2 baro = Adafruit_MPL3115A2();
    
    void setup() {
      Serial.begin(9600);
      Serial.println("Adafruit_MPL3115A2 test!");
    }
    
    void loop() {
      if (! baro.begin()) {
        Serial.println("Couldnt find sensor");
        return;
      }
     
      float pascals = baro.getPressure();
      // Our weather page presents pressure in Inches (Hg)
      // Use http://www.onlineconversion.com/pressure.htm for other units
      Serial.print(pascals/3377); Serial.println(" Inches (Hg)");
    
      float altm = baro.getAltitude();
      Serial.print(altm); Serial.println(" meters");
    
      float tempC = baro.getTemperature();
      Serial.print(tempC); Serial.println("*C");
    
      delay(250);
    }
    By running this code, I did not get anything in the serial console (inside Arduino IDE).
    If I change the loop function with this code :
    Code:
    void loop() {
    Serial.println("loop iteration");
      if (! baro.begin()) {
        Serial.println("Couldnt find sensor");
        return;
      }
     
      Serial.println("working");
    
      delay(2000);
    }
    I got this print on the console :
    Code:
    loop iteration
    couldnt find sensor
    loop iteration
    working
    
    loop iteration
    couldnt find sensor
    loop iteration
    working
    
    ...
    There is no delay between "couldnt find sensor" and next "loop iteration" but there is a 2 sec delay after "working" (this seems normal).
    But if I try to add a baro.getAltitude, baro.getPressure or baro.getTemperature I do not see anything in the console...

    Edit : I have tried the 0xC0 address but not the 0xC1 address, I will try it and let you know if it works.
    Edit2 : Since I got some "working" message, the address should be good, by changing it, I did not get any "working" message anymore
     
    Last edited: Aug 29, 2017
  11. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,302
    Likes Received:
    575
  12. Nico

    Nico New Member

    Joined:
    Jan 19, 2016
    Messages:
    27
    Likes Received:
    5
    I have run the code you prodived, and it returns "No I2C devices found", I tried to unplug, plug the I2C device, try the temperature brick, change the cable, it printed only one time this : "Device found at address 0x60 (MP3115,MCP4725, MCP4728, TEA5767, Si5351)"

    I have done another test, run the full Adafruit demo, and when I unplung the sensor, I got this print :
    "19872.33 Inches (Hg)
    -0.06 meters
    -0.06*C
    Couldnt find sensor
    Couldnt find sensor
    Couldnt find sensor
    ..."
    It freezes again when I plug the sensor, and unfreeze when I unplug it...
     
  13. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,302
    Likes Received:
    575
    OK, I did some testing too on a Humidity Brick. It is working for me but with some small hurdles:
    1. Connected to the Udoo X86 and run the I2C-scanner
    Result in Arduino IDE Serial monitor:
    Code:
    I2C Scanner
    Scanning...
    Device found at address 0x40  (PCA9685,Si7021)
    done
    
    Scanning...
    No I2C devices found
    
    Scanning...
    No I2C devices found
    
    
    This is appearently a normal result. It finds the device once and then will not discover it again unless you upload the scanner again to the Arduino.

    2. Try to get output from the Humidity Brick:
    Searched for Arduino library/code for the SI7006-A20 chip.
    Tried the following: https://github.com/automote/Si7006 Result: Did not work, no output from sensor at all!! And a lot of warnings during compiling.
    Tried https://github.com/ControlEverythingCommunity/SI7006-A20/blob/master/arduino/SI7006_A20.ino (no library used in this sketch only the standard Wire.h) Result: OK giving a steady flow of data (it is hot in Holland)
    Code:
    Relative humidity : 56.01 % RH
    Temperature in Celsius : 26.73 C
    Temperature in Fahrenheit : 80.12 F
    Relative humidity : 56.01 % RH
    Temperature in Celsius : 26.71 C
    Temperature in Fahrenheit : 80.08 F
    Relative humidity : 56.01 % RH
    Temperature in Celsius : 26.71 C
    Temperature in Fahrenheit : 80.08 F
    Relative humidity : 56.01 % RH
    Temperature in Celsius : 26.71 C
    Temperature in Fahrenheit : 80.08 F
    
    Conclusion: I2C Humidity Brick is working on the Udoo X86 but it depends on the code you are using (as normal in the Arduino Udoo scene :) )
     
    Last edited: Aug 29, 2017
    Nico and stecolumna like this.
  14. stecolumna

    stecolumna UDOOer

    Joined:
    May 20, 2016
    Messages:
    152
    Likes Received:
    34
    Dear waltervl

    I have used SI7006_A20.ino you cited in the precedent post and work fine for me too:

    <code>
    Temperature in Celsius : 32.17 C
    Temperature in Fahrenheit : 89.91 F
    Relative humidity : 33.55 % RH
    </code>

    Rome is hot :)

    Now please give us the ino code also for gesture (PAJ7620U2) and light (TSL2561) sensors.

    Thanks in advance
     
    waltervl likes this.
  15. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,302
    Likes Received:
    575
    As I don't have those bricks I cannot give you working code. You have to search and try the results found yourself. The scanner code can help you identifying the I2C address.
     
  16. stecolumna

    stecolumna UDOOer

    Joined:
    May 20, 2016
    Messages:
    152
    Likes Received:
    34
    Dear waltervl

    I have found the ino code for the second and third sensor but it generate some errors.

    Thanks anyway
     
  17. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,302
    Likes Received:
    575
    Please share the results if someone managed to find a good working sketch/library for the barometer, gesture or light brick. I believe Udoo has a link to a working light brick library mentioned on their page.
     
  18. Bert Casper

    Bert Casper New Member

    Joined:
    Aug 29, 2017
    Messages:
    2
    Likes Received:
    2
    Thanks for all your great replies. That helped a lot. I played around with it and can confirm that the brick is available on 0x60. I modified @waltervl i2scanner (in a hacky and trivial way) to do it (see below). Thanks @waltervl .

    I then went ahead and modified the Adafruit code provided by @Nico . The result is that I can read the temperature (well, sort of). I didn't play around with it further and it's really hacky, but here is the code for anyone who wants to play with it more.

    Code:
    #include <Wire.h>
    
    void setup() {
      Wire.begin();
      Serial.begin(9600);
      while (!Serial);        // Leonardo: wait for serial monitor
      Serial.println(F("\nI2C Scanner"));
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
        Wire.beginTransmission(0x60);
        Wire.write(0x04);
        byte error = Wire.endTransmission(false);
    
        if(error == 0){
          Serial.println("Device found at 0x60");
        }
        else{
          Serial.print("Error = ");
          Serial.println(error);
        }
        Wire.requestFrom(0x60,2);
        int t = Wire.read();
        Serial.print("T = ");
        Serial.println(t);
    }
     
    Nico and waltervl like this.
  19. Nico

    Nico New Member

    Joined:
    Jan 19, 2016
    Messages:
    27
    Likes Received:
    5
    Thanks for this answers !
    @Bert Casper : I've tried your code, and it works well ! If I can't find a library to do this for me, I will try to use directly Wire.h :)
    @waltervl : Thanks for your help, I will search for another library, and post here if I find one who works perfectly with the Barometer brick !
     
  20. Nico

    Nico New Member

    Joined:
    Jan 19, 2016
    Messages:
    27
    Likes Received:
    5
    I have found a library that works well with UDOO barometer brick : https://github.com/mariocannistra/MPL3115A2
    I thought that Adafruit library will work with UDOO brick (like the Adafruit library for light sensor), but this other one works without any problem !
    Thanks guys once again for the help !
     
    waltervl likes this.

Share This Page