Tutorial 1 error
The IO Pi Plus is a 32 channel MCP23017 GPIO expander for the Raspberry Pi
18/07/2015
Posted by:
giagara
I'm approaching to IoPi by using tutorial1.py.
When i run command python tutorial1.py, this error is raised:
self._bus.write_byte_data(self.address, self.IOCON, self.config)AttributeError: 'NoneType' object has no attribute 'write_byte_data'
I didn't edit the library file, i've only run this command.
I use python 2.
Can you help me?
Many thanks
BR
18/07/2015
Posted by:
andrew
The error that you are getting could mean that the raspberry pi is having trouble communicating with the IO Pi using the I2C bus.
Have you followed our tutorial on setting up I2C on the Raspberry Pi? It may be worth going through the steps in the tutorial to check that everything is installed correctly.
Try running the command "i2cdetect -y 1". This will bring up a list of all I2C devices on the Raspberry Pi. The IO Pi should show up on channels 20 and 21.
21/10/2015
Posted by:
stevesilva
However, when we use the same code from an apache webserver page (which is a python file) we also get the same error
self._bus.write_byte_data(self.address, self.IOCON, self.config)AttributeError: 'NoneType' object has no attribute 'write_byte_data'
'i2cdetect revealed that we can infact see the bus and that we can infact see the one card we have installed?
Any thoughts?
21/10/2015
Posted by:
andrew
sudo adduser www-data i2c
Once you have added apache to the group you will need to restart apache before running any python scripts.
sudo /etc/init.d/apache2 restart
Hopefully, this will fix your problem.
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.