Hardware interface when using Alexa

When using the Alexa C++ SDK, my understanding is that we cannot use HAL?

Any tips on how we should interface with the hardware?

For instance, when running MQTT (Python) and responding to Skill commands, it would be useful to be able to control the lights and interface with sensors (on the Creator).

Thanks,

Kenny

hi,

why should HAL not work? What is your design and setup goul?

But to test if the HAL hardware works you can run the examples from my project https://github.com/cmetz/python-matrixio-hal and test if they work while alexa is running. if they do you can write a mqtt interface or use them in flask-ask to run an alexa skill directly on you pi.

I was under the impression that you couldn’t install HAL and the CLI at the same time?

I’ll look at your project.

I’ve got a Custom Skill setup to control the Pi. Interface with the GPIO, reboot, restart, etc. Would like to control the lights and other things on the Creator and Voice.

This is the post I was thinking about:

https://community.matrix.one/t/solved-alexa-voice-sdk/1456/2?u=gapdev

that information is outdated. if you have installed the latest kernel modules with ‘sudo apt install matrixio-kernel-modules’, the new version of the hal-lib should work.

1 Like

Well, in that case, I’ll install HAL.

Thanks.

Don’t know if we should be discussing this here, but…

The HAL examples work, but I’m having trouble with yours.

When I run (have to use sudo to build and run or it errors with permission errors)

sudo docker run --name led_rotate -d --device=/dev/spidev0.0 led_rotate

It returns this error:

docker: Error response from daemon: linux runtime spec devices: error gathering device information while adding custom device "/dev/spidev0.0": no such file or directory.

Kenny

you need add your self to the docker group. and also switch the device to /dev/matrixio_regmap if you use the kernel modules. tell me if that works, then i can update the documentation.

this command addes the user pi to the docker group, it is mentioned in the description, maybe you need to relogin:

sudo usermod -aG docker pi

sudo usermod -aG docker pi

Yea, I did that, twice to make sure. Just did it again, seems to work now without permission errors.

Now, with

docker run --name led_rotate -d --device=/dev/matrixio_regmap led_rotate

it seems to work, but the LED’s don’t rotate as they do when simply running with Python.

Also,

docker ps

doesn’t list anything. Have to use

docker ps -a

I guess I’m confused about the purpose of Docker. Your Python examples work as is. This is the first I’ve used Docker and am not familiar with it or why you would want to use it.

Kenny

just ignore it. it is only usefull to if you want to use it in some scenarios like hass.io, where every addon is a docker container. Docker is a container service, something far like a VM.