An open API service indexing awesome lists of open source software.

https://github.com/devstopfix/evrythng.thngpush

Elixir MQTT client for EVRYTHNG THNG-push
https://github.com/devstopfix/evrythng.thngpush

elixir iot mqtt

Last synced: 12 months ago
JSON representation

Elixir MQTT client for EVRYTHNG THNG-push

Awesome Lists containing this project

README

          

# THNG-Push

Unofficial Elixir pub/sub client for https://evrythng.com/[EVRYTHNG.com].

An experiment in combining the https://evrythng.com/connected-devices-real-time-push-web-things/[real-time push web of things] with a http://nerves-project.org/[12 MB binary] running on the BEAM VM.

# Installation

If https://hex.pm/docs/publish[available in Hex], the package can be installed
by adding `thngpush` to your list of dependencies in `mix.exs`:

[source,elixir]
----
def deps do
[{:thngpush, "~> 0.17.0"}]
end
----

## Build

Build requires [emqtcc](git@github.com:emqtt/emqttc.git) to be available in a sibling folder.

[source,bash]
----
cd ..
git clone https://github.com/emqtt/emqttc.git
cd emqttc
make
----

= REPL

Connect and disconnect using a key read from ENV:

[source,elixir]
----
alias Evrythng.ThngPush.Client, as: Client
key = System.get_env("EVT_OPERATOR_KEY")
{:ok, pid} = Client.start_link(key)
GenServer.stop(pid)
----

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/thngpush](https://hexdocs.pm/thngpush).

# License

Copyright © 2017 Devstopfix

Distributed under the Apache License either version 2.0. Not officially supported by https://evrythng.com/[EVRYTHNG.com].