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
  • About Us
  • 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 667 subscribers
  • Views 1376 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
Parents
  • 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
Reply
  • 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
Children
  • 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
  • clem57
    0 clem57 over 9 years ago in reply to clem57

    http://docz.io/doc/58441/microstack%E2%84%A2-gps-getting-started

    • 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