# Migration: python paho.mqtt an Node Red

**URL:** <https://www.thethingsnetwork.org/forum/t/migration-python-paho-mqtt-an-node-red/48194>\
**Category:** V3 Integrations\
**Created:** [May 29, 2021, 9:43am UTC](https://www.thethingsnetwork.org/forum/t/migration-python-paho-mqtt-an-node-red/48194 "2021-05-29T09:43:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TazFranck](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/tazfranck/32/35697_2.png) [@TazFranck](https://www.thethingsnetwork.org/forum/u/TazFranck)\
**Post date:** [May 29, 2021, 9:43am UTC](https://www.thethingsnetwork.org/forum/t/migration-python-paho-mqtt-an-node-red/48194/1 "2021-05-29T09:43:57Z")

</div>

Hi everybody,  
Sorry for my poor english, i will try to be understandable !

I’m a teacher in France and i work with young students (15 to 19 years old), i teach mechanics, computerscience and a lot of other things, so i’m not a specialist ! Last year i set up a nice activity for my students. It was simple and was working fine: This activity consisted of publishing some data (like temperature, luminosity …) from a MKR1310 (with Arduino IDE) to the ttn V2 console … and collect these data in 2 ways: python with paho.mqtt and Node-Red to build a nice HMI.

Today, i try to migrate my work to the new ttn V3. I don’t have any problem to publish data on ttn V3 with my MKR1310 … but i can’t collect these data with paho.mqtt and node-red ! I looked for a solution to my problem, but i didn’t succeed yet, so, if anyone can help me he is welcome !

1: paho.mqtt with python  
I need three parameters at the beginning of my code:  
APPEUI = ‘70B3D5xxxxx14BD4’  
APPID = ‘the\_name\_of\_my\_app’  
PSW = ‘ttn-account-v2.xXxXxXxXxXxXxXxX2xK0isQ6cUSp8’

I thinks it’s ok for the APPEUI en APPID, i’ve find them in the ttn v3 console, but i don’t know how to find the PWD (it’s the ACCESS KEY in ttn v2 console).

2: Node-Red  
I think it’s the same problem, i don’t know wich password i have to set in the security panel of the “mqtt-broker node” . Currently, Node-red can’t connect to ttn !

Thanks for your help ! If it’s necessary, i can send you the entire code to help me (python & Node-red).  
I keep on searching a solution …

Franck.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [May 29, 2021, 9:57am UTC](https://www.thethingsnetwork.org/forum/t/migration-python-paho-mqtt-an-node-red/48194/2 "2021-05-29T09:57:30Z")

</div>

Here’s the Python solved for you:

> **[descartes/TheThingsStack-Integration-Starters](https://github.com/descartes/TheThingsStack-Integration-Starters/tree/main/MQTT-to-Tab-Python3)**
>
> main/MQTT-to-Tab-Python3

The user name is YOUR\_USER\_NAME@ttn - example highlighted in blue below.

In v3 the MQTT integration page will show you this and there is a big blue button to generate the API key which is the **password**.

![Screenshot 2021-05-29 at 10.56.07](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/a/f/af819af123cd098471d0a7625232a9a22f41282b.png)

You should be able to use the same credentials for Node-Red.

---

<div class="post-metadata">

**Author:** ![TazFranck](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/tazfranck/32/35697_2.png) [@TazFranck](https://www.thethingsnetwork.org/forum/u/TazFranck)\
**Post date:** [May 29, 2021, 10:59am UTC](https://www.thethingsnetwork.org/forum/t/migration-python-paho-mqtt-an-node-red/48194/3 "2021-05-29T10:59:51Z")

</div>

Thank you !

“@ttn” was missing … i tried it but it wasn’t working either … because my “password” was wrong too !  
I had generated a new “API key” but didn’t copy it immediatly. I copied the API key from “Go To API keys” wich is different !

So now i have downloaded the certificate for TLS, and i can see my python app and my Node-red app connecting in the ttn V3 console. I can collect the data from the whole of my application (#) with python and Node-red, and now i will update my code to decode the JSON.

Thank you again for your help.

Franck.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [May 29, 2021, 2:20pm UTC](https://www.thethingsnetwork.org/forum/t/migration-python-paho-mqtt-an-node-red/48194/4 "2021-05-29T14:20:00Z")

</div>

> [@TazFranck](#):
>
> I copied the API key from “Go To API keys” wich is different !

That, for anyone else reading along, is the API ID, the one you can use to manage the API Key with using the API for keys …

It is categorically NOT the API Key aka the Password - you get one chance to see / copy that and then, poof, it’s gone in some magic smoke with, presumably, some sort of hash held in the TTS database.

---

<div class="post-metadata">

**Author:** ![system](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/6/2/6250ea44fd2b0d6259489e1a92748df681e1f970.png) [@system](https://www.thethingsnetwork.org/forum/u/system)\
**Post date:** [May 30, 2021, 2:20pm UTC](https://www.thethingsnetwork.org/forum/t/migration-python-paho-mqtt-an-node-red/48194/5 "2021-05-30T14:20:53Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
