-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document all MQTT JSON objects (payload
)
#9
Comments
$SYS is MQTT broker internal stuff.
Don't know.
Discovery topic is there for discovery of what machines are online and their relevant topics. Disco is controlled by:
Data is published to discovery whenever a Fanuc controller is interrogated with a Focas call.
True. It is redundant.
Controlled with:
publish_status: publish heartbeat to Most of these configuration settings are relevant to
qos is used for message delivery. qos 0 - fire/forget, qos 1 - require that broker acks, qos 2 - require that a receiving client acks... if i remember correctly.
The purpose of retain is that the last message hangs out at the broker forever (or configurable in MQTT5), so when a new client connects and subscribes, it receives that message, instead of hanging around until a publisher sends a new message.
ahhh, I forget.
You will see that fanuc/{machine-id}-all receives more messages. All Focas responses are published there every single sweep. This is not the case with fanuc/{machine-id}. Messages there are only published when Focas responses change.
Yeah, delta would be the "difference". Maybe a better name here would be "state" ?
Because
is the same as the previous sweep of the series of Focas calls.
Correct, 'state' makes more sense.
|
It is, ms since 1970. |
Related to #28. Sorry for issue duplication, my memory does not serve me well at times. 😉 |
Once you told me that you want keep the dynamic typing (as opposed to static typing). I think that within the code (internal stuff), do as you wish, however, the user facing stuff (API, MQTT payload, …) should be strongly typed. |
Should, it takes more time. And as you can see, the payloads are forever changing. |
Okay, now to the MQTT payloads and topics. Note that I tested this on a single machine. Note that this would be useful to document somewhere (like in the
docs/
folder within the repo), where I’d move all thefanuc-driver
documentation (even fromREADME.md
).TL;DR
Document all MQTT JSON objects. I could not find any in depth documentation of
payload
object (there’s a bit of it inREADME.md
, but it isn’t much).DISCO
The first
topic
is$SYS/{broker_id}/new/clients
. Itspayload
contains2e58c25b4bb14c9ba7b86efb0c1838b1
—what is it for? I could not find it anywhere else in the payloads.brokerCounter
can be used to make sure no messages are omited and that they are processed in order, right?Please describe the contents of
payload
infanuc/DISCO
.a. At first I though that
added
andseen
are timestamps (UNIX epoch), but they are not and they are same in everyfanuc/DISCO
topic.b. Why do we have
machineId
when the whole object is named as the machine ID?c. What is the purpose of
arrivalTopic
andchangeTopic
? Again they are all the same in everyfanuc/DISCO
topic.I understand that
qos
is quality of service and is used for message prioritisation.As I understand the docs, when
retain
is set totrue
, those topics are changes to the previous machine state (and there the downstream apps should process it).dup
(I presume it stands for duplicate) which is always set tofalse
in my output. Is there any situation whendup
is set totrue
?Order of topics
What is used order of messages/topics? From what I can see, it is something like this:
a. First topic is always
$SYS/{broker_id}/new/clients
.b. Second topic is always
fanuc/DISCO
. This topic always comes before any other topics.c. Third topic is always
fanuc/{machine_id}/connect
.What is the different between
fanuc/{machine-id}
andfanuc/{machine-id}-all
? From my tests, both contain/broadcast the same data.Deltas
Related: MQTT Payload Structure - Suggested
delta
objects of each (let’s say) type contains all information of that particular type, but all subsequentdeltas
contain only the changes to that particular type, right? However, there are some exceptions to this rule, which always contain the same data, for example:fanuc/{machine_id}/connect
, where it always contains thetime
since (?)fanuc-driver
start and if it was successfully connected;fanuc/{machine_id}/cnc_id
, where it always contains thetime
since (?)fanuc-driver
start andcncid
;fanuc/{machine_id}/cnc_id
, where it always contains thetime
since (?)fanuc-driver
start,minute
andmsec
.Anyway, I have no idea why
fanuc/{machine_id}/connect
andfanuc/{machine_id}-all/connect
have differenttime
values.That said, I don’t think that the above-mentioned exceptions above should be called the deltas. I suggest to rename it to something like
metadata
orstatus
(or whatever else). Usually, a delta is a difference between the previous version and current version, but the above information is not a delta in this sense.The text was updated successfully, but these errors were encountered: