<?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[First Project - GPS on Core2 w&#x2F; UIFlow2.0]]></title><description><![CDATA[<p dir="auto">So, I am working on a simple first project using the GPS.  I am basing it off the one for the ENVII.  I have a Core2 with UIFLow 2.0  Below is the code.  It displays the labels, and displays what looks like data from the GPS, but it never changes and is not correct as if it is not finding satellites or even looking for them.  Is there something else I need to do in the code to initialize the GPS Unit correctly.  I am not a coder, this is literally my first time trying anything like this.  I got the Core2 and the GPS to start learning.  Yes, I have been outside and waited with clear skies and the Core2 has plenty of battery.</p>
<p dir="auto">import os, sys, io<br />
import M5<br />
from M5 import *<br />
from hardware import *<br />
from unit import GPSUnit</p>
<p dir="auto">rect0 = None<br />
rect1 = None<br />
rect2 = None<br />
rect3 = None<br />
rect4 = None<br />
label0 = None<br />
label1 = None<br />
label2 = None<br />
label3 = None<br />
label4 = None<br />
label5 = None<br />
label6 = None<br />
label7 = None<br />
label8 = None<br />
i2c0 = None<br />
gps_0 = None</p>
<p dir="auto">def setup():<br />
global rect0, rect1, rect2, rect3, rect4, label0, label1, label2, label3, label4, label5, label6, label7, label8, i2c0, gps_0</p>
<p dir="auto">i2c0 = I2C(0, scl=Pin(33), sda=Pin(32), freq=100000)<br />
gps_0 = GPSUnit((13, 14))<br />
gps_0.set_time_zone(-5)<br />
gps_0.uart_port_id(1)<br />
M5.begin()<br />
Widgets.fillScreen(0x5b5b5b)<br />
rect0 = Widgets.Rectangle(0, 0, 320, 23, 0xffffff, 0x000167)<br />
rect1 = Widgets.Rectangle(0, 215, 320, 23, 0xffffff, 0x000167)<br />
rect2 = Widgets.Rectangle(0, 30, 320, 47, 0xffffff, 0xfbff8e)<br />
rect3 = Widgets.Rectangle(0, 83, 320, 47, 0xffffff, 0x1c6527)<br />
rect4 = Widgets.Rectangle(0, 136, 320, 47, 0xffffff, 0x760000)<br />
label0 = Widgets.Label("label0", 2, 32, 1.0, 0x222222, 0xfbff8e, Widgets.FONTS.DejaVu18)<br />
label1 = Widgets.Label("label1", 2, 54, 1.0, 0x222222, 0xfbff8e, Widgets.FONTS.DejaVu18)<br />
label2 = Widgets.Label("label2", 2, 86, 1.0, 0xffffff, 0x1c6527, Widgets.FONTS.DejaVu18)<br />
label3 = Widgets.Label("label3", 2, 108, 1.0, 0xffffff, 0x1c6527, Widgets.FONTS.DejaVu18)<br />
label4 = Widgets.Label("label4", 2, 2, 1.0, 0xffffff, 0x000167, Widgets.FONTS.DejaVu18)<br />
label5 = Widgets.Label("label5", 217, 2, 1.0, 0xffffff, 0x000167, Widgets.FONTS.DejaVu18)<br />
label6 = Widgets.Label("label6", 2, 217, 1.0, 0xffffff, 0x000167, Widgets.FONTS.DejaVu18)<br />
label7 = Widgets.Label("label7", 2, 138, 1.0, 0xffffff, 0x760000, Widgets.FONTS.DejaVu18)<br />
label8 = Widgets.Label("label8", 2, 161, 1.0, 0xffffff, 0x760000, Widgets.FONTS.DejaVu18)</p>
<p dir="auto">def loop():<br />
global rect0, rect1, rect2, rect3, rect4, label0, label1, label2, label3, label4, label5, label6, label7, label8, i2c0, gps_0<br />
M5.update()<br />
label0.setText(str((str('Date: ') + str((gps_0.gps_date)))))<br />
label1.setText(str((str('Time: ') + str((gps_0.gps_time)))))<br />
label2.setText(str((str('Lat:') + str((gps_0.latitude)))))<br />
label3.setText(str((str('Long:') + str((gps_0.longitude)))))<br />
label4.setText(str((str('Sats:') + str((gps_0.satellite_num)))))<br />
label5.setText(str((str('Alt:') + str((gps_0.altitude)))))<br />
label6.setText(str((str('Quality:') + str((gps_0.pos_quality)))))<br />
label7.setText(str((str('Speed (KPH):') + str((gps_0.speed_kph)))))<br />
label8.setText(str((str('Course:') + str((gps_0.course)))))</p>
<p dir="auto">if <strong>name</strong> == '<strong>main</strong>':<br />
try:<br />
setup()<br />
while True:<br />
loop()<br />
except (Exception, KeyboardInterrupt) as e:<br />
try:<br />
from utility import print_error_msg<br />
print_error_msg(e)<br />
except ImportError:<br />
print("please update to latest firmware")</p>
<p dir="auto"><img src="https://i.imgur.com/mDWTKEb.jpeg" alt="UIFlow 2" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://i.imgur.com/05FlIjA.jpeg" alt="Data So far on Core2" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/topic/6061/first-project-gps-on-core2-w-uiflow2-0</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 23:11:19 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6061.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Feb 2024 14:14:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to First Project - GPS on Core2 w&#x2F; UIFlow2.0 on Thu, 08 Feb 2024 13:04:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> I wanted to change the altitude to ft, speed to mph.  I found the Maths group, but ended up having to first Convert to Float, then Convert to Int, then I could do the conversions.  Also made the labels a bit easier to figure out at a glance.</p>
<p dir="auto">lblAlt.setText(str((str('Alt (ft):') + str(((int(float(gps_0.altitude))) * 3.281)))))<br />
lblSpd.setText(str((str('Speed (mph):') + str(((int(float(gps_0.speed_kph))) * 1.609)))))</p>
<p dir="auto">Thanks for the assist.  Now on to a cooler UI now that I have the data I want.</p>
]]></description><link>https://community.m5stack.com/post/23705</link><guid isPermaLink="true">https://community.m5stack.com/post/23705</guid><dc:creator><![CDATA[Deckyon]]></dc:creator><pubDate>Thu, 08 Feb 2024 13:04:04 GMT</pubDate></item><item><title><![CDATA[Reply to First Project - GPS on Core2 w&#x2F; UIFlow2.0 on Thu, 08 Feb 2024 09:49:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/deckyon" aria-label="Profile: Deckyon">@<bdi>Deckyon</bdi></a> the ports are colour coded for a reason. the GPS has a blue connector and is supposed to only connect to blue ports.</p>
<p dir="auto">however the ESP32 using a connection matrix and as <a class="plugin-mentions-user plugin-mentions-a" href="/user/robski" aria-label="Profile: robski">@<bdi>robski</bdi></a> pointed out you can redefine the pins a port uses. but may cause issue later on in code.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robski" aria-label="Profile: robski">@<bdi>robski</bdi></a> said in <a href="/post/23698">First Project - GPS on Core2 w/ UIFlow2.0</a>:</p>
<blockquote>
<p dir="auto">nice one,</p>
<p dir="auto">"Now, to do some programming and figure out how to change the strings into ints so I can do some math conversions"</p>
<p dir="auto">from uiflow1 examples:<br />
label0.set_text(str(gps_0.latitude))<br />
label1.set_text(str(gps_0.longitude))<br />
label2.set_text(str(gps_0.latitude_decimal))<br />
label3.set_text(str(gps_0.longitude_decimal))</p>
</blockquote>
<p dir="auto">in the maths menu you will find a Convert to int block designed just for this task.<br />
<img src="/assets/uploads/files/1707385781748-screenshot-2024-02-08-at-09.49.18.png" alt="0_1707385781517_Screenshot 2024-02-08 at 09.49.18.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/post/23700</link><guid isPermaLink="true">https://community.m5stack.com/post/23700</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Thu, 08 Feb 2024 09:49:45 GMT</pubDate></item><item><title><![CDATA[Reply to First Project - GPS on Core2 w&#x2F; UIFlow2.0 on Thu, 08 Feb 2024 07:59:30 GMT]]></title><description><![CDATA[<p dir="auto">nice one,</p>
<p dir="auto">"Now, to do some programming and figure out how to change the strings into ints so I can do some math conversions"</p>
<p dir="auto">from uiflow1 examples:<br />
label0.set_text(str(gps_0.latitude))<br />
label1.set_text(str(gps_0.longitude))<br />
label2.set_text(str(gps_0.latitude_decimal))<br />
label3.set_text(str(gps_0.longitude_decimal))</p>
]]></description><link>https://community.m5stack.com/post/23698</link><guid isPermaLink="true">https://community.m5stack.com/post/23698</guid><dc:creator><![CDATA[robski]]></dc:creator><pubDate>Thu, 08 Feb 2024 07:59:30 GMT</pubDate></item><item><title><![CDATA[Reply to First Project - GPS on Core2 w&#x2F; UIFlow2.0 on Thu, 08 Feb 2024 01:58:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robski" aria-label="Profile: robski">@<bdi>robski</bdi></a> said in <a href="/post/23687">First Project - GPS on Core2 w/ UIFlow2.0</a>:</p>
<blockquote>
<p dir="auto">gps_0 = GPSUnit((33, 32))</p>
</blockquote>
<p dir="auto">Did some fiddling, including finally figuring out how to make those changes, and it is now working!  Now, to do some programming and figure out how to change the strings into ints so I can do some math conversions.<br />
Thanks all!</p>
<p dir="auto">also, need to come up with a real UI as well.  But, I am just glad it is working.</p>
]]></description><link>https://community.m5stack.com/post/23697</link><guid isPermaLink="true">https://community.m5stack.com/post/23697</guid><dc:creator><![CDATA[Deckyon]]></dc:creator><pubDate>Thu, 08 Feb 2024 01:58:33 GMT</pubDate></item><item><title><![CDATA[Reply to First Project - GPS on Core2 w&#x2F; UIFlow2.0 on Wed, 07 Feb 2024 21:22:56 GMT]]></title><description><![CDATA[<p dir="auto">added photo explains it,<br />
you have no Core2 bottom extension with uart blue portC on it.<br />
you are connecting UART type gps unit (blue port) in to Core2 default I2C port - which can and needs to be reconfigured to accept UART type of communication</p>
]]></description><link>https://community.m5stack.com/post/23695</link><guid isPermaLink="true">https://community.m5stack.com/post/23695</guid><dc:creator><![CDATA[robski]]></dc:creator><pubDate>Wed, 07 Feb 2024 21:22:56 GMT</pubDate></item><item><title><![CDATA[Reply to First Project - GPS on Core2 w&#x2F; UIFlow2.0 on Wed, 07 Feb 2024 16:27:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/deckyon" aria-label="Profile: deckyon">@<bdi>deckyon</bdi></a> sometimes is easier to show your hardware setup (picture) what modules and how you have connected to controller  then code for crosscheck</p>
<p dir="auto">using red port I2c for unit with UART blue port needs to "tell" controller that it has to be configured with baudrate and parity matching gps unit  its not only pin config</p>
]]></description><link>https://community.m5stack.com/post/23690</link><guid isPermaLink="true">https://community.m5stack.com/post/23690</guid><dc:creator><![CDATA[robski]]></dc:creator><pubDate>Wed, 07 Feb 2024 16:27:18 GMT</pubDate></item><item><title><![CDATA[Reply to First Project - GPS on Core2 w&#x2F; UIFlow2.0 on Wed, 07 Feb 2024 14:31:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robski" aria-label="Profile: robski">@<bdi>robski</bdi></a> Will check that when I get home.  I was hoping to get comfortable with the whole UIFlow 2.0, not being a coder.</p>
]]></description><link>https://community.m5stack.com/post/23688</link><guid isPermaLink="true">https://community.m5stack.com/post/23688</guid><dc:creator><![CDATA[Deckyon]]></dc:creator><pubDate>Wed, 07 Feb 2024 14:31:37 GMT</pubDate></item><item><title><![CDATA[Reply to First Project - GPS on Core2 w&#x2F; UIFlow2.0 on Wed, 07 Feb 2024 14:49:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/deckyon" aria-label="Profile: deckyon">@<bdi>deckyon</bdi></a> said in <a href="/post/23686">First Project - GPS on Core2 w/ UIFlow2.0</a>:</p>
<blockquote>
<p dir="auto">So, I am working on a simple first project using the GPS.  I am basing it off the one for the ENVII.  I have a Core2 with UIFLow 2.0  Below is the code.  It displays the labels, and displays what looks like data from the GPS, but it never changes and is not correct as if it is not finding satellites or even looking for them.  Is there something else I need to do in the code to initialize the GPS Unit correctly.  I am not a coder, this is literally my first time trying anything like this.  I got the Core2 and the GPS to start learning.  Yes, I have been outside and waited with clear skies and the Core2 has plenty of battery.</p>
</blockquote>
<p dir="auto">have you tried any of factory examples  - easyloader or arduino  for gps just to prove that it is working?  also your GPS unit is the UART type - blue port correct?  Do you have bottom expansion with blue port on your Core2?  if no then you need to reconfigure it<br />
your code:  gps_0 = GPSUnit((13, 14))<br />
GPS connected to PortA   gps_0 = GPSUnit((33, 32))</p>
<p dir="auto"><img src="/assets/uploads/files/1707316514927-gpsuart.jpg" alt="0_1707316513495_gpsuart.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><a href="https://docs.m5stack.com/en/unit/gps" target="_blank" rel="noopener noreferrer nofollow ugc">GPS unit docs</a></p>
]]></description><link>https://community.m5stack.com/post/23687</link><guid isPermaLink="true">https://community.m5stack.com/post/23687</guid><dc:creator><![CDATA[robski]]></dc:creator><pubDate>Wed, 07 Feb 2024 14:49:48 GMT</pubDate></item></channel></rss>