<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[A library for Cayenne LPP]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">Recently I had to do a few projects using LoPy boards, The Things Network and its <a href="https://cayenne.mydevices.com" target="_blank" rel="noopener noreferrer nofollow">Cayenne</a> Integration to quickly build some dashboard.</p>
<p dir="auto">In order to use the integration, the packets send by the LoPy should use the in the <a href="https://mydevices.com/cayenne/docs/lora/#lora-cayenne-low-power-payload" target="_blank" rel="noopener noreferrer nofollow">Low Power Payload format</a>.</p>
<p dir="auto">To facilitate that, I made a simple library and thought I would share it with you since it could be useful to someone else. It is available on <a href="https://github.com/jojo-/py-cayenne-lpp" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.</p>
<p dir="auto">The type of sensors compatible with this library are:</p>
<ul>
<li>digital input/output;</li>
<li>analog input/output;</li>
<li>luminosity (or illuminance) sensor;</li>
<li>presence sensor;</li>
<li>temperature sensor;</li>
<li>humidity sensor;</li>
<li>accelerometer;</li>
<li>barometer;</li>
<li>gyrometer;</li>
<li>and gps.</li>
</ul>
<p dir="auto">Here is a small example of how it works, assuming that the network join has already been done:</p>
<pre><code>import socket
# importing the module
import cayenneLPP

# create a LoRa socket
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
s.setsockopt(socket.SOL_LORA, socket.SO_DR, 0)
s.setblocking(True)

# creating Cayenne LPP packet
lpp = cayenneLPP.CayenneLPP(size = 100, sock = s)

# adding 2 digital outputs, the first one uses the default channel
lpp.add_digital_input(True)
lpp.add_digital_input(False, channel = 112)

# sending the packet via the socket
lpp.send()
</code></pre>
<p dir="auto">There are some other examples in the GithHub repo.</p>
<p dir="auto">Hope it help :)</p>
<p dir="auto">Cheers,</p>
<p dir="auto">Johan</p>
]]></description><link>https://forum.pycom.io/topic/2545/a-library-for-cayenne-lpp</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 23:41:58 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/2545.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 30 Jan 2018 04:02:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to A library for Cayenne LPP on Tue, 30 Jan 2018 04:10:39 GMT]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">Recently I had to do a few projects using LoPy boards, The Things Network and its <a href="https://cayenne.mydevices.com" target="_blank" rel="noopener noreferrer nofollow">Cayenne</a> Integration to quickly build some dashboard.</p>
<p dir="auto">In order to use the integration, the packets send by the LoPy should use the in the <a href="https://mydevices.com/cayenne/docs/lora/#lora-cayenne-low-power-payload" target="_blank" rel="noopener noreferrer nofollow">Low Power Payload format</a>.</p>
<p dir="auto">To facilitate that, I made a simple library and thought I would share it with you since it could be useful to someone else. It is available on <a href="https://github.com/jojo-/py-cayenne-lpp" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.</p>
<p dir="auto">The type of sensors compatible with this library are:</p>
<ul>
<li>digital input/output;</li>
<li>analog input/output;</li>
<li>luminosity (or illuminance) sensor;</li>
<li>presence sensor;</li>
<li>temperature sensor;</li>
<li>humidity sensor;</li>
<li>accelerometer;</li>
<li>barometer;</li>
<li>gyrometer;</li>
<li>and gps.</li>
</ul>
<p dir="auto">Here is a small example of how it works, assuming that the network join has already been done:</p>
<pre><code>import socket
# importing the module
import cayenneLPP

# create a LoRa socket
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
s.setsockopt(socket.SOL_LORA, socket.SO_DR, 0)
s.setblocking(True)

# creating Cayenne LPP packet
lpp = cayenneLPP.CayenneLPP(size = 100, sock = s)

# adding 2 digital outputs, the first one uses the default channel
lpp.add_digital_input(True)
lpp.add_digital_input(False, channel = 112)

# sending the packet via the socket
lpp.send()
</code></pre>
<p dir="auto">There are some other examples in the GithHub repo.</p>
<p dir="auto">Hope it help :)</p>
<p dir="auto">Cheers,</p>
<p dir="auto">Johan</p>
]]></description><link>https://forum.pycom.io/post/15121</link><guid isPermaLink="true">https://forum.pycom.io/post/15121</guid><dc:creator><![CDATA[jojo]]></dc:creator><pubDate>Tue, 30 Jan 2018 04:10:39 GMT</pubDate></item><item><title><![CDATA[Reply to A library for Cayenne LPP on Tue, 30 Jan 2018 09:56:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1388">@jojo</a> said in <a href="/post/15121">A library for Cayenne LPP</a>:</p>
<blockquote>
<p dir="auto">GitHub</p>
</blockquote>
<p dir="auto">Hi,</p>
<p dir="auto">Thanks for sharing this with the rest of the community, it looks very useful and very well documented!</p>
]]></description><link>https://forum.pycom.io/post/15129</link><guid isPermaLink="true">https://forum.pycom.io/post/15129</guid><dc:creator><![CDATA[seb]]></dc:creator><pubDate>Tue, 30 Jan 2018 09:56:34 GMT</pubDate></item><item><title><![CDATA[Reply to A library for Cayenne LPP on Sat, 12 May 2018 11:38:23 GMT]]></title><description><![CDATA[<p dir="auto">I have difficulties using the library.  Can somebody share a working code with a real sensor(bme280, dht11/22,ds18b20 etc.)? I think many people would appreciate it!</p>
]]></description><link>https://forum.pycom.io/post/19582</link><guid isPermaLink="true">https://forum.pycom.io/post/19582</guid><dc:creator><![CDATA[miroslav.petrov]]></dc:creator><pubDate>Sat, 12 May 2018 11:38:23 GMT</pubDate></item><item><title><![CDATA[Reply to A library for Cayenne LPP on Mon, 14 May 2018 16:39:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1180">@miroslav-petrov</a></p>
<p dir="auto">Can you be a bit more specific when you say you have some difficulties using the library? Is it because you did not join the network? Or is it because you have troubles reading the data from a particular sensor?</p>
<p dir="auto">An example is available <a href="https://github.com/jojo-/py-cayenne-lpp/blob/master/test_lopy/main.py" target="_blank" rel="noopener noreferrer nofollow">here</a> for using the library with TTN. You simply need to fill you application credentials in the lines 31 and 32. Please note that this example assumes that you are using the frequency plan for Australia.</p>
]]></description><link>https://forum.pycom.io/post/19639</link><guid isPermaLink="true">https://forum.pycom.io/post/19639</guid><dc:creator><![CDATA[jojo]]></dc:creator><pubDate>Mon, 14 May 2018 16:39:02 GMT</pubDate></item><item><title><![CDATA[Reply to A library for Cayenne LPP on Mon, 14 May 2018 18:33:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1388">@jojo</a></p>
<p dir="auto">The problem is that I have insufficient knowledge in python. I cannot write a working script that(for example) reads a DHT22 sensor and formats the data in LPP. Thats why I want a working example with a real sensor.</p>
]]></description><link>https://forum.pycom.io/post/19640</link><guid isPermaLink="true">https://forum.pycom.io/post/19640</guid><dc:creator><![CDATA[miroslav.petrov]]></dc:creator><pubDate>Mon, 14 May 2018 18:33:36 GMT</pubDate></item></channel></rss>