# Blues MQTT Setup with Qubitro

**URL:** <https://discuss.blues.com/t/blues-mqtt-setup-with-qubitro/992>\
**Category:** Notehub.io\
**Created:** [September 16, 2022, 7:42pm UTC](https://discuss.blues.com/t/blues-mqtt-setup-with-qubitro/992 "2022-09-16T19:42:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/pradeep/32/479_2.png) [@Pradeep](https://discuss.blues.com/u/Pradeep)\
**Post date:** [September 16, 2022, 7:42pm UTC](https://discuss.blues.com/t/blues-mqtt-setup-with-qubitro/992/1 "2022-09-16T19:42:09Z")

</div>

Hi Guys,

I’m trying to connect Qubitro MQTT service with Blues Route, but I can’t get the expected outputs. And I always got an error as below.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/e297e7b84acdee982a40e357eb53b5416466e5ed.png)  
Note:Double-checked the cred. But no luck.

Regards,  
Pradeep S.

---

<div class="post-metadata">

**Author:** ![Carl-Henderson](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/carl-henderson/32/587_2.png) [@Carl-Henderson](https://discuss.blues.com/u/Carl-Henderson)\
**Post date:** [September 16, 2022, 10:00pm UTC](https://discuss.blues.com/t/blues-mqtt-setup-with-qubitro/992/2 "2022-09-16T22:00:53Z")

</div>

Hi Pradeep,

I ran into the same thing at first but finally figured out how to get it working.

On [notehub.io](http://notehub.io), in order to [set the MQTT **Client ID**](https://dev.blues.io/guides-and-tutorials/routing-data-to-cloud/mqtt/#setting-the-mqtt-client-id) we need to set the **\_sn** environment variable for the device and to give it the value of the qubitro `Device ID`:

- go to [notehub.io](http://notehub.io)
- in the left nav click ‘devices’
- double click on the row for your device
- click the ‘Environment’ tab
- under **Device Environment Variables** make a variables **\_sn** (serial-number)
- give it the value from qubitro for `Device ID`. See screenshot.
- click Save

 ![image](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/5c5d985a8383c800060537d9cf6956cbebe2e7bd.png)

Unfortunately that step is a bit odd because now your device will often show up as `9fd5de4a-3327-4e4b-8f48-94d98935c968` (or whatever) in Notehub if you choose to view devices by their serial number. We are considering ways of making this easier in the future and allowing a device’s serial-number (\_sn) can be different from the MQTT Client ID.

On the Notehub MQTT Route settings (see screenshot):

- Set **Username** to the Qubitro **Device ID**
- Set **Password** to the Qubitro **Device Token**
- Set **Topic** to the Qubitro **Device ID**
- Optionally, choose a specific notefile and transform the data to simplify it if you don’t want everything going to Qubitro. See second screenshot for both the long-form and simplified data in qubitro.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/cf9bf4df886da479e6ad60cf86df1009b74af781.jpeg)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/45ce480835c35c83b2de7f4c0d2f97d49ad12674.png)

Unfortunately, It looks like you’ll need to go through all these steps for each individual device because of the way qubitro uses a different Client ID and Client token for each device. If you want to do this at scale with many devices you can use our API to create each route and set each environment variables as needed.

Let me know if there’s anything else I can help with.

Hope this helps,

-Carl

---

<div class="post-metadata">

**Author:** ![Pradeep](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/pradeep/32/479_2.png) [@Pradeep](https://discuss.blues.com/u/Pradeep)\
**Post date:** [September 17, 2022, 4:30am UTC](https://discuss.blues.com/t/blues-mqtt-setup-with-qubitro/992/3 "2022-09-17T04:30:09Z")

</div>

Hi @Carl-Henderson,

It’s working and this was a perfect clear-cut answer 💯, thanks.

Regards,  
Pradeep S.
