Home › Forums › Forums › Technical Support for BerryGPS and BerryGPS-IMU › error: ‘I2C_SMBUS_BLOCK_MAX’ undeclared
- This topic has 5 replies, 2 voices, and was last updated 3 years, 7 months ago by pmel.
- August 5, 2019 at 1:01 pm #9115
I have a BerryGPS-IMUv3, Raspberry Pi 3B+, running Raspbian Buster full (2019-07-10).
GPS module works fine.
sudo i2cdetect -y 1 - shows 1C, 6A and 77.
I have followed the guides including this https://github.com/ozzmaker/BerryIMU/issues/8 . However, when compiling gyro_accelerometer_tutorial02.c I get the following error : IMU.c:143:14: error: ‘I2C_SMBUS_BLOCK_MAX’ undeclared (first use in this function)
N.B. The readme says that v1 and v2 are supported, implication that v3 is NOT supported, is this correct?
Any guidance greatly appreciated.August 5, 2019 at 2:59 pm #9119
it looks like you are missing some libraries
try installing these
sudo apt-get install i2c-tools libi2c-dev python-smbusAugust 6, 2019 at 12:02 am #9130
Firstly, many thanks for your speedy response and support.
I ran the command / installed the packages you specified, however, it did not resolve the error!
Here is the output, also I have attached a screenshot of the shell. Any further ideas please?
$ sudo apt-get install i2c-tools libi2c-dev python-smbus
Reading package lists... Done
Building dependency tree
Reading state information... Done
i2c-tools is already the newest version (4.1-1).
libi2c-dev is already the newest version (4.1-1).
python-smbus is already the newest version (4.1-1).
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Attachments:August 6, 2019 at 12:55 pm #9153
do you have this file?
can you show me the output of this command
dpkg -l libi2c-dev
Also try this header file..
1. go into the directory where the code is
2. download this older header file
3. open IMU.c and change this line;
4. try to compile againAugust 6, 2019 at 12:56 pm #9154
i forgot to add.. ill need to check to see if something has changed with Raspbian BusterAugust 6, 2019 at 11:59 pm #9172
Again, many thanks for your speedy response and support, it's very much appreciated!
To answer your questions;
I do have just 1 i2c-dev.h (I did use "find" to search the entire file-system), ls -l
-rw-r--r-- 1 root root 2612 Dec 3 2018 /usr/include/linux/i2c-dev.h
Interestingly, and I think related, is this post, https://raspberrypi.stackexchange.com/questions/37689/how-do-i-use-the-i2c-bus, As can be seen from the "ls -l", i2c-dev.h with "Raspbian Buster" is 2612 in size, the download you suggest is 11507!
-rw-r--r-- 1 pi pi 11507 Aug 6 03:49 i2c-dev.h
$ dpkg -l libi2c-dev
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
ii libi2c-dev 4.1-1 armhf userspace I2C programming library development files
I followed your re-compile instructions, and THAT WORKED! many thanks.
I have a suspicion / intuition, that this issue is related to the "Rasbian Buster" build / install, PLEASE let us know what you find?
Again, many thanks!
- You must be logged in to reply to this topic.