<?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[Detect if REPL is connected]]></title><description><![CDATA[<p dir="auto">How do you detect if there is a console connection present?<br />
Use case is I don't want my device to go into deepsleep if I'm working on it.</p>
]]></description><link>https://forum.pycom.io/topic/3485/detect-if-repl-is-connected</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 12:44:01 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/3485.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Jul 2018 06:22:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Detect if REPL is connected on Sun, 15 Jul 2018 06:22:03 GMT]]></title><description><![CDATA[<p dir="auto">How do you detect if there is a console connection present?<br />
Use case is I don't want my device to go into deepsleep if I'm working on it.</p>
]]></description><link>https://forum.pycom.io/post/20880</link><guid isPermaLink="true">https://forum.pycom.io/post/20880</guid><dc:creator><![CDATA[tobz]]></dc:creator><pubDate>Sun, 15 Jul 2018 06:22:03 GMT</pubDate></item><item><title><![CDATA[Reply to Detect if REPL is connected on Sun, 15 Jul 2018 12:36:47 GMT]]></title><description><![CDATA[<p dir="auto">I have found myself <a href="https://forum.micropython.org/viewtopic.php?f=2&amp;t=4538&amp;p=26193#p26193" target="_blank" rel="noopener noreferrer nofollow">stuck a few times with ESP8266</a> as well as ESP32 with exactly the same issue!</p>
<p dir="auto">The Pyboard has a useful <a href="https://docs.micropython.org/en/latest/pyboard/library/pyb.USB_VCP.html" target="_blank" rel="noopener noreferrer nofollow">USB_VCP.isconnected method</a> which does exactly the function you are after.  However, I am not sure if ESP32 offers that function. Perhaps a Pycom github enhancement request?</p>
<p dir="auto">As an interim measure I now put in a 30 second delay on a hard reset  ( using <a href="https://docs.pycom.io/chapter/firmwareapi/pycom/machine/" target="_blank" rel="noopener noreferrer nofollow">machine.RESET_CAUSE</a>) allowing me time to interrupt the script.<br />
Not very elegant, but it works.</p>
]]></description><link>https://forum.pycom.io/post/20889</link><guid isPermaLink="true">https://forum.pycom.io/post/20889</guid><dc:creator><![CDATA[philwilkinson]]></dc:creator><pubDate>Sun, 15 Jul 2018 12:36:47 GMT</pubDate></item><item><title><![CDATA[Reply to Detect if REPL is connected on Sun, 15 Jul 2018 13:51:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/1142">@tobz</a> If you have the chance to connect one of the modem control signals like RTS to a GPIO port, then you can use that one.</p>
]]></description><link>https://forum.pycom.io/post/20891</link><guid isPermaLink="true">https://forum.pycom.io/post/20891</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Sun, 15 Jul 2018 13:51:44 GMT</pubDate></item><item><title><![CDATA[Reply to Detect if REPL is connected on Mon, 16 Jul 2018 01:32:04 GMT]]></title><description><![CDATA[<p dir="auto">I had a similiar situation where I wish to disable WDT when using console.<br />
I put a jumper cable in between ground and a pin. The check for it on bootup and then if pulled to ground will not start the WDT.</p>
]]></description><link>https://forum.pycom.io/post/20896</link><guid isPermaLink="true">https://forum.pycom.io/post/20896</guid><dc:creator><![CDATA[timh]]></dc:creator><pubDate>Mon, 16 Jul 2018 01:32:04 GMT</pubDate></item><item><title><![CDATA[Reply to Detect if REPL is connected on Sat, 05 Jan 2019 21:24:04 GMT]]></title><description><![CDATA[<p dir="auto">I am using a W01 module connected via P0, P1 (the standard Rx/Tx lines of the serial REPL) to a FT232R serial-USB-interface. The FT232R is powered from USB.<br />
By defining P0 (i.e. Rx) as input with pull down activated, it is possible to dectect if REPL (i.e. the USB) is connected (P0=1=yes)<br />
It may be interesting to note that UART operation is not affected by having Rx(P0) declared as digital input simultaneously.</p>
<p dir="auto">By this method, the module detects a serial console during boot and continues in REPL mode. If there is no active serial connection detected, it autostarts its application.</p>
<p dir="auto">I am not sure if this works with a Wipy since the serial-USB interface may be powered from the Wipy, possibly making the status of Rx independent of the USB cable connection.</p>
]]></description><link>https://forum.pycom.io/post/24659</link><guid isPermaLink="true">https://forum.pycom.io/post/24659</guid><dc:creator><![CDATA[Rustydusty]]></dc:creator><pubDate>Sat, 05 Jan 2019 21:24:04 GMT</pubDate></item></channel></rss>