Bruk av MQTT, igjennon HiveMQ i javascript 

https://www.hivemq.com/blog/implementing-mqtt-in-javascript/


https://www.hivemq.com/article/ultimate-guide-on-how-to-use-mqtt-with-node-js/


https://docs.hivemq.com/hivemq/latest/user-guide/getting-started.html?_gl=1*kv4bnc*_ga*NjM3MzA4NjU2LjE3MDc2NzgxNjg.*_ga_P96XGQCLE4*MTcwOTc0MDUxMi4zLjAuMTcwOTc0MDUxMi42MC4wLjA.#download


Msquitto commands: 

  1. mosquitto_sub -h 10.24.88.132 -t yes

  2. mosquitto_pub -h 10.24.88.132 -t yes -m yooooo

  3. sudo brew services start mosquitto            


  4. sudo brew services stop mosquitto            


  5. sudo pkill mosquitto 

Topic: 

Gamestate = tall (string)

Players = string med tall eks. 000001

 Variables sendt: 

playersBinary example: "10010"
playerCount example : "3"
roundnumber example : "2"

Possible variables:
- currentbet
- playersturn

MQTT package documentation: https://www.npmjs.com/package/mqtt


MQTT Explorer: https://mqtt-explorer.com/ for visualization and de-bugging.

Example with some of our topics/variables. 

Our MQTT-IP: 192.168.2.101

FInal overview of all the variables

Showcasing the gameState history of a 4 round game: 

  • No labels