Giter Club home page Giter Club logo

matrix-core-js's Introduction

Matrix Core JS examples

This layer uses Protocol Buffers & ZeroMQ to communicate with your MATRIX device. Applications for your MATRIX device can be programmed with any language that supports these tools.

Requeriments

  1. Raspberry pi Zero or 3
  2. MATRIX Voice or MATRIX Creator

For these examples, I'm using the Matrix Voice connected to the Raspberry Pi Zero W.

Installation

Before starting, ensure you have access to the terminal of your Raspberry Pi via an SSH-session or a connected screen, mouse, and keyboard. Then insert and run the following commands into your Raspberry Pi's terminal, one at a time.

Make sure this is running on your Raspberry Pi

Add the MATRIX repository and key:

curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.matrix.one/raspbian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/matrixlabs.list

Update your repository and packages:

sudo apt-get update
sudo apt-get upgrade

Install the the MATRIX CORE packages:

sudo apt-get install matrixio-malos

Reboot your Raspberry Pi:

sudo reboot

MATRIX CORE will now be running as a service each time your Raspberry Pi boots up.

Using Raspberry Pi OS, as root:

Install Node.js preferably LTS:

curl -sL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs

These remaining commands will install ZeroMQ:

echo "deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/ ./" | sudo tee /etc/apt/sources.list.d/zeromq.list
wget https://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/Release.key -O- | sudo apt-key add

To install ZeroMQ for Node, download and install the package from npm. Here we use the version 5.x branch since version 6.x is still in beta.

npm install zeromq@5

Why ZeroMQ?

ZeroMQ (also known as ØMQ, 0MQ, or zmq) looks like an embeddable networking library but acts like a concurrency framework. It gives you sockets that carry atomic messages across various transports like in-process, inter-process, TCP, and multicast. You can connect sockets N-to-N with patterns like fan-out, pub-sub, task distribution, and request-reply. It's fast enough to be the fabric for clustered products. Its asynchronous I/O model gives you scalable multicore applications, built as asynchronous message-processing tasks. It has a score of language APIs and runs on most operating systems.

Getting Started

Install all dependencies:

npm install

Start the program:

npm run app

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.