<?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[gpy UART does not work on battery power]]></title><description><![CDATA[<p dir="auto">when I power my GPY via battery the UART stops working. When I power the GPY with USB, the UART works. Is there an explanation for this?</p>
]]></description><link>https://forum.pycom.io/topic/6685/gpy-uart-does-not-work-on-battery-power</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 22:28:33 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/6685.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 22 Dec 2020 11:37:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to gpy UART does not work on battery power on Tue, 22 Dec 2020 11:37:14 GMT]]></title><description><![CDATA[<p dir="auto">when I power my GPY via battery the UART stops working. When I power the GPY with USB, the UART works. Is there an explanation for this?</p>
]]></description><link>https://forum.pycom.io/post/36102</link><guid isPermaLink="true">https://forum.pycom.io/post/36102</guid><dc:creator><![CDATA[marcbeltman]]></dc:creator><pubDate>Tue, 22 Dec 2020 11:37:14 GMT</pubDate></item><item><title><![CDATA[Reply to gpy UART does not work on battery power on Tue, 22 Dec 2020 13:32:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/5612">@marcbeltman</a> how are you powering the GPy and connecting to UART in either case? Are you using an expansion board or Pysense or Pytrack? If using your own board, can you provide a schematic of your setup?</p>
]]></description><link>https://forum.pycom.io/post/36104</link><guid isPermaLink="true">https://forum.pycom.io/post/36104</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Tue, 22 Dec 2020 13:32:43 GMT</pubDate></item><item><title><![CDATA[Reply to gpy UART does not work on battery power on Tue, 22 Dec 2020 21:14:58 GMT]]></title><description><![CDATA[<p dir="auto">i use the expansionboard 3.0 to communicate with an esp via uart.<br />
i have a sensor on the standard uart pins of the gpy p3 and p4 and in addition i want to communicate via uart on pins 20 and 21 with an esp<br />
In the picture you can see my setup.<br />
When i power the gpy and the esp both through the usb (gnd and 3.3v not connected to esp) then the uart works. When i power the gpy from battery only, (gnd and 3.3v connected to esp) then the uart does not work. I don't know why.</p>
<p dir="auto"><img src="/assets/uploads/files/1608670911665-opstelling.png" alt="opstelling.png" class="img-responsive img-markdown" /></p>
<p dir="auto">this is the code i am using from the gpy to the esp<br />
he sends a &quot;?&quot; when the esp  receives the &quot;?&quot; the esp sends the data to the gpy</p>
<pre><code>from machine import UART
import time
import pycom


pycom.heartbeat(False)

def read_esp():
  uart = UART(1, baudrate=9600, pins=('P21','P20')) # voor esp

  strMsg = ''
 
  uart.write('?')

  time.sleep(2)

  if uart.any() &gt; 0:
    
      strMsg = uart.read() 
      print(strMsg)
   
      strMsg = str(strMsg, 'utf-8')
      print(strMsg)
      return strMsg 
  else:
    strMsg = &quot;noData&quot;
    print(strMsg)
    return strMsg 

read_esp()
</code></pre>
<p dir="auto">This is the code from the esp</p>
<pre><code>import machine
uart = machine.UART(2, 9600, txbuf=512, rxbuf=512)

strMsg = ''

