<?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[Deepsleep and adr not playing well together]]></title><description><![CDATA[<p dir="auto">I think there is an issue when using adr (automatic data rate) and deepsleep with nvram_save, nvram-restore together. I put my code I used to experiment up in git hub, see below.</p>
<p dir="auto"><a href="https://github.com/somervda/lopybase/tree/0123726880345761a35d441d184a1b55b4eb34c3" target="_blank" rel="noopener noreferrer nofollow">https://github.com/somervda/lopybase/tree/0123726880345761a35d441d184a1b55b4eb34c3</a></p>
<p dir="auto">I have a &quot;useADR=True&quot; variable in the <a href="http://config.py" target="_blank" rel="noopener noreferrer nofollow">config.py</a> file to quickly swap between modes. The only way I could get things to work is NOT to set the socket data rate after returning from deepsleep/nvram_restore() when in ADR mode.</p>
<p dir="auto">I'm guessing??? that something about adr settings being returned from the TTN gateway is not being save/restored in the non-volatile memory. I am forced to set the data rate at the socket level  or I get TX errors (Usually EAGAIN ) Possibly this is also related to me using US915 frequency plan  ?</p>
<p dir="auto">lora_socket.setsockopt(socket.SOL_LORA, socket.SO_DR, 3)</p>
<p dir="auto">Typical error</p>
<pre><code>Using existing join
Sending data: b'\xbe\x9a\x96\xc2\xdd\xb2 B'
Traceback (most recent call last):
    File &quot;main.py&quot;, line 56, in &lt;module&gt;
    File &quot;lopyhelper.py&quot;, line 72, in send
OSError: [Errno 11] EAGAIN
</code></pre>
<p dir="auto">My code working well enough for my needs , but I have a feeling the adr is not doing anything when I manually have to set the data rate at the socket level (Being non-adr is not a great loss, but would like to have it working).</p>
]]></description><link>https://forum.pycom.io/topic/6256/deepsleep-and-adr-not-playing-well-together</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Mar 2026 01:49:56 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/6256.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Aug 2020 19:58:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Deepsleep and adr not playing well together on Sun, 16 Aug 2020 19:58:17 GMT]]></title><description><![CDATA[<p dir="auto">I think there is an issue when using adr (automatic data rate) and deepsleep with nvram_save, nvram-restore together. I put my code I used to experiment up in git hub, see below.</p>
<p dir="auto"><a href="https://github.com/somervda/lopybase/tree/0123726880345761a35d441d184a1b55b4eb34c3" target="_blank" rel="noopener noreferrer nofollow">https://github.com/somervda/lopybase/tree/0123726880345761a35d441d184a1b55b4eb34c3</a></p>
<p dir="auto">I have a &quot;useADR=True&quot; variable in the <a href="http://config.py" target="_blank" rel="noopener noreferrer nofollow">config.py</a> file to quickly swap between modes. The only way I could get things to work is NOT to set the socket data rate after returning from deepsleep/nvram_restore() when in ADR mode.</p>
<p dir="auto">I'm guessing??? that something about adr settings being returned from the TTN gateway is not being save/restored in the non-volatile memory. I am forced to set the data rate at the socket level  or I get TX errors (Usually EAGAIN ) Possibly this is also related to me using US915 frequency plan  ?</p>
<p dir="auto">lora_socket.setsockopt(socket.SOL_LORA, socket.SO_DR, 3)</p>
<p dir="auto">Typical error</p>
<pre><code>Using existing join
Sending data: b'\xbe\x9a\x96\xc2\xdd\xb2 B'
Traceback (most recent call last):
    File &quot;main.py&quot;, line 56, in &lt;module&gt;
    File &quot;lopyhelper.py&quot;, line 72, in send
OSError: [Errno 11] EAGAIN
</code></pre>
<p dir="auto">My code working well enough for my needs , but I have a feeling the adr is not doing anything when I manually have to set the data rate at the socket level (Being non-adr is not a great loss, but would like to have it working).</p>
]]></description><link>https://forum.pycom.io/post/33996</link><guid isPermaLink="true">https://forum.pycom.io/post/33996</guid><dc:creator><![CDATA[somervda]]></dc:creator><pubDate>Sun, 16 Aug 2020 19:58:17 GMT</pubDate></item><item><title><![CDATA[Reply to Deepsleep and adr not playing well together on Mon, 17 Aug 2020 12:02:48 GMT]]></title><description><![CDATA[<p dir="auto">Slight update. I should have said &quot;The only way I could get things to work is to set the socket data...&quot; rather than &quot; The only way I could get things to work is NOT to set the socket data...&quot; in third paragraph (NOT should not be there).</p>
<p dir="auto">Also looking into github for the pycom firmware it looks like this is a known problem, see <a href="https://github.com/pycom/pycom-micropython-sigfox/issues/68" target="_blank" rel="noopener noreferrer nofollow">https://github.com/pycom/pycom-micropython-sigfox/issues/68</a> , however it says a fix went into the 1.20.2.rc10 release, but I am running this version and still see the problem.</p>
<p dir="auto">My firmware version</p>
<pre><code>os.uname()
(sysname='LoPy4', nodename='LoPy4', release='1.20.2.rc10', version='v1.11-a159dee on 2020-06-26', machine='LoPy4 with ESP32', lorawan='1.0.2', sigfox='1.0.1', pybytes='1.5.1')</code></pre>
]]></description><link>https://forum.pycom.io/post/34007</link><guid isPermaLink="true">https://forum.pycom.io/post/34007</guid><dc:creator><![CDATA[somervda]]></dc:creator><pubDate>Mon, 17 Aug 2020 12:02:48 GMT</pubDate></item><item><title><![CDATA[Reply to Deepsleep and adr not playing well together on Mon, 17 Aug 2020 12:35:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/5607">@somervda</a> The pull request linked in that issue is actually completely unrelated (it just has the same number so it got linked by mistake apparently).</p>
<p dir="auto">Not sure if that was ever actually fixed, one would have to dig into the sources to check. I was under the impression ADR ended up working with deep sleep at some point, but last time I tried it was ages ago and I don't quite remember the details.</p>
]]></description><link>https://forum.pycom.io/post/34009</link><guid isPermaLink="true">https://forum.pycom.io/post/34009</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Mon, 17 Aug 2020 12:35:13 GMT</pubDate></item></channel></rss>