[Python] Como criar uma API Flask (Python) para publicar o login de usuário via MQTT para um...

Discussão em 'Python' iniciado por Stack, Junho 12, 2025.

  1. Stack

    Stack Membro Participativo

    Olá, estou desenvolvendo um aplicativo utilizando Flutter (Dart). Preciso que, quando o usuário fizer login, as informações de login sejam publicadas em um tópico MQTT.

    Para isso, pensei em criar uma API em Flask (Python), que receba as informações do Flutter e publique esses dados no broker MQTT

    Minha dúvida é: Como criar essa API Flask que recebe o login (via HTTP POST) e publica no MQTT?

    O broker esta em outro notebook, estou acessando o IP dele.

    Hello, I’m developing an application using Flutter (Dart). I need to publish the user login data to an MQTT topic when the user logs in.

    To achieve this, I plan to create a Flask API in Python that will receive the login information from the Flutter app via HTTP POST and then publish it to the MQTT broker.

    My main question is: How can I create a Flask API that receives login data (via HTTP POST) and publishes it to an MQTT topic?

    The MQTT broker is running on another notebook in my local network. I'm accessing it via its IP address

    Github Link: https://github.com/CarinaNovais/app_smart_milk_

    Continue reading...

Compartilhe esta Página