Matrix Voice GPIO for Mute Button

Hi,

sorry i have a few questions to the voice GPIO Ports.
I want to use a few Buttons to control volume or mute the mic with amixer program.
For this i want to use a few Buttons to the GPIO Ports of the Matrix Voice.

Have looked here for the Pinout: https://matrix-io.github.io/matrix-documentation/matrix-voice/resources/pinout/

For one example i set the DF0 (Pin 1) to GND and to 3,3 V.
I have read the Docs https://matrix-io.github.io/matrix-documentation/matrix-core/javascript-examples/gpio/

to get an output and created the file gpio.js with the content from here:

Installed zermq module and matrix-protos with npm an run the script with node gpio.js .
There ist no error but also no output if i connect to GND oder 3.3V

Can you help? What i had to to to get an input from an button and run a command.
Many Thanks for a answer.

P.S: With Raspberry PI and his GPIO Ports i do succesfully this test to get Input from the Push BUtton:
https://www.w3schools.com/nodejs/nodejs_raspberrypi_led_pushbutton.asp

Jochen

In that diagram 5.5v is used. We recommend to use 3.3v in the Voice because the GPIO come form the FPGA and are 0 - 3.3v compatible. Here is an example of what you can do:

thnx. i will try this with the sample js script.

Please double check all connections before powering up, be specially carefull with the push button orientation :wink:

Hi. First i want to check only get the pushbutton recognized. I am sadly not a coder. Only want get the Push button regognized.

If i use the sample code from the documentation, this should give me a value if button on gpio 0 (pin1) is pressed. Right? I have connected a button like you described to 3.3 V and GND with the resistor. If Button ist not pressed i have 0,5 Volts at the GPIO Pin 0. When pressed button i have a high with 3,3 Volts (with multimeter). But the script logs nothing to console. Am i on the right way? what i had to do? Thnx

Hi @joeduck. The example code in the documentation toggles DF0 between on&off states every second two seconds. However, the other GPIO ports are left alone at an off state. The output from the console is the current state of each GPIO port. For example, connecting a wire from 3.3v to DF10 will cause a change in the console output.

Below I’ve attached an image for the expected console output and the MATRIX Voice setup I’m using. Let us know if you have any more questions.

console-output

Hi. Thanks fpor the answer.
If i run “node gpio.js” i have no such output :frowning:

Why is this with the matrix gpio so complicatet.
If i use this tutorial on an old pi1 it works with a few simple codelines who understand programmin noobs like me.

#!/usr/bin/env python
#coding: utf8 


import RPi.GPIO as GPIO


# Zählweise der Pins festlegen
GPIO.setmode(GPIO.BOARD)
# Pin 18 (GPIO 24) als Eingang festlegen
GPIO.setup(18, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
# Schleifenzähler
i = 0

# Endlosschleife
while 1:
    # Eingang lesen
    if GPIO.input(18) == GPIO.HIGH:
        # Wenn Eingang HIGH ist, Ausgabe im Terminal erzeugen
        print "Eingang HIGH " + str(i)
        # Schleifenzähler erhöhen
        i = i + 1

Hi @joeduck. Have you looked at the getting started page for MATRIX CORE? These pages will go over all the steps needed to get an understanding of MATRIX CORE and the necessary installations. Let us know if you have any more questions.

Checked this again. But no Luck. starting “node app.js” there are no lights at the everloop. starting gpio.js there is no output. Also no error message.

Perhaps cause of the node Version? Installed 9.11.2 . Use this for snips and node-red.
I think i cut the GPIO wires (use a 40 PIN GPIO extender cable) i need for the buttons and use the Raspi GPIO ports.The everloop works well with a python service from “romkabuuter” with snips.