Code Monkey home page Code Monkey logo

hepmitter's Introduction

HEP

HEP MQTT Emitter

This dummy example illustrates a simple HEP pipeline through an emitter instance using MQTT

Requirements

  • Emitter Server
    • License config
    • Generate a Key
  • HEPmitter
    • Channel and Key in config.js

Quick Start

Emitter

The quick way to start an Emitter broker is by using docker run command as shown below.

docker run -d --name emitter -p 8080:8080 --restart=unless-stopped emitter/server

Both commands above start a new server and if no configuration or environment variables were supplied, it will print out a message similar to the message below once the server has started:

[service] unable to find a license, make sure 'license' value is set in the config file or EMITTER_LICENSE environment variable
[service] generated new license: uppD0PFIcNK6VY-7PTo7uWH8EobaOGgRAAAAAAAAAAI
[service] generated new secret key: 4nEeZxflLe4N36i1XDiNgRY2dvbduqYh

This message shows that a new security configuration was generated, you can then re-run EMITTER_LICENSE set to the specified value. Alternatively, you can set license property in the emitter.conf configuration file.

Next, open a browser and navigate to http://127.0.0.1:8080/keygen in order to generate an access key. Now you can use the secret key generated to create channel keys, which allow you to secure individual channels and start using emitter.

image

MARK DOWN YOUR GENERATED KEY!

HEPmitter

Clone this git repository and install using npm

git clone https://github.com/lmangani/HEPmitter
cd HEPmitter
npm install

Next, configure your channel and secret key using file config.js

config = {
	server: {
		host: '127.0.0.1',
		port: 8080
	},
	sub: {
		key: "QTD29b_rvDuvHBft794KUu9Z809gwPPU",
		name: "hep"
	}
}

Last, start HEPmitter and verify you receive back a fully decoded HEP message.

connected!
output hep { rcinfo: 
   { protocolFamily: 2,
     protocol: 17,
     srcIp: '10.0.0.1',
     dstIp: '10.0.0.2',
     srcPort: 5060,
     dstPort: 5060,
     timeSeconds: 2319774396,
     timeUseconds: 0,
     payloadType: 100,
     captureId: 2001,
     hepNodeName: '2001',
     capturePass: 'myHep' },
  payload: 'hello HEP!' }

Testing

To test your Emitter instance using regular MQTT clients, refer to the following:

  mosquitto_sub -v -d -t "QTD29b_rvDuvHBft794KUu9Z809gwPPU/hep/" -p 8787
  mosquitto_pub -d -t 'QTD29b_rvDuvHBft794KUu9Z809gwPPU/hep/' -m 'helloWorld' -p 8787

hepmitter's People

Contributors

dependabot[bot] avatar lmangani avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.