Skip to content

Raspberry Pi I2C bus scan detection program. Detects I2C 7-bit address and prints them to screen. Scan for I2C devices, to see if any slaves are present on the I2C bus. Uses bcm2835 Library not linux drivers, designed for users of bcm2835 library

License

Notifications You must be signed in to change notification settings

gavinlyonsrepo/I2CDetectGL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I2CDetectGL

Overview

The bcm2835 library works directly on the SPI/I2C devices. It is not using any Linux device drivers. When relevant Linux drivers are loaded or activated then it can create unexpected behavior from other software like 'i2cdetect'. So a I created a bcm2835 version of i2cdetect, I2CDetectGL.

Raspberry Pi I2C bus scan detection program. Detects I2C 7-bit address and prints them to screen. Scan for I2C devices, to see if any slaves are present on the I2C bus. Uses bcm2835 Library v1.7.5 dependency. Provides low level I2C bus, delays and GPIO control.

Dependency

Install the dependency bcm2835 Library if not installed (at time of writing latest version is 1.7.5) Install the C libraries of bcm2835, Installation instructions here

Installation

Enter your Downloads folder, then type in terminal. To download, build , install and test.

curl -L -O https://github.com/gavinlyonsrepo/I2CDetectGL/archive/main.zip
unzip main.zip
cd I2CDetectGL-main
make
sudo make install

Usage

To print help message

sudo i2cDetectGL -h

Software

Options

Flag Description
-h print help message
-v print version numbers
-m Scan I2C bus and print table
-s Scan I2C bus and print detected devices
-a I2C_ADDRESS Probe a 7-bit I2C address passed as 2nd argument eg 0x3C

Errors

Error number Description Solution
1201 Cannot open bcm2835 library Run as sudo
1202 Cannot start I2C bus run as sudo
1203 Unsupported option
1204 No i2c address specified for -a option Enter an I2C Address eg i2cDetectGL -a 0x3C
1205 Invalid I2C address passed for -a option Enter a valid 7-bit I2c Address range 0x00 to 0x7F
1206 Reserved Address chosen for -a option 0x00 to 0x07 and 0x78 to 0x7F are reserved

Output

Detecting an SSD1306 I2C OLED on i2C Bus at address 0x3C.

  1. @ = Detection of device on bus.
  2. . = No detection
  3. R = Reserved address

i2c

About

Raspberry Pi I2C bus scan detection program. Detects I2C 7-bit address and prints them to screen. Scan for I2C devices, to see if any slaves are present on the I2C bus. Uses bcm2835 Library not linux drivers, designed for users of bcm2835 library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published