Mycroft and GPIO Raspberry pi 3


#1

Hello,

Is anyone have managed to make picroft interact with raspberry pi 3 GPIO ? i have tried the skill here : (https://github.com/MycroftAI/picroft_example_skill_gpio). I have successfuly installed it in opt/mycroft/skills. But i doesnt seems like picroft can reconize it as a skill.

Is anyone has succeed it? or the skill is just not ready yet.

Thanks


GPIO pins working on Pi 3
#2

I’ve actually installed GPIO skill and it is working as expected.

The common issue is to add mycroft user to gpio group with command

sudo useradd mycroft gpio

and install

python-rpi.gpio
python3-rpi.gpio


#3

There is a similar issue if you wish to use a PiCamera:

Picamera Use Issues
The python test script to access the picamera worked well from the start. When I integrated the picamera functionality into the skill’s init.py file, at first it didn’t work,then after some tweaking it did work, but only once!

The file /var/log/mycroft-speech-client.log and /var/log/mycroft-skill.log are very useful files to look at if your skill is not working. After some looking, I found an error dealing with a “vchiq instance”.

Having learned my lesson from past experience, I did a google search, and found that in order the access the camera, the user executing the Python program or Mycroft skill in this case needed to have a file permission to do this. In Linux most everything is a file, even a device. To access the picamera, a user needs access to a file called /dev/vchiq. So the user executing the python test script had access, but the user, called pi, executing the init.py did not. Hence the failure to take the picture at all. Following the directions from Raspberry Pi – failed to open vchiq instance [Solved] demonstrates how to change the user permissions for this file to allow access to the device. I’ve placed a pdf of this post in my github repository for this project in case the link goes stale.

You can see the full write up here(which will also provide the link to github mentioned above):


#4

awesome work, @Joy_Tribbiani


#5

Thanks @Joy_Tribbiani for that info, I’ve added it to our Picroft documentation:


#6

Hi Kathy,

I’ve just realized about the Picroft documentation that I made a mistake.The command sudo adduser mycroft gpio is incorrect. The user mycroft is already created so when you run that command an error occur.
The right command is
sudo usermod -g gpio mycroft

Sorry about that
Ciao
Srg


#7

No worries @Joy_Tribbiani I’ve updated the documentation to reflect this.


#8

Hay, i’ve some problem with my GPIO skills
Im trying to add user and run sudo make install.pi
but i got this error

scp: /home/pi/skills/picroft_skill_gpio4s/4relay_bb.png: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/GPIO.py: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/GPIO.pyc: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/GPIO_Board.jpg: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/README.md: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/SainSmart-8-Channel-DC-5V-Relay-011.jpg: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/init.py: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/init.pyc: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/kitchenblink.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/on.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/livingblink.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/livingroom.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/bathroomblink.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/lamp.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/kitchen.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/name.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/bedroom.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/fanblink.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/fan.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/modules.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/livingroomblink.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/check.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/ipparamrequired.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/living.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/lampblink.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/led.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/switchblink.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/switch.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/ledblink.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/path.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/bathroom.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/off.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/dialog/en-us/bedroomblink.dialog: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/docs/source/index.rst: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/docs/source/code.rst: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/docs/source/conf.py: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/docs/source/tutorial.rst: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/docs/Makefile: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/docs/make.bat: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/makefile: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/requirements.txt: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/settings.json: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/test/intent/open.intent.json: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/test/intent/close.intent.json: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/vocab/en-us/ioobject.voc: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/vocab/en-us/ioparam.voc: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/vocab/en-us/systemobject.voc: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/vocab/en-us/question.voc: Permission denied
scp: /home/pi/skills/picroft_skill_gpio4s/vocab/en-us/command.voc: Permission denied
makefile:15: recipe for target ‘install.pi’ failed
make: *** [install.pi] Error 1


#9

Hi there,

try with
msm install https://github.com/smolino/picroft_skill_gpio4s.git

no other steps are required

let me know if that works


#10

I’ve this massage(An error occurred while pocessing a request in GPIO_Control Skill)
and if try to run test.pi
{‘GPIO2’: ‘Off’, ‘GPIO3’: ‘Off’, ‘GPIO1’: ‘Off’, ‘GPIO4’: ‘Off’}
{‘GPIO2’: ‘Off’, ‘GPIO3’: ‘Off’, ‘GPIO1’: ‘Off’, ‘GPIO4’: ‘On’}
{‘GPIO2’: ‘Off’, ‘GPIO3’: ‘On’, ‘GPIO1’: ‘Off’, ‘GPIO4’: ‘On’}
{‘GPIO2’: ‘On’, ‘GPIO3’: ‘On’, ‘GPIO1’: ‘Off’, ‘GPIO4’: ‘On’}
{‘GPIO2’: ‘On’, ‘GPIO3’: ‘On’, ‘GPIO1’: ‘On’, ‘GPIO4’: ‘On’}
{‘GPIO2’: ‘On’, ‘GPIO3’: ‘On’, ‘GPIO1’: ‘On’, ‘GPIO4’: ‘Off’}
{‘GPIO2’: ‘On’, ‘GPIO3’: ‘Off’, ‘GPIO1’: ‘On’, ‘GPIO4’: ‘Off’}
{‘GPIO2’: ‘Off’, ‘GPIO3’: ‘Off’, ‘GPIO1’: ‘On’, ‘GPIO4’: ‘Off’}
{‘GPIO2’: ‘Off’, ‘GPIO3’: ‘Off’, ‘GPIO1’: ‘Off’, ‘GPIO4’: ‘Off’}