Create a test query that summarizes the data that needs to be stored in the downsampled data:
SELECT mean("current_delivery") as "current_delivery", mean("current_usage") as "current_usage", last("total_usage_gas") as "total_usage_gas", last("total_usage_t1") as "total_usage_t1", last("total_usage_t2") as "total_usage_t2", last("total_delivery_t1") as "total_delivery_t1", last("total_delivery_t2") as "total_delivery_t2" FROM energy_p1_actual GROUP BY "name", time(1h) ORDER BY time DESC LIMIT 10
Then, define a continuous query from this:
CREATE CONTINUOUS QUERY "cq_60m" on "P1_External" BEGIN SELECT mean("current_delivery") as "current_delivery", mean("current_usage") as "current_usage", last("total_usage_gas") as "total_usage_gas", last("total_usage_t1") as "total_usage_t1", last("total_usage_t2") as "total_usage_t2", last("total_delivery_t1") as "total_delivery_t1", last("total_delivery_t2") as "total_delivery_t2" INTO "2yr"."energy_p1_history" FROM energy_p1_actual GROUP BY "name", time(1h) END
As our retention policy is set to 2 hours the continuous query will run every two hours to summarize the data.
I’m using Proxmox as a hypervisor to run my virtual machines and use two VLANs in my home network: one for normal traffic and one separate VLAN for IoT traffic. Virtual machines should be connected to one of those networks. The normal network is typically untagged (vlan ID 20) while the IoT traffic is tagged with VLAN 21.
Configuration file: /etc/network/interfaces
iface lo inet loopback
iface eno1 inet manual
iface vmbr0 inet manual
iface vmbr0.20 inet static
This should result in the following Proxmox network configuration:
Now you can easily add a network adapter to a virtual machine and tag it with the correct VLAN.
I’m still used to using the “small icons” and “never combine” options in the taskbar. It makes it more productive to navigate through different application instances. Microsoft removed these options from Windows 11, but there is a way to get them back.
Download and install ExplorerPatcher and your taskbar will look and behave like the Windows 10 taskbar.
set interfaces fe-0/0/0 flexible-vlan-tagging
set interfaces fe-0/0/0 unit 0 vlan-id 20
set interfaces fe-0/0/0 unit 0 family ethernet-switching port-mode trunk
set interfaces fe-0/0/0 unit 0 family ethernet-switching vlan members tagged_vlan
set interfaces fe-0/0/0 unit 0 family ethernet-switching native-vlan-id 20
set interfaces vlan unit 21 family inet address 192.168.x.2/24
Assign the vlan interface to a vlan :
set vlans vlan_name vlan-id 21
set vlans vlan_name l3-interface vlan.21
Assign the vlan to a physical interface:
set interfaces fe-0/0/0 unit 0 family ethernet-switching vlan members vlan_name
Assign the dhcp-local-server service to the vlan interface:
set system services dhcp-local-server group IoT interface vlan.21
Create the DHCP pool:
set access address-assignment pool Verhaeg_IoT family inet network 192.168.x.0/24
set access address-assignment pool Verhaeg_IoT family inet range r1 low 192.168.x.200
set access address-assignment pool Verhaeg_IoT family inet range r1 high 192.168.x.250
set access address-assignment pool Verhaeg_IoT family inet dhcp-attributes name-server 192.168.x.1
set access address-assignment pool Verhaeg_IoT family inet dhcp-attributes name-server 126.96.36.199
set access address-assignment pool Verhaeg_IoT family inet dhcp-attributes name-server 188.8.131.52
set access address-assignment pool Verhaeg_IoT family inet dhcp-attributes router 192.168.x.1
Don’t forget your security zone to allow dhcp traffic:
set security-zone x interfaces vlan.20 host-inbound-traffic system-services dhcp
Validate clients have received an IP address from the DHCP server:
root@ROU-02> show dhcp server binding
IP address Session Id Hardware address Expires State Interface
192.168.x.201 2 b6:54:ca:26:51:ae 70785 BOUND vlan.21
192.168.x.202 3 c8:34:8e:5f:a4:2d 85932 BOUND vlan.21
Eclipse Mosquitto is an open source (EPL/EDL licensed) message broker that implements the MQTT protocol versions 5.0, 3.1.1 and 3.1. Mosquitto is lightweight and is suitable for use on all devices from low power single board computers to full servers. The MQTT protocol provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for Internet of Things messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers. The Mosquitto project also provides a C library for implementing MQTT clients, and the very popular mosquitto_pub and mosquitto_sub command line MQTT clients. Mosquitto is part of the Eclipse Foundation, is an iot.eclipse.org project and is sponsored by cedalo.com.
mosquitto_passwd -c <password file> <username>
kill -HUP <process id of mosquitto>
Result in /var/log/mosquitto/mosquitto.log:
1636747458: New connection from x.x.x.x:59620 on port 1883.
1636747458: New client connected from x.x.x.x:59620 as y (p2, c1, k60, u'client').
1636747843: New connection from x.x.x.x:5709 on port 1883.
1636747843: New client connected from x.x.x.x:5709 as z (p2, c0, k60, u'client').
You can easily back-up and restore the ArangoDB database from Windows. All you need is WinSCP, Putty, and some diskspace. I’m running the batch script below every time I login to my workstation automatically to backup the configuration database:
You can restore the database by installing ArangoDB on another system and copying the data back into the correct directory. Make sure you stop the ArangoDB service before you restore the data.
When the ArangoDB version on the target system is newer then the ArangoDB version on the source system you need to upgrade the database first. Stop the ArangoDB service and start it in the console with the –database.auto-upgrade parameter:
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.