Beaglebone Black/Mosquitto

From Teknologisk videncenter
Jump to: navigation, search

Install from git

  1. apt-get update # Better safe than sorry
  2. apt-get install libssl-dev
  3. apt-get install docbook docbook-xml docbook-xsl
  4. apt-get install xsltproc
  5. apt-get install libsystemd-dev
  6. apt install libcjson1 libcjson-dev
  7. git clone https://github.com/eclipse/mosquitto.git
  8. cd mosquitto
  9. vi config.mk – set WITH_SYSTEMD:=yes
  10. make all
  11. make install
  12. adduser –system mosquitto # Bemærk det er ”-”-”system
  13. ln /usr/local/lib/libmosquitto.so.1 /usr/lib/arm-linux-gnueabihf/
  14. Da vi er på debian en systemd implementation øsnker vi at installere service under systemd
    1. (DONE)Apt-get install libsystemd-dev
    2. (DONE)vi config.mk – set WITH_SYSTEMD:=yes
    3. cp /home/debian/mosquitto/service/systemd/mosquitto.service.simple /etc/systemd/system/mosquitto.service
    4. ln /usr/local/sbin/mosquitto /usr/sbin/
    5. > /etc/mosquitto/mosquitto.conf # Opret tom config fil (se eksempel fil)
    6. systemctl enable mosquitto.service
    7. service mosquitto start
    8. service mosquitto status
    9. Genstart og se den er startet automatisk
    10. Check grundlæggende installation
    11. mosquitto –v # i en terminal (Brooker)
    12. mosquitto_sub -h localhost –t "temperatur/sommerhus/stue" # i anden terminal (client/subscriber) brug evt -d for debug (Se alle feltet)
    13. mosquitto_pub -h localhost -t "temperatur/sommerhus/stue" -m "24" # i tredje terminal (client/publisher)