Elixir library for Cayenne Low Power Payload (LPP) format
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
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)")
This library has been inspired by the following list of articles, videos and libraries written in other programming languages:
- Articles
- Libraries
- Videos
- Platforms
While developing this library, the following hardware has been used to test the integration with TheThingsNetwork and Cayenne Cloud:
- Publish to hex.pm
- Publish docs to hexdocs.pm
- Support decoding, not just encoding
- Add example using circuits_uart
This software is licensed under the MIT license