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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Microstack GPS and Accelerometer on RaspberryPi 2 and Ubuntu Mate
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 12 replies
  • Answers 1 answer
  • Subscribers 665 subscribers
  • Views 1134 views
  • Users 0 members are here
  • Ubuntu
  • 2
  • rasberrypi
  • raspberry_pi
  • mate
  • microstack
Related

Microstack GPS and Accelerometer on RaspberryPi 2 and Ubuntu Mate

doubletop
doubletop over 9 years ago

I'm going round in circles trying to get this to work with Ubuntu Mate and its not clear which posts on any website are relevant and which are not.

 

Here's where I've got to.

 

$ sudo apt-get install python3-microstacknode

 

Doesn't work

 

sudo apt-get install python3-pip

 

works

 

sudo pip-3.2 install microstackcommon microstacknode

 

works if pip-3.2 is changed to pip. However it puts all the files into /usr/local/lib rather than /usr/lib and there are no example files. microstackcommon and microstacknode files have been moved to /usr/lib/ in the existing file structure for python 2.7 python3,4 and python3,5. I got the examples from GitHUb and placed them in a local folder.

 

As there is no Rasp-config available config.txt has been edited to add

 

sudo nano /boot/config.txt

 

and

 

dtparam=i2c_arm=on

dtparam=spi=on

 

sudo i2cdetect -y 1

 

works. However, no device is found

 

0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:      -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

 

Running the examples accelcat.py

 

Traceback (most recent call last):

  File "/home/pete/PythonTest/accelcat.py", line 11, in <module>

    with MMA8452Q() as accelerometer:

  File "/usr/lib/python3.4/dist-packages/microstacknode/hardware/accelerometer/mma8452q.py", line 126, in __enter__

    self.init()

  File "/usr/lib/python3.4/dist-packages/microstacknode/hardware/accelerometer/mma8452q.py", line 131, in init

    self.standby()

  File "/usr/lib/python3.4/dist-packages/microstacknode/hardware/accelerometer/mma8452q.py", line 153, in standby

    self.ctrl_reg1.set(self._ctrl_reg1_value)

  File "/usr/lib/python3.4/dist-packages/microstacknode/hardware/accelerometer/mma8452q.py", line 279, in set

    writing_bytes(self.device_address, self.register_address, v))

  File "/usr/lib/python3.4/dist-packages/microstackcommon/i2c.py", line 85, in transaction

    ioctl(self.fd, I2C_RDWR, ioctl_arg)

OSError: [Errno 5] Input/output error

 

and gpscat.py

 

Traceback (most recent call last):

  File "/home/pete/PythonTest/gpscat.py", line 3, in <module>

    import microstacknode.gps.l80gps

ImportError: No module named 'microstacknode.gps'

 

 

So clearly something is missing  from the pip install so rather than editing and juggling around files please where or how do I find the 'proper' install package that gets everything i need to make this work with Ubuntu Mate?

 

Pete

  • Sign in to reply
  • Cancel
  • rew
    0 rew over 9 years ago

    Even though it looks as if the software installation might have been wrong or incomplete....

     

    you have clear indication that
    * You succeeded in enabling I2C: i2cdetect works!

    * Your PI does NOT have a connection to the I2C devices: I2cdetect does NOT report any devices.

     

    So: Check your hardware! (Both i2cdetect and python are trying to tell you: no i2c device found at that address).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • doubletop
    0 doubletop over 9 years ago in reply to rew

    Roger

     

    Thanks for taking the time to reply.

     

    I'd hope the hardware was fine Its a brand new RasPi 2, Microstack baseboard, accelerometer and GPS received form Element14 in the past week. The Ubuntu Mate was downloaded in the past week, installed on a new 32Gb class10 SDHC card and updates applied

     

    I'm keen to get a clean build that works properly and not subject to hacks and tweaks to make it work. Once I’ve got it going I plan to blow it all away and do a clean build

     

    Pete

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rew
    0 rew over 9 years ago in reply to doubletop

    I haven't investigated what hardware you have. But the part "raspberry pi" I know what it is and it seems to be functioning. The other stuff seems to be "not connected to the pi" when viewed from the pi. If what you have is a simple board that plugs on the 'pi, make sure that it's correctly positioned and configured. Double check that your device is supposed to be on I2C. (I've had one of my clients complain that i2c-detect didn't see any devices, while he had an SPI device....). If you need wires to connect it check the wires. Or.... Post a picture.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago in reply to doubletop

    doubletop 

    Have you seen this http://www.microstack.org.uk/assets/gps/FormattedGPSgettingstarted.pdf?

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • mconners
    0 mconners over 9 years ago in reply to clem57

    Reading that clem57 that looks like it should be communicating via the serial port and not I2C at all.

    But, I am not familiar with the setup he has.

     

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago

    There may be this raspbian - Microstack Accelerometer not working. I2C issue? - Raspberry Pi Stack Exchange which requires a jumper.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mconners
    0 mconners over 9 years ago in reply to mconners

    Oh, I guess that  doc is only for the GPS. The accelerometer may very well use I2C.

     

    One issue to check is to make sure you have a power supply capable of running both the RaspberryPi and the microstack add on module and boards.

     

    You don't mention what type and rating of the power supply you are using.

     

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • doubletop
    0 doubletop over 9 years ago

    Clem has identified the issue with the accelerometer. I have one of 'the couple' of units that don't have the link on JP1 on the board. Microstack/Element14 need to add clearer instructions to purchasers of this board.


    The GPS is another issue the clue is here

     

    GPSD Installation Instructions

     

    Right down the bottom Raspi tips

     

    "Second you need to tell the boot process to load the pps_gpio module and attach /dev/pps0 to GPIO ping 4. Do that by adding this line to the bottom of /boot/config.txt: dtoverlay=pps-gpio,gpiopin=4"

     

    Then use the Adafruit instructions  to test it

     

    https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/pi-setup

     

    Next problem was this error

     

    Traceback (most recent call last):

      File "/home/pete/PythonTest/gpscat.py", line 3, in <module>

        import microstacknode.gps.l80gps

    ImportError: No module named 'microstacknode.gps'


    The install of the microstackcommon and microstacknode not only goes to the wrong folders /usr/local/lib rather than /usr/lib it is put in an extra folder usr/lib/python3.4/dist-packages/microstacknode/hardware/gps/l80.py if all the modules are moved up to usr/lib/python3.4/dist-packages/microstacknode/gps/l80.py the modules can be found by the code.

     

    I'm now getting access permission errors and that need to be looked into, but progress has been made

     

    Basically my assessment so far is that Microstack and Element14, as the exclusive suppliers, need to sort out their crap documentation and provide something that is up to date and complete.


    Pete



    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago in reply to doubletop

    Take a look at https://github.com/microstack-IoT/python3-microstacknode/issues/5 image

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago in reply to clem57

    Some doc worth checking http://python3-microstacknode.readthedocs.org/en/latest/index.html

    C

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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