The broker used was mosquitto. It was easy to implement since we had done it in øving 9. 

  • Download Mosquitto from https://mosquitto.org/download/ where I chose  mosquitto-2.0.18a-install-windows-x64.exe
  • The file was extracted and the path was created so that it was easy to find
  • The conf file was changed so that the port number was specified. Mosquitto broker has a default port which is 1883
    • The conf file had 2 things change
      • 1) #listener was commented out and changed to listener 1883, this specifies that the broke needs to listen at this specific port
      • 2) #allow anonymous false was commented out and change to allow anonymous true, this lets any device with an IP address connect with the broker so it is not limited to specific IP addresses. This was done for scalability if needed. 
      • This video gave a good overview of the setup https://www.youtube.com/watch?v=hyJhKWhxAxA
  • The new port was added to the firewall so that it doesn't block the network connection. This is for security
  • To start up the Mosquitto broker, the command net start mosquitto was used, this starts all the Mosquitto files so the configuration file doesn't need to be started separately. To verify it's working services can be used to check. Similarly to stop the broker the command net stop mosquitto was used. To find any problems netstat osquitto can be used to find specific information. These commands must be run in command prompt and administrator
  • Once the broker was up and running, to check if it was working a simple pub and sub from øving 9 was used. 
    •  mosquitto_pub -t test_sensor_data -h localhost -m "100"

    •  mosquitto_sub -t test_sensor_data -h localhost
  • In this case the IP address was "158.38.140.104", since we used another router the IP address differs depending on the internet you are connected to. This IP address is for the new router that we implemented. 
  • So far only the command prompt was used to check the publishing and subscribing

  • No labels