<?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[Running code with ampy or rshell or REPL?]]></title><description><![CDATA[<p dir="auto">I'm trying to streamline the debug cycle. Since vscode doesn't have a serial console (does it?) I run my code from there, it fails, then I have to stop that, go to putty, see what the error was, quit putty, reconnect vscode...</p>
<p dir="auto">I tried a couple of suggestions I found here: ampy &amp; rshell, but couldn't get them to work.</p>
<p dir="auto">I have a file /flash/apps/purple_air.py. I can't seem to run it. If I start rshell, there's no run command. If I try using the shell command:</p>
<pre><code>cd /flash/apps
shell purple_air.py
</code></pre>
<p dir="auto">It opens the file in vscode. But since vscode isn't connected to the com port, the run icon doesn't work.</p>
<p dir="auto">From ampy, the run command can't seem to find imports, but when I run from vscode or via the apps interface on the m5stickC, it works just fine. My imports:</p>
<pre><code>from m5stack import *
from m5ui import *
from uiflow import *
import imu
import wifiCfg
</code></pre>
<p dir="auto">Ampy:</p>
<pre><code>ampy -pcom4 run purple_air.py
Traceback (most recent call last):
  File "c:\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python36\Scripts\ampy.exe\__main__.py", line 7, in &lt;module&gt;
  File "c:\python36\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\python36\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\python36\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python36\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python36\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\python36\lib\site-packages\ampy\cli.py", line 337, in run
    output = board_files.run(local_file, not no_output)
  File "c:\python36\lib\site-packages\ampy\files.py", line 303, in run
    out = self._pyboard.execfile(filename)
  File "c:\python36\lib\site-packages\ampy\pyboard.py", line 273, in execfile
    return self.exec_(pyfile)
  File "c:\python36\lib\site-packages\ampy\pyboard.py", line 267, in exec_
    raise PyboardError('exception', ret, ret_err)
ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n  File "&lt;stdin&gt;", line 6, in &lt;module&gt;\r\n  File "flowlib/lib/wifiCfg.py", line 3, in &lt;module&gt;\r\nImportError: cannot import name cfgRead\r\n')
</code></pre>
]]></description><link>https://community.m5stack.com/topic/1936/running-code-with-ampy-or-rshell-or-repl</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Mar 2026 17:02:01 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1936.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 08 May 2020 03:34:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Running code with ampy or rshell or REPL? on Sat, 13 Jun 2020 03:55:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/443">@ajb2k3</a> Adding to this: I'm using the pymakr extension to VS Code. It handles selective code upload (only changed ones).</p>
<p dir="auto">Note that pymakr does not handle binary file transfer eg. jpg.</p>
]]></description><link>https://community.m5stack.com/post/8975</link><guid isPermaLink="true">https://community.m5stack.com/post/8975</guid><dc:creator><![CDATA[jhfoo]]></dc:creator><pubDate>Sat, 13 Jun 2020 03:55:16 GMT</pubDate></item><item><title><![CDATA[Reply to Running code with ampy or rshell or REPL? on Sat, 09 May 2020 03:38:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/700">@lukasmaximus</a>  I read that Mu requires 1.5.0, and I also read that it isn't out yet for the M5StickC.<br />
<a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/443">@ajb2k3</a> I sure haven't been able to find it!</p>
]]></description><link>https://community.m5stack.com/post/8581</link><guid isPermaLink="true">https://community.m5stack.com/post/8581</guid><dc:creator><![CDATA[dclaar]]></dc:creator><pubDate>Sat, 09 May 2020 03:38:24 GMT</pubDate></item><item><title><![CDATA[Reply to Running code with ampy or rshell or REPL? on Fri, 08 May 2020 09:48:29 GMT]]></title><description><![CDATA[<p dir="auto">You could also try Mu. It may not have all the features that vscode has but it has a nice clean interface and works for transferring files between computer and m5stack, REPL, and has autocomplete for micropython base modules, i made a video on it a couple of weeks ago <a href="https://www.youtube.com/watch?v=GPRNUCBTVy4&amp;t=6s" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.youtube.com/watch?v=GPRNUCBTVy4&amp;t=6s</a></p>
]]></description><link>https://community.m5stack.com/post/8570</link><guid isPermaLink="true">https://community.m5stack.com/post/8570</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Fri, 08 May 2020 09:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to Running code with ampy or rshell or REPL? on Fri, 08 May 2020 08:21:09 GMT]]></title><description><![CDATA[<p dir="auto">Vcode does have a series console that you can use to run REPL through.</p>
]]></description><link>https://community.m5stack.com/post/8568</link><guid isPermaLink="true">https://community.m5stack.com/post/8568</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Fri, 08 May 2020 08:21:09 GMT</pubDate></item><item><title><![CDATA[Reply to Running code with ampy or rshell or REPL? on Fri, 08 May 2020 04:01:07 GMT]]></title><description><![CDATA[<p dir="auto">Oh, I can:</p>
<pre><code>import apps.purple_air as pa
pa.main()
</code></pre>
]]></description><link>https://community.m5stack.com/post/8566</link><guid isPermaLink="true">https://community.m5stack.com/post/8566</guid><dc:creator><![CDATA[dclaar]]></dc:creator><pubDate>Fri, 08 May 2020 04:01:07 GMT</pubDate></item></channel></rss>