CodeSys Raspberry pi I2C driver not found

jeroenaero
2024-11-07
2024-11-12
1 2 > >> (Page 1 of 2)
  • jeroenaero - 2024-11-07

    Hello,

    We have a problem with CodeSys on a raspbery pi with an ADS1015 analog to I2C module.
    It can't find the I2C device on the i2c bus, it says No I2C Driver Found. When we use the RPI terminal we can find the I2C device and read it out. The i2c-1 bus is also accessible from codesys. The device address of the Analog to I2C module is 0x48.
    Can someone have a look what the problem is? i submitted the screenshots in the attachments.
    i also include the device description and library.

     
  • andrax

    andrax - 2024-11-07

    I took a look at the xml
    Is this even the right driver and where did you get it?

     
  • jeroenaero - 2024-11-07

    yes i took the library from another forum: https://forge.codesys.com/forge/talk/Runtime/thread/f1400b71b6/, it is made for the ads1115 but the ads1015 is almost the same device with same adresses i only changed the divide value of the analog value, because thats the only difference between the ads1115 and ads1015.

     
  • jeroenaero - 2024-11-07

    thank you, i tried your library and device description but i don't get analog values.
    Do i something wrong?
    i also got an library error at the I2C_BASE functionblock the calcCycleTime gave an variable size error, so i added thet conversion from ULINT_TO_UDINT.

     
  • andrax

    andrax - 2024-11-07

    Ok,
    this is a test programme with ADS1115.
    It is currently configured for the TCA9548 muxboard.
    If you want to run the ADS1115 single, then change the settings to the default values:
    β€˜Is Multiplex:’ False
    β€˜Stage mux channel numbers:’ [0,0,0,0,0,0,0,0,0]

    It is also important that the libraries are installed correctly here.
    But should be in this project

     
  • andrax

    andrax - 2024-11-07

    Note: if you do not get any values.
    Check the correct wiring again.
    The board seems to be running and you have no error.

     

    Last edit: andrax 2024-11-07
  • jeroenaero - 2024-11-07

    Okay i will try.
    I tried already the different settings.
    The CodeSys version i use, is CodeSys 3.5 SP20 Patch 3.
    The device which i use is CodeSys Control For Raspberry PI 64 SL version 4.13.0.0.
    The wiring should be okay because i'm using the Edatec ED-CM4IND-1432-4C(EU).

     

    Last edit: jeroenaero 2024-11-07
  • andrax

    andrax - 2024-11-08

    Hi,
    Communication with the ADS1115 is actually simple.
    1. write config
    2. write address pointer
    3. read conversation register
    The ADS1115 works like a multiplexer.
    This means that you do this individually for each channel that you want to read.
    e.g:
    Channel 1: write config > write address pointer > read conversation register
    Channel 2: write config > write address pointer > read conversation register
    Channel 3: write config > write address pointer > read conversation register
    Channel 4: write config > write address pointer > read conversation register
    then you start again from the beginning
    You can also omit individual channels or read only one.
    It doesn't matter.
    I have written the driver so that I can also use it on the TCA9548.
    The driver is from Stefan Dreyer.
    In your case, the driver works and communication with the ADS1115 is running.
    As you can see, the cfgWrong:=FALSE
    If you could not write or read data, cfgWrong:=TRUE;
    This means that either something is wrong with your ADS1115 or you have connected something incorrectly.
    Question: what voltage do you want to measure?

     
  • jeroenaero - 2024-11-08

    The voltage what i want to measure is 3.286v.
    I can check the voltage through terminal, see screenshots.

     

    Last edit: jeroenaero 2024-11-08
  • andrax

    andrax - 2024-11-08

    You are also missing the libraries.
    No library should be grayed out or highlighted in blue

     
  • andrax

    andrax - 2024-11-08

    your driver is not running.
    All libraries must be present first!
    Then you can try the following.
    Delete the ADS1115 and the I2C_maseter from the device tree.
    Create everything again.

     
  • jeroenaero - 2024-11-08

    okay, the weird thing is the driver is only continuous running when i enable debug output.
    if debug is not enabled it's continuous switching from running to not running.
    i will check again and download the libraries
    Which versions of libraries do you use, can you send a screenshot?

     
  • andrax

    andrax - 2024-11-08

    Ok, with debug you suppress the errors, but that doesn't help you any further.
    You can find information about the missing drivers here
    https://forge.codesys.com/forge/talk/Runtime/thread/8981ce928a/
    and here
    https://github.com/stefandreyer/I2C-Multiplex

    I'll have to have another look at which library you need.
    But you can easily find out.
    Create a completely empty project and insert the TCA9548.
    You don't need the board.
    Then look in the library and resolve all conflicts
    If you can compile the project without errors, delete the TCA9548 and insert the ADS1115.
    The driver should then also run.
    Small bonus: with the TCA9548 you can expand your network as you wish and use identical sensors multiple times

     
  • jeroenaero - 2024-11-08

    i created a new project and did what you said, but still the same problem unfortunately.
    The ADS1115 is constantly changing from running to not running.

     
  • jeroenaero - 2024-11-08

    i created a new project and did what you said, but still the same problem unfortunately.
    The ADS1115 is constantly changing from running to not running.

     
  • jeroenaero - 2024-11-08

    i created a new project and did what you said, but still the same problem unfortunately.
    The ADS1115 is constantly changing from running to not running.

     
  • jeroenaero - 2024-11-08

    i created a new project and did what you said, but still the same problem unfortunately.
    The ADS1115 is constantly changing from running to not running.

     
  • jeroenaero - 2024-11-08

    i created a new project and did what you said, but still the same problem unfortunately.
    The ADS1115 is constantly changing from running to not running.

     
  • jeroenaero - 2024-11-08

    i created a new project and did what you said, but still the same problem unfortunately.
    The ADS1115 is constantly changing from running to not running.

     
  • jeroenaero - 2024-11-08

    i created a new project and did what you said, but still the same problem unfortunately.
    The ADS1115 is constantly changing from running to not running.

     
  • andrax

    andrax - 2024-11-09

    Can you please make your project available?
    I'll take a look at it.

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.