source
https://github.com/maliciamrg/Bresser-Weather-Station
dns

xampp install

sudo apt update -y
sudo apt upgrade -y
wget "https://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/8.2.4/xampp-linux-x64-8.2.4-0-installer.run?use_mirror=netix&download=" -O xampp-linux-x64-8.2.4-0-installer.run
sudo ./xampp-linux-x64-8.2.4-0-installer.run
sudo usermod -aG daemon david
sudo chown -R daemon:daemon /opt/lampp/htdocs
sudo chmod g+w /opt/lampp/htdocs
result :

auto start xampp server at ubuntu startup:
sudo nano /etc/systemd/system/xampp.service
[Unit]
Description=XAMPP
[Service]
ExecStart=/opt/lampp/lampp start
ExecStop=/opt/lampp/lampp stop
Type=forking
[Install]
WantedBy=multi-user.target
sudo systemctl enable xampp.service
sudo reboot
after reboot

scripting
sudo apt update
sudo apt install php-cli unzip -y
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
HASH=`curl -sS https://composer.github.io/installer.sig`
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
cd /opt/lampp/htdocs
mkdir weatherstation
cd weatherstation
install php app
sudo git clone https://github.com/maliciamrg/Bresser-Weather-Station.git .
sudo composer require php-mqtt/client
sudo chown -R daemon:daemon /opt/lampp/htdocs
result

pfsense
in pfsense allow MQTT traffic from VLAN 10 and VLAN 20 to VLAN 30 on port 1883
, where your Mosquitto broker lives (192.212.30.105
)
✅ Steps to Add Rules in pfSense
You’ll need to add two rules — one on each VLAN interface (VLAN 10 and VLAN 20):
🔧 On VLAN 10 Interface:
- Go to pfSense Web UI → Firewall → Rules → VLAN 10
- Click “Add” rule at the top
- Set:
- Action: Pass
- Interface: VLAN 10
- Protocol: TCP
- Source: Single host or alias →
192.212.10.200
- Destination: Single host →
192.212.30.105
- Destination port range: From
1883
to1883
- Description:
Allow MQTT from VLAN 10
- Save and Apply Changes
🔧 On VLAN 20 Interface:
Repeat the same steps:
- Go to Firewall → Rules → VLAN 20
- Add rule with:
- Source:
192.212.20.250
- Destination:
192.212.30.105
- Port:
1883
- Description:
Allow MQTT from VLAN 20
- Source:
- Save and Apply Changes
🧪 Optional: Make It More Flexible
If you want any device on VLAN 10 or VLAN 20 to reach the MQTT broker, just change the source from single host
to:
- Source:
VLAN 10 net
- Source:
VLAN 20 net
That way, all devices on those VLANs can connect.
test

controle
http://192.212.20.250/weatherstation/updateweatherstation.php
