Create new device for MQTT connection crashes immediately after setup

Dear SenseBox community,

I am trying to set up a new device with mqtt connection. After completing the connection details and clicking finish a quick error appears (too fast to read the error message) and I am back to the global opensensemap with no device created. Do you have any idea?

Best,
Nico

Dear @nicosteckhan,

thanks for your request. Could you share your MQTT settings with us so I check if there is so misconfiguration? Or if there is some bug during the registration process.

Best, Matthias

URL: mqtt://divaircity001@ttn:password@eu1.cloud.thethings.network:1883
(password will be changed)

Topic: v3/divaircity001@ttn/devices/eui-3330303564317d07/up

Message formate: csv

Thanks. That´s what I thought. The used MQTT library is a little bit outdated and is throwing an error on topic names containing / and connection string containing some special characters like @ signs within the username or password.

I have updated the library and our MQTT integration and will deploy it next week. So next week you should be able to register a device with your kind of connection URL, username and password.

Dear Matthias,

what a nice support, Thanks a lot.
Would be nice if you can comment here if this is deployed.
Also I would like to know how well my json with the payload will be parsed.
Here is the part of the json with the decoded payload:
„decoded_payload“:{„humidity“:35,„temperature“:25}

Any suggestions would be very much appreciated.

Any news, @matthias ?

Looking forward
Nico

Hi @nicosteckhan

if everything works as planned the new version will be deployed at the end of the day.

I am running some last tests on our test environment.

Hi Nico,

I have deployed the new version on our production environment and hopefully the issues with special characters and a bit more complicated topicnames shoudl be gone.

Just one thing I have to mention. If you are using special characters in your username or password
please pass them in the Conneciton options as followed:
{"username":"username@1234","password":"super_Secret_password"}

If you pass everything in the Url the HTML form will complain that the Url is not correct because of the special characters in the username and password section.

Hope that is fine for you. I will checkout the frontend but I can´t promise to fix it in the next days because I am on parental leave starting on tuesday.

If you want to put everything in the Url you have to use the API and an HTTP request.

The decoded payload should follow the following structure for json:
[{"sensor":"sensorId","value":"5"},{"sensor":"sensorId","value":"7"}]

Hi all,

today I could connect to our mqtt broker with more complicated credentials and topics. The shown payload works, too. Now we only have to decode our payload from the lorawan boxes accordingly.

@nicosteckhan whats your setup? how do you decode your payload? do you use cayenne / lorawan?

Kind regards
Philipp

First of all, thanks a lot @matthias . I will try this out, because I really enjoy the dashboard and GUI of the opensensemap.

Yes, I use the lorawan and decode within TTN using a custom javascript Formater:

function Decoder(bytes, port) {
var hum = (bytes[0]);
var tmp = (bytes[1]);

return {
  temperature: tmp,
  humidity: hum,
}

}

My entries are now accepted, but somehow I miss some important step.
Could someone have a look?

I did also change the TTN javascript Formater to send the sensorID:

function Decoder(bytes, port) {
var hum = (bytes[0]);
var tmp = (bytes[1]);

return {
  "sensor": "654d388d81802600074a7cd0",
  "value": "13"
}

}

any help would be appreciated!

Hi @nicosteckhan

the decoded payload must be an array of objects with the sensor and value property.

This should be:

return [{
  "sensor": "....",
  "value": "..."
}]