User Tools

Site Tools


packet:bpqmonweb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
packet:bpqmonweb [2025/04/12 21:10] m0mzfpacket:bpqmonweb [2025/04/13 00:13] (current) m0mzf
Line 1: Line 1:
 ===== Tom 2E0JJI's bpqmonweb ===== ===== Tom 2E0JJI's bpqmonweb =====
-Tom has created a superb web application to monitor a BPQ or Xrouter node. This involves installing a web server, installing an MQTT brokerand configuring the whole lot. This is on a Pi running Raspberry Pi OS 12 - let's start with installing the required packages:+Tom has created a superb web application to monitor a BPQ or Xrouter node.  
 + 
 +{{:packet:bqmon.png?nolink&956}} 
 + 
 +This involves installing a web server MQTT broker and configuring the whole lot. This is on a Pi running Raspberry Pi OS 12 - let's start with installing the required packages:
  
 <code> sudo apt install -y git nginx mosquitto </code> <code> sudo apt install -y git nginx mosquitto </code>
  
-Grab Tom's repository and copying everything into the web server+Grab Tom's repository and copy everything into the web server
  
 <code> <code>
Line 11: Line 15:
 cd ~/src/bpqmonweb cd ~/src/bpqmonweb
 sudo rm /etc/nginx/sites-enabled/default sudo rm /etc/nginx/sites-enabled/default
-sudo cp nginx/nginx.conf /etc/nginx/sites-available/bpqmonweb+sudo cp nginx/nginx.conf /etc/nginx/sites-enabled/bpqmonweb
 sudo cp *.html /usr/share/nginx/html/ sudo cp *.html /usr/share/nginx/html/
 sudo cp *.css /usr/share/nginx/html/ sudo cp *.css /usr/share/nginx/html/
 sudo cp *.js /usr/share/nginx/html/ sudo cp *.js /usr/share/nginx/html/
-sudo systemctl restart nginx.service 
 </code> </code>
  
-Now we need to add an entry to our hosts file so the nginx proxy knows where mosquitto is located on the network+Now we need to add an entry to our hosts file so the nginx proxy knows where mosquitto is located on the network; this is already set in the nginx config so it's cleaner to add it here rather than edit the files pulled from git
 <code>echo "127.0.0.1 mosquitto" | sudo tee -a /etc/hosts</code> <code>echo "127.0.0.1 mosquitto" | sudo tee -a /etc/hosts</code>
  
-Thenwe need to set up mosquitto users - replace the supersecretbpqmqttpassword with something "secret" so other people can't publish to your MQTT server!+Then we need to set up mosquitto users - replace the supersecretbpqmqttpassword with something "secret" so other people can't publish to your MQTT server!
 <code> <code>
-echo "bpquser:supersecretbpqmqttpassword" | sudo tee /etc/mosquitto/bpqpasswd+echo "linbpquser:supersecretbpqmqttpassword" | sudo tee /etc/mosquitto/bpqpasswd
 echo "bpqmonweb:bpqmonweb" | sudo tee /etc/mosquitto/webpasswd echo "bpqmonweb:bpqmonweb" | sudo tee /etc/mosquitto/webpasswd
 sudo mosquitto_passwd -U /etc/mosquitto/bpqpasswd sudo mosquitto_passwd -U /etc/mosquitto/bpqpasswd
Line 42: Line 45:
 acl_file /etc/mosquitto/webaclfile acl_file /etc/mosquitto/webaclfile
 allow_anonymous false' | sudo tee /etc/mosquitto/conf.d/bpqmonweb.conf allow_anonymous false' | sudo tee /etc/mosquitto/conf.d/bpqmonweb.conf
 +</code>
  
 +and create an access control list so publishing to the publicly-available user can only read the topic
 +<code>
 +echo 'user bpqmonweb
 +topic read PACKETNODE/ax25/trace/bpqformat/#' | sudo tee /etc/mosquitto/webaclfile
 +</code>
 +
 +Now we need to tell LinBPQ to publish to the MQTT broker; add the following lines to your /etc/bpq32.cfg
 +Remember to use the super secret password you created above; the hostname "mosquitto" is resolved from /etc/hosts
 +<code>
 +MQTT=1
 +MQTT_HOST=mosquitto
 +MQTT_PORT=1883
 +MQTT_USER=linbpquser
 +MQTT_PASS=supersecretbpqmqttpassword
 +</code>
 +
 +then restart all the services we've tinkered with
 +<code>
 sudo systemctl restart mosquitto.service sudo systemctl restart mosquitto.service
 +sudo systemctl restart linbpq.service
 +sudo systemctl restart nginx.service
 </code> </code>
  
 +Now you can access the web server and watch the packet racket!
 +<code> http://your.pi.ip.address </code>
  
packet/bpqmonweb.1744492219.txt.gz · Last modified: 2025/04/12 21:10 by m0mzf