Category Archives: Linux

UniFi Network Server on QNAP NAS

This Post describes, how to install the UniFi Network Server as Docker image on a QNAP NAS.

The first step is to make sure you’ve installed Container Station from the QNAP App Center.
After this, open Container Station, go to “Applications” and click “Create”.
Give your application a name, for example “unifi-and-mongodb”.
Upload this yaml-code for docker-compose, replace “UNIFIPASSWORD” with a secure password, you will use this later to configure the database:

Continue reading UniFi Network Server on QNAP NAS

Snapmaker 2.0 and Home Assistant

Did you know that it’s possible to discover your Snapmaker 2.0 in your LAN? Just send an UDP discover Broadcast to Port 20054 and your Snapmaker will reply with his IP-Address, Model-Name and Status.


Update 19.01.2024: This project got some reactions, see here: HomeAssistant-Forum and here: Snapmaker-Forum
Meanwhile I created a new Script V2 which gets more Information from the Web-API, this makes the information below obsolete.
-> See new code on github
Maybe I will try to write a HomeAssistant Integration someday….


With this function, I inform my Home Assistant about the state of my Snapmaker. Home Assistant sends me a push-message if the 3D-Print, Laser-Cut or CNC is finished.
Because I only need this information, it’s not necessary to login, get info and logout to the Snapmaker.
Maybe I will write another script in future to read other values like process, temperatures, enclosure state etc.

Here is an example of my webhook-sensors in templates.yaml: (For more details see this Link)

# Snapmaker JSON Webhook
- trigger:
    - platform: webhook
      webhook_id: wh-snapmakera350
      allowed_methods:
        - POST
        - PUT
      local_only: true
  sensor:
    - name: "Snapmaker State"
      state: "{{ trigger.json.state }}"
    - name: "Snapmaker IP"
      state: "{{ trigger.json.ip }}"
    - name: "Snapmaker Model"
      state: "{{ trigger.json.model }}"

Then download the code on github and edit the python-script to your needs.
Run it in a cronjob, I do that on a separate raspberry-pi for example every 5min.

To notify me, this is my automation:

That’s my quick and dirty solution.

Some printscreens of the HA-Dashboard:

I hope this will help you to get at least some information from your Snapmaker to Home Assistant. I still hope that we can get more information in future from an usable Snapmaker-API ūüėČ

Phoniebox

Ich habe unserer Tochter zu Weihnachten eine Phoniebox gebaut. Grunds√§tzlich findet man alle n√∂tigen Informationen auf der Webseite der Phoniebox, ich beschreibe hier rudiment√§r die Schritte die ich gemacht habe und die verwendete Hardware. Die Front wurde gefr√§st, der Rahmen vom OLED-Display mit PLA gedruckt und die Symbole gelasert, alles mit dem Snapmaker 2.0 A350. Zus√§tzlich habe ich aus einer Schublade vom Dragan eine Aufbewahrungsbox f√ľr die RFID-Karten gemacht.

Hardwareliste:

Raspberry Pi 3 Model B Rev 1.2
SanDisk 32GB SD Card
Raspberry Pi 3 GPIO expansion board
LED-Arcade Buttons (nicht verwendet)
1.3″ 4-Pin I2C OLED 128X64 mit sh1106 Controller
125kHz RFID Karten
RFID Reader EM4100/Tk400 125kHz
USB Buchse
EARU On/Off Schalter
HifiBerry MiniAMP
Pimoroni OnOff SHIM
Speedlink Twoxo Speaker
Trust Urban Primo PowerBank 10’000mAh
Dragan von IKEA
√Ėstern√§s von IKEA
EC11 Rotary Encoder als Lautstärkeregler
TTP223 Touch Sensoren als Bedienelemente
Lichtwellenleiter

Continue reading Phoniebox

Update an ESXi Host from SSH

Notes how to update a VMware ESXi host:

1. Download Patch from VMware

2. Load it on a Datastore (e.g. with scp) on the ESXi host and connect with SSH. SSH Server must be activated if it’s not already done (Host -> Manage -> Services).

3. Show version:

vmware -vl
VMware ESXi 6.5.0 (Build 4887370)
VMware ESXi 6.5.0 Update 1

3a. Optional: List all installed VIB’s:

esxcli software vib list

4. Move all VM’s to another Host or shut down, then activate Maintenance Mode:

vim-cmd hostsvc/maintenance_mode_enter

5. Start Update:

esxcli software vib update -d /vmfs/volumes/datastore1_local/patch/ESXi650-xxxxxxxxxx.zip

6. The updater will show if it’s necessary to reboot the machine.

7. Show new version:

vmware -vl
VMware ESXi 6.5.0 build-7388607
VMware ESXi 6.5.0 Update 1

8. End Maintenance mode:

vim-cmd hostsvc/maintenance_mode_exit

9. Start VM’s again.

 

vCenter Server behind NAT

Be warned: This configuration is not officially supported by VMware.

If you have your vCenter Server behind NAT, you can not connect your ESXi Host to this Server. It will loose connection after a few seconds to vCenter because vCenter publishes his private IP to the configuration of ESXi.

1. We need an port forwarding of port TCP/UDP 902 from your public IP to the internal IP of the vCenter Server. If you have a Firewall, allow connections only from the IP of your ESXi host.

2. Connect over SSH to the ESXi Host and edit vpxa.cfg with vi:

vi /etc/vmware/vpxa/vpxa.cfg

Configure the following settings:

Insert this tag, if you don’t add this tag and restart the services, it will overwrite the IP again with the private one of vCenter:

<preserveServerIp>true</preserveServerIp>

Replace the private IP of the vCenter Server with the public one:

<serverIp>PublicIPvCenterServer</serverIp>

Restart services:

/etc/init.d/hostd restart

Now the connection should stay stable.