^^Mosquitto: Eclipse MQTT server.

https://mosquitto.org/

 

  1. How to Install The Mosquitto MQTT Broker on Windows
    http://www.steves-internet-guide.com/install-mosquitto-broker/
  2. Quick Guide to The Mosquitto.conf File With Examples
    http://www.steves-internet-guide.com/mossquitto-conf-file/
  3. Mosquitto Username and Password Authentication -Configuration and Testing
    http://www.steves-internet-guide.com/mqtt-username-password-example/
  4. Using The Mosquitto_pub and Mosquitto_sub MQTT Client Tools- Examples
    http://www.steves-internet-guide.com/mosquitto_pub-sub-clients/
  5. How can I monitor the TCP traffic to a port for a given IP?
    Wireshark.

 

mosquitto avviato da riga di comando

1a volta: chiediamo help

mosquitto -h

2a volta: modalita' verbosa, per avere info

mosquitto -v

1675252580: mosquitto version 2.0.15 starting
1675252580: Using default config.
1675252580: Starting in local only mode. Connections will only be possible from clients running on this machine.
1675252580: Create a configuration file which defines a listener to allow remote access.
1675252580: For more details see https://mosquitto.org/documentation/authentication-methods/
1675252580: Opening ipv4 listen socket on port 1883.
1675252580: Opening ipv6 listen socket on port 1883.
1675252580: mosquitto version 2.0.15 running

 

E' avviato in "local mode", invece noi vogliamo ricevere dalla rete.

Dobbiamo configurare, creando un file di configurazione.

 

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:80             aa:0                   LISTENING [httpd.exe]
  TCP    0.0.0.0:135            aa:0                   LISTENING  RpcSs [svchost.exe]
  TCP    0.0.0.0:445            aa:0                   LISTENING Can not obtain ownership information
  TCP    0.0.0.0:34176          aa:0                   LISTENING [hsmysqld.exe]
  TCP    0.0.0.0:49667          aa:0                   LISTENING [spoolsv.exe]
  TCP    127.0.0.1:1883         aa:0                   LISTENING [mosquitto.exe]
  TCP    127.0.0.1:3306         aa:0                   LISTENING [mysqld.exe]
ecc...

 

 

C:\> netstat -h  

-a    Displays all connections and listening ports.
-b    Displays the executable involved in creating each connection or listening port.
In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.

ecc ...

To have permission you: 1) must be admin  2) run cmd  terminating with "ctrl+shift+enter", not only with "enter"

 

C:\> netstat -a -b
  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:80             aa:0                   LISTENING [httpd.exe]
  TCP    0.0.0.0:135            aa:0                   LISTENING RpcSs [svchost.exe]
  TCP    0.0.0.0:443            aa:0                   LISTENING [httpd.exe]
  TCP    0.0.0.0:445            aa:0                   LISTENING Can not obtain ownership information
  TCP    0.0.0.0:554            aa:0                   LISTENING [wmpnetwk.exe]
  TCP    0.0.0.0:1883           aa:0                   LISTENING [mosquitto.exe]
  ecc ...

 

Se un firewall e' attivo, si dovrebbe presentare, poiche' moschitto non e' ancora stato iscritto alla sua lista di eccezioni, per poter usare le porte.

Lanciamo il server:  >mosquitto -v -c mosquitto.conf

1675254240: mosquitto version 2.0.15 starting
1675254240: Config loaded from mosquitto.conf.
1675254240: Opening ipv6 listen socket on port 1883.
1675254240: Opening ipv4 listen socket on port 1883.
1675254240: mosquitto version 2.0.15 running


1675260939: New connection from ::1:54738 on port 1883.
1675260939: New client connected from ::1:54738 as auto-8A98A909-A7F4-D20C-1D39-99D9F00C92EB (p2, c1, k60).
1675260939: No will message specified.
1675260939: Sending CONNACK to auto-8A98A909-A7F4-D20C-1D39-99D9F00C92EB (0, 0)
1675260939: Received SUBSCRIBE from auto-8A98A909-A7F4-D20C-1D39-99D9F00C92EB
1675260939: test/topic (QoS 0)
1675260939: auto-8A98A909-A7F4-D20C-1D39-99D9F00C92EB 0 test/topic
1675260939: Sending SUBACK to auto-8A98A909-A7F4-D20C-1D39-99D9F00C92EB
1675260999: Received PINGREQ from auto-8A98A909-A7F4-D20C-1D39-99D9F00C92EB
1675260999: Sending PINGRESP to auto-8A98A909-A7F4-D20C-1D39-99D9F00C92EB
1675261059: Received PINGREQ from auto-8A98A909-A7F4-D20C-1D39-99D9F00C92EB
1675261059: Sending PINGRESP to auto-8A98A909-A7F4-D20C-1D39-99D9F00C92EB

 

 

Links

Tasmota. Trasmit asm over the air.

TLS https://en.wikipedia.org/wiki/Transport_Layer_Security