snmahajan30 / vibration-analysis-using-adxl345-python

A data acquisition system based on Raspberry Pi for measurement of vibrations induced due to rotation of a ball bearing. Application of data analytics to predict bearing failure based on past vibration data.
12 stars 5 forks source link

error with smbus @fxdgear #1

Open Jebel04 opened 5 years ago

Jebel04 commented 5 years ago

@fxdgear pi@raspberrypi:~ $ python adxl345_final.py Traceback (most recent call last): File "adxl345_final.py", line 9, in bus = smbus.SMBus(1 if int(revision, 16) >= 4 else 0) File "/home/pi/.local/lib/python2.7/site-packages/smbus/smbus.py", line 56, in init self.open(bus) File "/home/pi/.local/lib/python2.7/site-packages/smbus/smbus.py", line 83, in open raise IOError(e.errno) IOError: 2 I get this error now after Ive installed the list of libraries and programs that you sent me. not sure what is wrong with this now?

fxdgear commented 5 years ago

@Jebel04 let me test it out.

BUT for futre reference, Github has this concept called markdown which makes it easy to format text. Inparticular code and errors.

So for example next time you could create your issue and put 3 back ticks ie this character `

so to demonstrate:

pi@raspberrypi:~ $ python adxl345_final.py
Traceback (most recent call last):
File "adxl345_final.py", line 9, in
bus = smbus.SMBus(1 if int(revision, 16) >= 4 else 0)
File "/home/pi/.local/lib/python2.7/site-packages/smbus/smbus.py", line 56, in **init**
self.open(bus)
File "/home/pi/.local/lib/python2.7/site-packages/smbus/smbus.py", line 83, in open
raise IOError(e.errno)
IOError: 2

at the end of the day it's not a big deal, just makes it a bit easier to read.

fxdgear commented 5 years ago

@Jebel04 Do you have the accelerometer plugged into your raspberry pi?

it looks to me like there's an error trying to open a connection to the bus.

Jebel04 commented 5 years ago

I did, although I didn’t try troubleshooting from that end yet, assumed it was coding related

On Thu, Feb 21, 2019 at 5:03 PM Nick Lang notifications@github.com wrote:

@Jebel04 https://github.com/Jebel04 Do you have the accelerometer plugged into your raspberry pi?

it looks to me like there's an error trying to open a connection to the bus.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/snmahajan30/vibration-analysis-using-adxl345-python/issues/1#issuecomment-466219247, or mute the thread https://github.com/notifications/unsubscribe-auth/Atak7CRqh6V2IG0KFIXmgPl0mWKrZn-hks5vPzO5gaJpZM4bH8uW .

--

Jeremy Ebel

JeremyEbel@FirstWorldSolutionsLLC.com LaraRobinson@firstworldsolutionsllc.com 970-317-7207 http://www.FirstWorldSolutionsLLC.com http://www.firstworldsolutionsllc.com/ facebook.com/firstworldsolutionsCO