Skip to content
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

Restructure sensor message format #97

Open
zsoltmazlo opened this issue Oct 21, 2017 · 2 comments
Open

Restructure sensor message format #97

zsoltmazlo opened this issue Oct 21, 2017 · 2 comments
Assignees

Comments

@zsoltmazlo
Copy link
Contributor

zsoltmazlo commented Oct 21, 2017

In this wiki page, the messages are sent individually for each train and wagon, which is a difficult task to collect in a receiver component. Thus, I'm suggesting the following format:

Message format:

JSON field Type Description Example
time int timestamp of the message in milliseconds 1508578744987
locomotive string name of the locomotive Taurus
length float the length of the locomotive 21.47
speed cm/s or mm/s the speed of the locomotive, only cm/s or mm/s could be used 10.67
unit cm or mm the length unit used in both the calculation the length and the speed field mm
wagons array of wagon objects wagon message for each wagon, could be empty []

Wagon object:

JSON field Type Description Example
name string name of the wagon Red
length float the length of the wagon 21.47
unit cm or mm the length unit used in calculating the length field (it is recommended to be the very same unit which used in the parent object) mm

An example message when a Taurus locomotive with two Red wagon passed by the sensor (disclaimer: the example data might not be real):

{
   "time": 1508578744987,
   "locomotive": "Taurus",
   "length": 21.47,
   "speed": 10.67,
   "unit": "cm",
   "wagons": [
      {"name": "Red", "length": 12.01, "unit": "cm"},
      {"name": "Red", "length": 12.07, "unit": "cm"}
   ]
};

This message format is open for discuss, please, comment on this issue if you have any ideas.

@zsoltmazlo
Copy link
Contributor Author

As @hegyibalint pointed out, to discuss this issue it's enough to request review with tagging users a comment, thus all unnecessary assignment was removed and hereby I'm requesting review from the following users: @hegyibalint @imbur @baloghlaszlo @benedekh.

@szantob
Copy link
Collaborator

szantob commented Oct 24, 2017

New json message added on "\modes3\locomotives" mqtt channel.
{ "sender": "sensor02", "time": 100, "locomotive": "Vagon", "length": 15.1454, "speed": 29.88464, "unit": "cm" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants