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

Data is not decrypted in MQTT #24

Closed
bramkennis opened this issue Feb 21, 2017 · 2 comments
Closed

Data is not decrypted in MQTT #24

bramkennis opened this issue Feb 21, 2017 · 2 comments

Comments

@bramkennis
Copy link

bramkennis commented Feb 21, 2017

When subscribing to the tx topic from a particular sensor the data is encrypted.
example:

{
  "applicationID" : "1",
  "applicationName" : "Test",
  "nodeName" : "TesT",
  "devEUI" : "0004a30b00196799",
  "rxInfo" : [ {
    "mac" : "008000000000b6a9",
    "time" : "2017-02-21T09:50:58.195271Z",
    "rssi" : -63,
    "loRaSNR" : 11.2
  } ],
  "txInfo" : {
    "frequency" : 868100000,
    "dataRate" : {
      "modulation" : "LORA",
      "bandwidth" : 125,
      "spreadFactor" : 8
    },
    "adr" : true,
    "codeRate" : "4/5"
  },
  "fCnt" : 54,
  "fPort" : 2,
  "data" : "ESJxAyAAAyABI0VjVkiIgQ=="
}
@brocaar
Copy link
Owner

brocaar commented Feb 21, 2017

Without knowing the input, it is hard to judge if the data is encrypted or not 😉 You might mix up encoding vs encryption. The data should be decrypted, but is presented in base64 encoding (to make the binary data printable as ASCII). See: https://play.golang.org/p/JNIMHYKz6m (for base64 decoding your data) and https://en.wikipedia.org/wiki/Base64.

@bramkennis
Copy link
Author

You are right. When using the website https://play.golang.org we get the HEX value of our sensors.
Now the programmer must listen to the mqtt topic en decode the data so that we can store the ascii value in db and create some graphs.
Thanks

@brocaar brocaar closed this as completed Feb 21, 2017
@brocaar brocaar removed the question label Feb 21, 2017
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

2 participants