Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOException: Error reading from I2CDevice on I2CBus '1' ('/dev/i2c-1') at address 0x8 to address 0x1. Got '-1'. #209

Open
kpolleck opened this issue Feb 27, 2017 · 9 comments
Assignees

Comments

@kpolleck
Copy link

After getting my new GoPiGo2 Robot working with the Python example, I tried to set up the Java library, but when running Test.sh, I get the immediate error:

IOException: Error reading from I2CDevice on I2CBus '1' ('/dev/i2c-1') at address 0x8 to address 0x1. Got '-1'.

The java program doesn't exit, and movement commands seem to still work (move forward / move backward / turn right / turn left / etc.) but other commands (e.g. led commands, "board revision," etc.) fail--some of them causing the java program to exit.

I'm wondering...is it possible that whomever wrote this had other accessories attached which might avoid the IOExceptions I am seeing?

@DexterInd
Copy link
Collaborator

@marcellobarile , do you have any idea what might have happened?

@marcellobarile
Copy link
Contributor

marcellobarile commented Feb 27, 2017

hi @kpolleck,
can you please tell me the firmware version which is installed on your GoPiGo? I'll try to reproduce the issue with yours.

Best regards

@kpolleck
Copy link
Author

kpolleck commented Mar 1, 2017

Thanks. It's a GoPiGo2. I'll have to check it when I'm home and let you know.

While we are waiting for that, I'm wondering this: This error occurs every minute or two while everything is idle. Is there some sort of polling in the java library?

@kpolleck
Copy link
Author

kpolleck commented Mar 1, 2017

I also found this http://forum.dexterindustries.com/t/io-read-error/1330/13 suggesting setting:

#Decrease the baud rate?
dtparam=i2c_arm_baudrate=16000 # original suggestion was "dtparam=i2c_arm_baudrate=32000"

I have not tried that yet. Would you recommend it?

@marcellobarile
Copy link
Contributor

marcellobarile commented Mar 1, 2017

Hello @kpolleck,
it might be the voltage checking timer (which ticks every minute).

I look forward to knowing the details of your environment (if possible can you also provide some OS information + Java version, thanks); consider that there might be some breaking change in the newer releases of the pi4j library.

Have a nice day

@marcellobarile
Copy link
Contributor

Nice catch @kpolleck, I was unaware of that thread... I'd say that it might be worthy to give it a try but, if you prefer, I can dig into it a little bit.

@kpolleck
Copy link
Author

kpolleck commented Mar 3, 2017

The baudrate change resolved the problem.

For the record, my other information is:

Robot: GoPiGo2

Pi: Raspberry Pi3

Firmware version::1.6

Board revision:826

Java:
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)

@kpolleck kpolleck closed this as completed Mar 3, 2017
@marcellobarile
Copy link
Contributor

awesome @kpolleck! @DexterInd do you think is there something that I can do codewise? Are you guys aware of this case?

@DexterInd
Copy link
Collaborator

@karan259 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants