<?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[GPS (AT6558) at Thonny editor]]></title><description><![CDATA[<p dir="auto">I have code in Micropython to communicate with the GPS unit connected to port A (because  I use plain Gray M5Stack unit) and using Thonny editor.</p>
<p dir="auto">If I upload code directly to the device a run it from the menu, it works well. But if I try to run it directly from Thonny editor (it uses REPL mode I guess), I got this error:</p>
<pre><code>Unit: Please change unit gps to other grove
</code></pre>
<p dir="auto">It is very simple code and it looks like this:</p>
<pre><code>import os
from m5stack import *
from m5ui import *
from uiflow import *
import unit

setScreenColor(0x222222)
gps0 = unit.get(unit.GPS, unit.PORTA)

label0 = M5TextBox(92, 85, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(92, 70, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)

while True:
  label0.setText(str(gps0.pos_quality))
  label1.setText(str(gps0.satellite_num))
  wait_ms(2)
</code></pre>
<p dir="auto">Do you have any tips?</p>
]]></description><link>https://community.m5stack.com/topic/3269/gps-at6558-at-thonny-editor</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 08:44:01 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3269.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 08 May 2021 05:42:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GPS (AT6558) at Thonny editor on Sun, 09 May 2021 01:47:12 GMT]]></title><description><![CDATA[<p dir="auto">Hi, In GRAY M5STACK unfortunatelly PortA is used for I2C to some internal chip. Sometime GPS not work on Grove Cable.</p>
<p dir="auto">Just connect GPS to<br />
16RX &lt;&lt;&lt; TX White<br />
17TX &gt;&gt;&gt; Rx Yellow<br />
And all start working with no problem.</p>
<p dir="auto">Example code from Arduino works if You add</p>
<p dir="auto">#define RX1 16<br />
#define TX1 17<br />
...<br />
void setup()<br />
{<br />
M5.begin();<br />
M5.Power.begin();<br />
GPSRaw.begin(9600, SERIAL_8N1,RX1,TX1);</p>
<p dir="auto"><img src="/assets/uploads/files/1620524778731-30c66d7b-be90-4ac1-80ac-0815ae8019a6-image-resized.png" alt="0_1620524777250_30c66d7b-be90-4ac1-80ac-0815ae8019a6-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/13757</link><guid isPermaLink="true">https://community.m5stack.com/post/13757</guid><dc:creator><![CDATA[SP3SWJ]]></dc:creator><pubDate>Sun, 09 May 2021 01:47:12 GMT</pubDate></item></channel></rss>