Natywne wsparcie dla MQTT

Erek
Posts: 25
Joined: Mon Oct 24, 2022 2:10 pm

Post

pzygmunt wrote: Sun Nov 27, 2022 9:17 pm Sprawdź hasło
Jeżeli mówimy o haśle z brokera Supli to nie. Nie działa.

Wpisywane ręcznie, kopiowane...
Wpisywane przez drugą osobę...
Wpisywane na mac, na win7, na win10...

Na MQTT explorerze zadziałało po zaznaczeniu tls. Może to jakiś trop?

Proszę o informację. Pozdrawiam.
Erek
Posts: 25
Joined: Mon Oct 24, 2022 2:10 pm

Post

OK.

Zadziałało. Może się komuś przyda:
- w opcjach zaawansowanych ustawić na AUTO (przy dokonywaniu konfiguracji). Pewnie to odpowiada za tls...

Dziękuję i pozdrawiam.
Fantasta
Posts: 4
Joined: Fri Nov 18, 2022 1:17 pm

Post

Witam.

Czy ktos mogłby wskazac jakis poradnik aby spiąć MEW -01 z infludb.
Mam najnowszego Influxa na RPi i chciałbym aby zbierał wszystkie dane z MEWa.

W influxcie jest Telegraf i ma klienta MQTT Consumer
Przy konfiguracji wyskakuje przykładowa aplikacja

Może, ktoś już to uruchamiał? Ja niestety na razie nie mam pojęcia o co chodzi :P

Code: Select all

# Read metrics from MQTT topic(s)
[[inputs.mqtt_consumer]]
  ## Broker URLs for the MQTT server or cluster.  To connect to multiple
  ## clusters or standalone servers, use a separate plugin instance.
  ##   example: servers = ["tcp://localhost:1883"]
  ##            servers = ["ssl://localhost:1883"]
  ##            servers = ["ws://localhost:1883"]
  servers = ["tcp://127.0.0.1:1883"]
  ## Topics that will be subscribed to.
  topics = [
    "telegraf/host01/cpu",
    "telegraf/+/mem",
    "sensors/#",
  ]
  # topic_fields = "_/_/_/temperature"
  ## The message topic will be stored in a tag specified by this value.  If set
  ## to the empty string no topic tag will be created.
  # topic_tag = "topic"
  ## QoS policy for messages
  ##   0 = at most once
  ##   1 = at least once
  ##   2 = exactly once
  ##
  ## When using a QoS of 1 or 2, you should enable persistent_session to allow
  ## resuming unacknowledged messages.
  # qos = 0
  ## Connection timeout for initial connection in seconds
  # connection_timeout = "30s"
  ## Maximum messages to read from the broker that have not been written by an
  ## output.  For best throughput set based on the number of metrics within
  ## each message and the size of the output's metric_batch_size.
  ##
  ## For example, if each message from the queue contains 10 metrics and the
  ## output metric_batch_size is 1000, setting this to 100 will ensure that a
  ## full batch is collected and the write is triggered immediately without
  ## waiting until the next flush_interval.
  # max_undelivered_messages = 1000
  ## Persistent session disables clearing of the client session on connection.
  ## In order for this option to work you must also set client_id to identify
  ## the client.  To receive messages that arrived while the client is offline,
  ## also set the qos option to 1 or 2 and don't forget to also set the QoS when
  ## publishing.
  # persistent_session = false
  ## If unset, a random client ID will be generated.
  # client_id = ""
  ## Username and password to connect MQTT server.
  # username = "telegraf"
  # password = "metricsmetricsmetricsmetrics"
  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false
  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "influx"
  ## Enable extracting tag values from MQTT topics
  ## _ denotes an ignored entry in the topic path
  ## [[inputs.mqtt_consumer.topic_parsing]]
  ##  topic = ""
  ##  measurement = ""
  ##  tags = ""
  ##  fields = ""
  ## [inputs.mqtt_consumer.topic_parsing.types]
  ##
proxxon
Posts: 93
Joined: Wed Nov 22, 2017 2:42 pm

Post

Czy przez Suplowego brokera da się odpalać sceny? Jeżeli tak czy ktoś mógłby podać przykładowy topic?
User avatar
pzygmunt
Posts: 18356
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków

Post

Na chwilę obecną sceny nie są publikowane do MQTT.
proxxon
Posts: 93
Joined: Wed Nov 22, 2017 2:42 pm

Post

A są plany? Czy raczej zadania z ankiet mają priorytet?
User avatar
pzygmunt
Posts: 18356
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków

Post

Plany są ale priorytety inne.
https://github.com/SUPLA/supla-core/issues/327
proxxon
Posts: 93
Joined: Wed Nov 22, 2017 2:42 pm

Post

Ok, dzięki za odpowiedź.
Robię prostą bramkę ESP-NOW -> Supla Mqtt (na esp8266) i myślałem, że odpalanie światła np na 2 min zrobię sceną po stronie serwera a tak to dodam do kodu po prosu wyłączenie po 2 min ;)
Fantasta
Posts: 4
Joined: Fri Nov 18, 2022 1:17 pm

Post

Hej.
Może mi ktoś wytłumaczyć z tym MQTT?
Uruchomiłem MQTT w cloud.supla.org. Wygenerowały mi się dane.

Pobrałem MQTT Explorer na Windows. Uruchomiłem zgodnie z danymi wyżej i połączył się bez problemu. Widzę moje urządzenie, odczyty działają.

Czy to co uruchomiłem na cloud.supla.org to już jest broker? I mogę już konfigurować klienta np MQTT Consumer Telegraf Input Plugin?
Czy musze jeszcze sobie zainstalować mosquitto mqtt, tam zrobić konfigurację i dopiero klient?
User avatar
klew
Posts: 8357
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław

Post

Fantasta wrote: Tue Dec 06, 2022 7:29 pm Hej.
Może mi ktoś wytłumaczyć z tym MQTT?
Uruchomiłem MQTT w cloud.supla.org. Wygenerowały mi się dane.

Pobrałem MQTT Explorer na Windows. Uruchomiłem zgodnie z danymi wyżej i połączył się bez problemu. Widzę moje urządzenie, odczyty działają.

Czy to co uruchomiłem na cloud.supla.org to już jest broker? I mogę już konfigurować klienta np MQTT Consumer Telegraf Input Plugin?
Czy musze jeszcze sobie zainstalować mosquitto mqtt, tam zrobić konfigurację i dopiero klient?
Supla cloud udostępnia brokera mqtt
Widzimy się na Supla Offline Party vol. 2 :!:

Return to “MQTT”