element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Forum Unable to read cape sensors via i2cget
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Single-Board Computers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 3 replies
  • Subscribers 56 subscribers
  • Views 385 views
  • Users 0 members are here
  • beagleboneblack
  • weather
Related

Unable to read cape sensors via i2cget

Former Member
Former Member over 9 years ago

As noted in this forum post, I have the weather cape working, but am only able to read the sensor values by reading data directly from locations like /sys/bus/i2c/devices/1-0077/pressure0_input.

 

I believe this is because i2cdetect shows them as busy (UU), but I'm unsure how to get whatever drivers or software has hold of them to let them go so I can access them directly.  Any hints appreciated.

  • Sign in to reply
  • Cancel
  • shabaz
    shabaz over 9 years ago

    Hi Josh,

     

    See here: http://elinux.org/CircuitCo:BeagleBone_Weather

    There should already be a driver loaded for it when you plug it in, and to read any of the sensors you just need to access the files in the path

    /sys/bus/i2c/devices/i2c-1 which is the way this driver talks to user space applications. The 'cat' command can be used to view the sensor values

    from the command line. You shouldn't (need to) use Python I2C commands - this low-layer access is being handled by the driver.

     

    With Python, there will be a way to do a cat xyz shell command and capture the response. I don't know the way to do that however - I'm not knowledgeable in Python.

    Check out 'python exec shell command stdout' or similar in google, this will reveal how to do this.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 9 years ago in reply to shabaz

    Hey thanks for the speedy reply.

     

    Yes I am able to access that data via python by subbing out to the shell.  So my scripts are working. However I'd prefer to use the i2c libraries available to python for other beagleboard sensors, rather than sub to the shell.  I was hoping I could either disable the driver and still access the i2c data directly, and/or the driver would allow me to access it w/o keeping it blocked/busy.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 9 years ago in reply to Former Member

    You'd have to investigate if capemgr allows that; it might not. One possible way would be to erase (or remove) the EEPROM on the cape, but you may prefer an alternative method.

    Python is so slow that I don't think there will be an improvement in speed by accessing I2C data directly (and weather changes slowly anyway).

    You don't have to use 'cat' - I just though that might be easier. You could open a file in Python and read it, which would be the correct way to do it (but I don't know how to

    do that in Python..).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube