Add Weather Station

source

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

dns

xampp install

xamp server
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:

  1. Go to pfSense Web UIFirewall → Rules → VLAN 10
  2. Click “Add” rule at the top
  3. 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 to 1883
    • Description: Allow MQTT from VLAN 10
  4. Save and Apply Changes

🔧 On VLAN 20 Interface:

Repeat the same steps:

  1. Go to Firewall → Rules → VLAN 20
  2. Add rule with:
    • Source: 192.212.20.250
    • Destination: 192.212.30.105
    • Port: 1883
    • Description: Allow MQTT from VLAN 20
  3. 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

http://192.212.20.250/weatherstation/updateweatherstation.php?ID=IANTON13&PASSWORD=nY2hD3eO&action=updateraww&realtime=1&rtfreq=5&dateutc=now&baromin=29.91&tempf=75.9&dewptf=60.4&humidity=59&windspeedmph=3.5&windgustmph=4.0&winddir=45&rainin=0.0&dailyrainin=0.0&indoortempf=81.1&indoorhumidity=53

controle

http://192.212.20.250/weatherstation/updateweatherstation.php