Time Synchronization Guide

Manually Set the Time

MiixKey supports manually adjusting the system time via device settings.

Time Format Description: YYYYMMDDHHMMSS

  • 4-digit year + 2-digit month + 2-digit day + 2-digit hour + 2-digit minute + 2-digit second
  • Example: 20250730171212 means July 30, 2025, 17:12:12

Synchronize Time via Command

MiixKey can sync with your computer's current time using a script command.

Important Note:
  • The device automatically synchronizes time only once per boot.
  • For manual synchronization, use the appropriate command based on your OS.

Linux / macOS Systems

echo -n "timestamp=$(date +%s)" | nc -u -w1 172.16.8.1 22

Windows System

This is a single line command

$timestamp=[int]([System.DateTimeOffset]::UtcNow.ToUnixTimeSeconds()); $msg=[System.Text.Encoding]::ASCII.GetBytes("timestamp=$timestamp"); $udp=New-Object System.Net.Sockets.UdpClient; $udp.Send($msg, $msg.Length, '172.16.8.1',22); $udp.Close()
Note: If Windows 10 users encounter driver issues, please refer to Manually Install Driver.

Automatic Time Synchronization Script

Windows Automatic Synchronization Solution

1. Create the Main Synchronization Script

Create a new MiixKey_timesync.ps1 file with the following content:

$targetVid = "303a"
$targetPid = "0030"

while ($true) {
    $usbDevices = Get-PnpDevice -Class USB | Where-Object Status -eq "OK"
    
    foreach ($device in $usbDevices) {
        if ($device.InstanceId -like "*VID_$targetVid&PID_$targetPid*") {
            Write-Host "Target USB device detected. Waiting 10 seconds..."
            Start-Sleep -Seconds 10 # Wait 10 seconds to send the sync command

            $timestamp=[int]([System.DateTimeOffset]::UtcNow.ToUnixTimeSeconds());
            $msg=[System.Text.Encoding]::ASCII.GetBytes("timestamp=$timestamp");
            $udp=New-Object System.Net.Sockets.UdpClient;
            $udp.Send($msg, $msg.Length, '172.16.8.1', 22);
            $udp.Close()

            Write-Host "UDP command executed successfully."
            exit
        }
    }
    Start-Sleep -Seconds 5 # Check every 5 seconds for USB device connection
}

2. Create a Startup Script

Create a new MiixKey_timesync_start_hidden.vbs file:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "cmd /c powershell -ExecutionPolicy Bypass -WindowStyle Hidden -File ""MiixKey_timesync.ps1""", 0, False
Set WshShell = Nothing

3. Configure Auto-start on Boot

  1. Save the two script files in a suitable location.
  2. Right-click MiixKey_timesync_start_hidden.vbsCreate Shortcut.
  3. Press Win + R keys, type shell:startup to open the Startup folder.
  4. Place the shortcut into the Startup folder.
Result: After completing the setup and restarting the computer, the system will automatically monitor the MiixKey connection in the background, automatically synchronize the time 10 seconds after the device is detected, and exit the script after synchronization is complete.