<?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[background daemon and accessing location&#x2F;gnss data]]></title><description><![CDATA[<p dir="auto">Hi all !</p>
<p dir="auto">I'm kinda new to the Ubuntu Touch fury and got it installed on a Poco X3 NFC i got on the cheap. a tad quirky but surprisingly nice.</p>
<p dir="auto">My goal, tbh, wasn't even have it as a daily, but replacing a small RockPi SBC I have running in my car that is underpowered, despite chewing over &gt;1W.</p>
<p dir="auto">This averages 0.3W idle, with GPS+Wifi+LTE ... I don't need any GPIOs (but seems i'd have to live without OTG USB, unsure about that yet)</p>
<p dir="auto">I got Supervisor, Mosquitto, node.js installed, and it starts node-red on boot (ressources are mostly under the phablet user to keep / read-only)</p>
<p dir="auto">One of my issues is accessing GPS data (sure enough, first fix takes ages, but that's something else)</p>
<p dir="auto">I am totally at lost about the whole lomiri stack, dbus is already hard enough (I deal with hundreds of linux servers all day) This is almost "hey son, can you fix my printer" territory <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=aee68f5cf05" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">I can eavesdrop on the system dbus if I start GPS toolkit on the UI side:</p>
<pre><code class="language-bash"># dbus-monitor --system
...
method call time=1747474346.025144 sender=:1.14 -&gt; destination=:1.133 serial=117 path=/sessions/1; interface=com.lomiri.location.Service.Session; member=UpdatePosition
   double YY.096
   double X.83785
   boolean true
   double 74.9379
   boolean true
   double 10.5377
   boolean false
   int64 1747474346017862807
method call time=1747474346.028468 sender=:1.14 -&gt; destination=:1.133 serial=118 path=/sessions/1; interface=com.lomiri.location.Service.Session; member=UpdateVelocity
   double 0
   int64 1747474346019894752
...
</code></pre>
<p dir="auto">But I'd like to get things running using a python3 or node.js script, in the background.</p>
<pre><code class="language-python">import pydbus

# Connect to the system bus
bus = pydbus.SystemBus()

# Access the location service
location_service = bus.get('com.lomiri.location.Service')
#location_service = bus.get('com.lomiri.location.Service','/com/lomiri/location')

# Get the location
location = location_service.GetLocation()

print(f"Latitude: {location['latitude']}")
print(f"Longitude: {location['longitude']}")
print(f"Altitude: {location['altitude']}")
</code></pre>
<p dir="auto">unfortunatly, that object doesn't export any interfaces (or GI is lacking stuff, dunno)</p>
<p dir="auto">Ideally, i'd write i very light python3 daemon that would just update topics on the local mqtt so I can play with the data under node-red.</p>
<p dir="auto">Thanks for any pointers in the right direction</p>
<p dir="auto">JaXX./.</p>
<p dir="auto">Sidequestions:<br />
Would a USB-C hub be recognized ? (lsusb showed nothing) (damn, the thing draws 0.8W on it's own gotta find something else)<br />
Under android, it was able to have an active hotspot (with clients) while being connected to home wifi, I'll explore that soon but if anyone had a clue on how to reproduce the same use-case, it'd be great (the idea would be having other wireless sensors connecting to the phone, but the phone using home wifi when available instead of being stuck on LTE)</p>
]]></description><link>https://forums.ubports.com/topic/10988/background-daemon-and-accessing-location-gnss-data</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 11:49:35 GMT</lastBuildDate><atom:link href="https://forums.ubports.com/topic/10988.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 May 2025 10:12:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to background daemon and accessing location&#x2F;gnss data on Sun, 18 May 2025 09:48:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ikoz" aria-label="Profile: ikoz">@<bdi>ikoz</bdi></a></p>
<p dir="auto">Hi,</p>
<p dir="auto">Thanks for the reply...</p>
<p dir="auto">Unfortunately , test_gps doesn't work at all ("**** GPS interface not found <img src="https://forums.ubports.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=aee68f5cf05" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":(" alt="😞" /> Bye!*" ), tried that yesterday, no wrapping around it would give anything... looks like that comes from the hybris stack for old android stuff that accessed GPS hardware directly...</p>
<p dir="auto">Since I believe the hardware to be already locked/in use by the the software stack, I probably need to simulate the same approach (Qt &gt; QtPosition or Dbus sessions ?)</p>
<p dir="auto">I'll try working with QtPositioning somehow since GPSToolkit uses it</p>
<p dir="auto">USB: yeah, i'll check again later, ideally, I just need a way to inject juice and have a single usb, dunno</p>
<p dir="auto">Network:<br />
Yeah, honestly, if it can be Hotspot AP + Station at the same time, all done in UI to keep my dirty fingers away of the network management, that'd be great, or even by splitting the radio chains, 2.4GHs AP, 5GHz Client if needed<br />
I know the hardware can do it (because It did work before installing UBt)<br />
But it's less of an emergency</p>
]]></description><link>https://forums.ubports.com/post/85866</link><guid isPermaLink="true">https://forums.ubports.com/post/85866</guid><dc:creator><![CDATA[jaxx]]></dc:creator><pubDate>Sun, 18 May 2025 09:48:12 GMT</pubDate></item><item><title><![CDATA[Reply to background daemon and accessing location&#x2F;gnss data on Sat, 17 May 2025 19:49:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jaxx" aria-label="Profile: jaxx">@<bdi>jaxx</bdi></a> If I understand your questions correctly:</p>
<ol>
<li>cannot get the location with Python</li>
<li>USB-OTG</li>
<li>Hotspot source auto switch between WiFi/LTE</li>
</ol>
<p dir="auto">1<br />
The expected way of getting GPS coordinates is via the Qt interface. You can however check out <a href="https://framagit.org/ernesst/MLS-for-Utouch/-/blob/master/MLS-for-Utouch.py" target="_blank" rel="noopener noreferrer nofollow ugc">this Python script</a> which among other things obtains the location, by searching in the output of the <code>test_gps</code> command</p>
<p dir="auto">2<br />
I remember usb devices working in Ubuntu Touch, could it be a problem with the specific hub?</p>
<p dir="auto">3<br />
You can theoretically write a script with nmcli/network manager, I will test later if the default hotspot service can work this way.</p>
]]></description><link>https://forums.ubports.com/post/85865</link><guid isPermaLink="true">https://forums.ubports.com/post/85865</guid><dc:creator><![CDATA[ikoz]]></dc:creator><pubDate>Sat, 17 May 2025 19:49:49 GMT</pubDate></item></channel></rss>