while True:
    if uart.any() &gt; 0:
        strMsg = uart.read()
        print(strMsg)
        
        if '?' in strMsg:
            uart.write('033,3.3,+22,10,1,10')
        else:
            uart.write('error')
            ```</code></pre>
]]></description><link>https://forum.pycom.io/post/36107</link><guid isPermaLink="true">https://forum.pycom.io/post/36107</guid><dc:creator><![CDATA[marcbeltman]]></dc:creator><pubDate>Tue, 22 Dec 2020 21:14:58 GMT</pubDate></item><item><title><![CDATA[Reply to gpy UART does not work on battery power on Tue, 22 Dec 2020 21:26:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/5612">@marcbeltman</a> said in <a href="/post/36107">gpy UART does not work on battery power</a>:</p>
<blockquote>
<p dir="auto">i use the expansionboard 3.0 to communicate with an esp via uart.<br />
i have a sensor on the standard uart pins of the gpy p3 and p4 and in addition i want to communicate via uart on pins 20 and 21 with an esp<br />
In the picture you can see my setup.<br />
When i power the gpy and the esp both through the usb (gnd and 3.3v not connected to esp) then the uart works. When i power the gpy from battery only, (gnd and 3.3v connected to esp) then the uart does not work. I don't know why.</p>
</blockquote>
<p dir="auto"><img src="/assets/uploads/files/1608671779240-opstelling.png" alt="opstelling.png" class="img-responsive img-markdown" /></p>
<p dir="auto">this is the code i am using from the gpy to the esp<br />
he sends a &quot;?&quot; when the esp receives the &quot;?&quot; the esp sends the data to the gpy</p>
<pre><code>from machine import UART
import time
import pycom


pycom.heartbeat(False)

def read_esp():
  uart = UART(1, baudrate=9600, pins=('P21','P20')) # voor esp

  strMsg = ''
 
  uart.write('?')

  time.sleep(2)

  if uart.any() &gt; 0:
    
      strMsg = uart.read() 
      print(strMsg)
   
      strMsg = str(strMsg, 'utf-8')
      print(strMsg)
      return strMsg 
  else:
    strMsg = &quot;noData&quot;
    print(strMsg)
    return strMsg 

read_esp()
</code></pre>
<p dir="auto">This is the code from the esp</p>
<pre><code>import machine
uart = machine.UART(2, 9600, txbuf=512, rxbuf=512)

strMsg = ''

while True:
    if uart.any() &gt; 0:
        strMsg = uart.read()
        print(strMsg)
        
        if '?' in strMsg:
            uart.write('033,3.3,+22,10,1,10')
        else:
            uart.write('error')
            
</code></pre>
]]></description><link>https://forum.pycom.io/post/36108</link><guid isPermaLink="true">https://forum.pycom.io/post/36108</guid><dc:creator><![CDATA[marcbeltman]]></dc:creator><pubDate>Tue, 22 Dec 2020 21:26:37 GMT</pubDate></item><item><title><![CDATA[Reply to gpy UART does not work on battery power on Wed, 23 Dec 2020 01:55:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/5612">@marcbeltman</a> not sure if that’s related, but remember that UART1 is used to control the LTE modem on the GPy (and FiPy).</p>
<p dir="auto">One thing you could try is connect RX to TX on either side to see if you still receive what you send (on both sides). This could help to isolate which side is the problem.</p>
]]></description><link>https://forum.pycom.io/post/36110</link><guid isPermaLink="true">https://forum.pycom.io/post/36110</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Wed, 23 Dec 2020 01:55:26 GMT</pubDate></item><item><title><![CDATA[Reply to gpy UART does not work on battery power on Wed, 23 Dec 2020 09:48:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1538">@jcaron</a> did what you said see picture. The gpy now receives what it sends and <strong>it works</strong> on battery power.<br />
strange!!!</p>
<p dir="auto"><img src="/assets/uploads/files/1608716875927-loop2.png" alt="loop2.png" class="img-responsive img-markdown" /></p>
]]></description><link>https://forum.pycom.io/post/36119</link><guid isPermaLink="true">https://forum.pycom.io/post/36119</guid><dc:creator><![CDATA[marcbeltman]]></dc:creator><pubDate>Wed, 23 Dec 2020 09:48:22 GMT</pubDate></item><item><title><![CDATA[Reply to gpy UART does not work on battery power on Wed, 23 Dec 2020 09:59:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1538">@jcaron</a> on the gpy UART0 = P0 and P1 and UART1 = P3 and p4?</p>
<p dir="auto">I am moving UART1 to pins P20 and P21</p>
<p dir="auto">uart = UART(1, baudrate=9600, pins=('P21','P20'))</p>
]]></description><link>https://forum.pycom.io/post/36121</link><guid isPermaLink="true">https://forum.pycom.io/post/36121</guid><dc:creator><![CDATA[marcbeltman]]></dc:creator><pubDate>Wed, 23 Dec 2020 09:59:57 GMT</pubDate></item><item><title><![CDATA[Reply to gpy UART does not work on battery power on Wed, 23 Dec 2020 14:39:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/5612">@marcbeltman</a> you can set the UART pins as you like. The pins shown on the pinout diagrams are only the way they are connected to other peripherals: UART0 to the PIC on the expansion board which acts as the USB/serial converter, and UART1 to the LTE modem.</p>
<p dir="auto">If you are using sleep modes and the like, the firmware may talk to the modem and reconfigure UART1 without you explicitly doing anything to it. Likewise with Pybytes.</p>
]]></description><link>https://forum.pycom.io/post/36131</link><guid isPermaLink="true">https://forum.pycom.io/post/36131</guid><dc:creator><![CDATA[jcaron]]></dc:creator><pubDate>Wed, 23 Dec 2020 14:39:57 GMT</pubDate></item><item><title><![CDATA[Reply to gpy UART does not work on battery power on Fri, 01 Jan 2021 10:37:37 GMT]]></title><description><![CDATA[<p dir="auto">SOLVED.  thanks to jcaron. It was his response that led me to the solution.<br />
The power to the ESP should <strong>not</strong> go to the <strong>vin</strong> but to <strong>3v3</strong>. Than it works</p>
]]></description><link>https://forum.pycom.io/post/36269</link><guid isPermaLink="true">https://forum.pycom.io/post/36269</guid><dc:creator><![CDATA[marcbeltman]]></dc:creator><pubDate>Fri, 01 Jan 2021 10:37:37 GMT</pubDate></item></channel></rss>