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