Skip to content

Elixir library for Cayenne Low Power Payload (LPP) format

License

Notifications You must be signed in to change notification settings

janpieper/cayenne_lpp

Repository files navigation

cayenne_lpp Build Status

Elixir library for Cayenne Low Power Payload (LPP) format

Installation

The package can be installed by adding cayenne_lpp to your list of dependencies in mix.exs:

defp deps do
  [{:cayenne_lpp, "~> 0.1.0"}]
end

Usage

alias Cayenne.LPP.Payload
alias Cayenne.LPP.Type.{Temperature, RelativeHumidity}

payload =
  Payload.new()
  |> Payload.add(1, Temperature.new(28.3))
  |> Payload.add(2, RelativeHumidity.new(40.5))

# Payload as String: "0167011B02680195"
payload
|> Payload.to_string()
|> IO.inspect(label: "Payload as String")

# Payload size (in bytes): 8
payload
|> Payload.size()
|> IO.inspect(label: "Payload size (in bytes)")

Inspiration

This library has been inspired by the following list of articles, videos and libraries written in other programming languages:

Hardware

While developing this library, the following hardware has been used to test the integration with TheThingsNetwork and Cayenne Cloud:

TODOs

License

This software is licensed under the MIT license