<?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[Tools: ampy reloaded]]></title><description><![CDATA[<p dir="auto">ampy is a great console script implemented in Python to conntect to the M5/Micropython Devices via serial terminal</p>
<blockquote>
<p dir="auto">NOTE: so this will not work if another tool (like putty) already using the serial port!</p>
</blockquote>
<p dir="auto">The following command (in windows style) would print the content of the file <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow ugc">boot.py</a> from the system on the command line</p>
<pre><code class="language-bash">ampy -p COM1 get /flash/boot.py
</code></pre>
<p dir="auto">Use the following to write a new file</p>
<pre><code class="language-bash">ampy -p COM1 get /flash/boot.py  boot.py
</code></pre>
<p dir="auto">that is</p>
<pre><code>ampy -p {{port}} get  {{remote_file_path}}  {{local_file_path}}
</code></pre>
<p dir="auto">To put a file on the device you have to write</p>
<pre><code class="language-bash">ampy -p COM1 put boot.py /flash/boot.py
</code></pre>
<p dir="auto">that is</p>
<pre><code>ampy -p {{port}}  put {{local_file_path}} {{remote_file_path}}
</code></pre>
<p dir="auto">There are some ideas for improvement of the process of ampy:</p>
<ol>
<li>the serial port would better be read from a configuration file, hence it often the same entry</li>
</ol>
<blockquote>
<p dir="auto">you may use the environment variable AMPY_PORT, AMPY_BAUD... but this is a little bit too static<br />
you can find my test code on the forked repository <a href="https://github.com/ahaeberle/ampy" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/ahaeberle/ampy</a></p>
</blockquote>
<ol start="2">
<li>add default path for local files and write them without giving the name on a second parameter</li>
</ol>
<p dir="auto">from the system on the command line to write a new file.</p>
<blockquote>
<p dir="auto">remember to put the an ampy.json in the folder or use a <code>--json {{filename}}</code></p>
</blockquote>
<pre><code class="language-bash">ampy -p COM1 get /flash/boot.py
</code></pre>
<p dir="auto">Use the following to write a new file</p>
<pre><code class="language-bash">ampy get /flash/boot.py  # with implicit filename
</code></pre>
<ol start="3">
<li>add default path for remote files to put them with a simpler command</li>
</ol>
<p dir="auto">new command to get a file with an ampy.json in the calling directory</p>
<pre><code class="language-bash">ampy get /flash/boot.py   
</code></pre>
<p dir="auto">that is</p>
<pre><code>ampy get  {{remote_file_path}}  # implicit name and path with json
</code></pre>
<p dir="auto">and the JSON-File</p>
<pre><code class="language-json">{
    "AMPY_PORT": "COM1",
    "AMPY_DELAY":     0.0,
    "AMPY_BAUD": 115200,
    "REMOTE_PATH": "/flash/",
    "LOCAL_PATH": "./"
}
</code></pre>
]]></description><link>https://community.m5stack.com/topic/480/tools-ampy-reloaded</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 20:39:50 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/480.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 05 Jan 2019 22:47:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Tools: ampy reloaded on Sat, 05 Jan 2019 22:53:29 GMT]]></title><description><![CDATA[<p dir="auto">there is a small mistake in the last commands:</p>
<p dir="auto">ampy put <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow ugc">boot.py</a></p>
<p dir="auto">that is</p>
<p dir="auto">ampy put {{local_file_path}}  # implicit remote path and name with json</p>
<p dir="auto">and the JSON-File</p>
]]></description><link>https://community.m5stack.com/post/2353</link><guid isPermaLink="true">https://community.m5stack.com/post/2353</guid><dc:creator><![CDATA[felix42eu]]></dc:creator><pubDate>Sat, 05 Jan 2019 22:53:29 GMT</pubDate></item></channel></rss>