Comments (10)
Sorry, should have clarified: HTTP
I've been testing the PR "status command", and noticed the logs show that the topic is blank for MessageCmd as well. For example, this is what is showing:
- 2024-04-25 16:44:02.434 I [DefaultDispatcher-worker-15] MessageProcessor/processIncomingMessage/340: Received incoming message: MessageLocation on owntracks/http/User with id=2bed2431
- 2024-04-25 16:44:02.441 I [DefaultDispatcher-worker-15] MessageProcessor/processIncomingMessage/340: Received incoming message: MessageCmd on with id=4e523927
- 2024-04-25 17:15:00.745 I [DefaultDispatcher-worker-10] MessageProcessor/processIncomingMessage/340: Received incoming message: MessageCard on with id=eb0d5167
It seems the incoming topic isn't being mapped to those.
from android.
Is this on HTTP or MQTT?
from android.
Ok, I see the issue. The override for HTTP is structured to only check the location message:
override fun onFinalizeMessage(message: MessageBase): MessageBase { // Build pseudo topic based on tid if (message is MessageLocation) { message.topic = HTTPTOPIC + message.trackerId } return message }
In 2.4, the trackerID was a field in the message base.
from android.
I created a PR to add "tid" to the MessageCard. That would restore the behavior 2.4.x had.
The current architecture is keying off getContactId() which requires a topic to link the two. The online booklet should be updated to indicate the necessary "tid" field.
from android.
So this is a little more complex than just adding the tid
to the card message. Per the booklet, the card only contains name
and face
, the contact association should come from the message topic it's delivered on.
Obviously on HTTP, there's no built-in concept of a "message topic", so we use a separate JSON field called topic
to carry what the topic would be. The tracker id is derived from that.
How are you generating card messages to send to the app? Can you see if they've got a topic
field in the JSON payload?
from android.
In order to get cards to work on 2.4.12, I had added a tid
field to the card JSON payload (fully appreciate that was a deviation from the booklet documentation). This is my return payload:
card = [ "_type": "card", "name": "${member.name}", "face": "${member.name}.jpg").encodeBase64().toString()}", "tid": "${member.name}" ]
Right now there is no topic
in the return MessageCard
payload that I am sending back to OwnTracks. I suppose the "proper" way to match the booklet would be for override fun onFinalizeMessage(...)
to parse the contact list for a matching name, and then recreate the return topic from that function with whatever the members trackerID is.
from android.
I ran some additional tests, and without tid
in the messageCard JSON response, iOS won't display image cards either. As soon as I add that back to the JSON, images appear on the map.
from android.
I can confirm cards were not supposed to work in the iOS app in HTTP mode. Using a tid
in the card message creates a pseudo-topic owntracks/http/<tid>
like it does for location
or transition
messages. So this is works though not intended to.
The apps are not designed for HTTP...
from android.
Since it does currently work on the published iOS and Android versions on HTTP, is there any reason it cannot be documented that it does and add back the changes to Android?
Seems odd to restrict HTTP functionality that is working based on the premise the original architecture was designed with only MQTT in mind.
from android.
Thoughts on this one? Is there a better way that you'd prefer this gets implemented (that also works with the iOS)?
from android.
Related Issues (20)
- Reverse-geo ratelimit pauses location publishes HOT 5
- Add ACCESS_BACKGROUND_LOCATION permission in order to give "Always" location permission
- [Feature Request] HOT 2
- OwnTracks reporting old location to server HOT 8
- Fix: sync iOS `rid` and Android `id` in the `waypoint` payload HOT 2
- V2.5.0 constantly crashing HOT 11
- Transition messages fail to send until the device stops moving HOT 4
- App won't even start HOT 2
- [Feature Request] Switch mode based on charging or battery HOT 4
- Way point circles do not appear on the map HOT 5
- TLS connection doesn't work - SSLPeerUnverifiedException HOT 8
- No Datatransfer in Mobile Phone network HOT 17
- [Feature] Support for PoI HOT 2
- Support for navigating with Organic Maps
- 'locatorPriority' setting no longer exposed in the configurations
- . HOT 1
- Unable to connect to HTTP endpoint using TLS HOT 11
- Cannot use "mock location" HOT 11
- Failing to connect to MQTT server with TLS (but Recorder succeeds) [Trust anchor for certification path not found] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android.