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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

432003d · Feb 2, 2021

History

27 Commits
Feb 2, 2021
Feb 20, 2020
Feb 19, 2020
Feb 19, 2020
Feb 19, 2020
Feb 19, 2020
Feb 19, 2020
Sep 24, 2020
Feb 2, 2021
Feb 2, 2021

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