Hexa's Blog

Các vấn đề và cách khắc phục trên máy in 3D Creality K1 Max?

10/04/2025 @ Saigon 3D Print

Xin chào, tôi đã sở hữu chiếc máy in 3D nhãn hiệu K1 Max được gần một năm. Đây là một chiếc máy in tuyệt vời, tuy nhiên tin tôi đi, nếu bạn không may mắn, chiếc máy này sẽ hành bạn ra trò đấy. Tôi bị nó hành!

Vấn đề 1. Bàn cong vênh và nghiêng (bed mesh)

Nếu bạn chỉ in mỗi cái thuyền - 3DBenchy đi kèm theo máy thì sẽ chả sao đâu. Các vấn đề tôi gặp là khi in với bề mặt sàn lớn.

Nói một cách đơn giản hơn, việc có một lớp nhựa đầu tiên mới diện tích 25cm x 25cm là điều không khả thi. Thực sự tệ hại! Đây chính là vấn đề đầu tiên!

Tôi thực sự ghét điều này! Tôi đã kỳ vọng rất nhiều ở K1 Max!

[1] Nhìn mà xem, chán đời!
[1] Nhìn mà xem, chán đời!

Để giải quyết vấn đề này, chúng ta cần hiểu cơ cấu một chút. Có 2 bộ phần:

  • Bàn gia nhiệt, nó đơn giản là tấm kim loại có dây mai xo bên dưới, tấm này có gắn lớp nam châm để gắn với bàn in. Tấm này bị cong vênh khi gia nhiệt, thậm chí, độ cong vênh còn thay đổi theo thời gian.
  • Giá đỡ tấm kim loại mà tôi đề cập bên trên. Cái giá đỡ này khi lắp ráp vào ty ren trục Z, nó được lắp không đều khiến khi bàn bị nghiêng.
[4] Cơ cấu bàn gia nhiệt - heat bed
[4] Cơ cấu bàn gia nhiệt - heat bed

Cách giải quyết như sau:

  • Sử dụng bàn kính Glass Bed 310x320x4mm . Thứ này sẽ giúp khắc phục sự cong vênh của bàn gia nhiệt.
  • Đệm cân bàn silicon giảm chấn - cao bằng nhau 16mm
  • Bộ lò xo + ốc cân bàn M4. Thứ này kết hợp với đệm silicon giảm chấn giúp khắc phục độ chênh ở ty ren trục Z.
[5] Bàn kính - 310x320x4mm
[5] Bàn kính - 310x320x4mm
[6] Đệm cân bàn Silicone giảm chấn cho máy In 3D - cao 16mm
[6] Đệm cân bàn Silicone giảm chấn cho máy In 3D - cao 16mm
[7] Bộ lò xo ốc cân bàn M4 núm hoa
[7] Bộ lò xo ốc cân bàn M4 núm hoa

Vấn đề 2. Tắc nhựa trong bộ phận kéo nhựa (extruder)

Vấn đề thứ hai là tắc nhựa, Trong quá trình sử dụng bộ phận phun nhựa(extruder) có hiện tượng bị tắc nhựa, nhựa không thể đùn xuống vòi phun được. Anh em trên reddit hay gọi là heat creep, jams, clogs. Nhiệt năng từ động cơ, truyền vào bánh răng đang kéo nhựa bên trong, hệ quả là chỗ nhựa tiếp xúc với bánh răng kéo nhựa bị mềm ra, sau cùng không đùn nhựa xuống được.

[2] Động cơ kéo nhựa không được làm mát tốt.
[2] Động cơ kéo nhựa không được làm mát tốt.
[3] Bên trong bộ đùn nhựa.
[3] Bên trong bộ đùn nhựa.

Cách giải quyết:

  • Mở nắp máy in 3D khi in chất liệu PLA
  • Giảm dòng điện cấp cho động cơ kéo nhựa, từ 0.55 amp xuống 0.45 amp. file printer.cfg
  • Lắp lá tản nhiệt để làm mát động cơ
[9] Giảm dòng điện của động cơ.
[9] Giảm dòng điện của động cơ.
[8] Tản nhiệt cho động cơ
[8] Tản nhiệt cho động cơ

Vấn đề 3. Tắc nhựa trong mũi (nozzle)

Ở thời điểm tôi mua máy, vòi phun của tôi là unicorn nozzle, loại mới nhất của Creality.

Vấn đề này sau khi vấn đề số tắc nhựa trong bộ phần kéo nhựa xảy ra. Có khả năng là nhựa trong đầu phun khi làm nóng quá lâu, biến chất, làm thô bề mặt trong đầu phun nhựa.

Để khắc phục vấn đề này, tôi hiện tại đang dùng đầu phun 0.6mm thay cho mũi bán kèm theo máy là 0.4mm

[10] Vòi phun 0.6mm
[10] Vòi phun 0.6mm

Vấn đề 4. Ánh sáng yếu

Vấn đề thứ ba là ánh sáng, hệ thống ánh sáng của K1 Max phục vụ cho cái camera của nó chứ không phục vụ cho người xem trực tiếp. Ánh sáng khá là tối so với nhu cầu của tôi.

Giải pháp cho vấn đề này xem ở đây: A new lightning system for K1 Max

[11] Thêm đèn LED 12V
[11] Thêm đèn LED 12V

Trích Dẫn và Nguồn gốc

XMRig: FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW

08/04/2025 @ Saigon Mining Rig

This post is all about resolve MSR error while running XMRig on Linux and Window.

Error: FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW

 * ABOUT        XMRig/6.22.2 gcc/13.2.1 (built for Linux x86-64, 64 bit)
 * LIBS         libuv/1.49.2 OpenSSL/3.0.15 hwloc/2.11.2
 * HUGE PAGES   supported
 * 1GB PAGES    supported
 * CPU          AMD Ryzen 9 7950X3D 16-Core Processor (1) 64-bit AES
                L2:16.0 MB L3:128.0 MB 16C/32T NUMA:1
 * MEMORY       6.8/30.5 GB (22%)
                DIMMA1: <empty>
                DIMMA2: 16 GB DDR5 @ 6000 MHz F5-6000J3038F16G
                DIMMB1: <empty>
                DIMMB2: 16 GB DDR5 @ 6000 MHz F5-6000J3038F16G
 * MOTHERBOARD  Micro-Star International Co., Ltd. - MAG B650 TOMAHAWK WIFI (MS-7D75)
 * DONATE       1%
 * ASSEMBLY     auto:ryzen
 * POOL #1      pool.hashvault.pro:443 coin Monero
 * COMMANDS     hashrate, pause, resume, results, connection
 * HTTP API     0.0.0.0:8080
[2025-04-08 00:19:57.673]  net      use pool pool.hashvault.pro:443 TLSv1.3 157.20.104.252
[2025-04-08 00:19:57.673]  net      fingerprint (SHA-256): "420c7850e09b7c0bdcf748a7da9eb3647daf8515718f36d9ccfdd6b9ff834b14"
[2025-04-08 00:19:57.673]  net      new job from pool.hashvault.pro:443 diff 72000 algo rx/0 height 3384982 (124 tx)
[2025-04-08 00:19:57.673]  cpu      use argon2 implementation AVX-512F
[2025-04-08 00:19:57.673]  msr      cannot set MSR 0xc0011020 to 0x0004400000000000
[2025-04-08 00:19:57.673]  msr      FAILED TO APPLY MSR MOD, HASHRATE WILL BE LOW   <<-------------------- ERROR HERE
[2025-04-08 00:19:57.673]  randomx  init dataset algo rx/0 (32 threads) seed fbd882390916fe90...
[2025-04-08 00:19:57.782]  randomx  allocated 3072 MB (2080+256) huge pages 100% 3/3 +JIT (109 ms)
[2025-04-08 00:19:58.896]  randomx  dataset ready (1114 ms)

For Linux, I test it with Fedora 41.

  • Run as sudo
  • Disable Secure Boot in BIOS
  • Turn off Intel Virtualization Technology, on MSI Motherboard, Bios Click 5 dashboard, its name is SVM (Overlocking >> Advanced CPU Configuration >> SVM mode)

For Window, I did not test, but the concept is the same.

  • Run as administrator (Window)
  • Disable Secure Boot in BIOS
  • Turn off Intel Virtualization Technology in BIOS, on MSI Motherboard, Bios Click 5 dashboard, its name is SVM (Overlocking >> Advanced CPU Configuration >> SVM mode)
  • Turn off core isolation (Window)
  • Turn off memory integrety (Window)

What is screen size of BPhone B86

05/04/2025 @ Saigon etc

The screen size of Bphone B86 is 424 x 800px (width x height).

You can check any device with this web tool - viewportsizer.com-What is my screen size?

BPhone B86 - 424 x 800px
BPhone B86 - 424 x 800px

Personal note: Installing a Beam fullnode

30/03/2025 @ Saigon Cryptocurrency Node

I. Systemctl service /etc/systemd/system/beam.service

[Unit]
Description=Beam Node
Requires=network.target

[Service]
WorkingDirectory=/opt/beam-node-7.5.13882/
ExecStart=/opt/beam-node-7.5.13882/beam-node --config_file=/opt/beam-node-7.5.13882/beam-node.cfg
User=nguyenvinhlinh
RemainAfterExit=yes
Restart=on-failure
RestartSec=10
TimeoutStopSec=180

[Install]
WantedBy=multi-user.target#

II. Firewall-cmd service - /etc/firewalld/services/beam.xml

<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>Beam</short>
  <description>
    P2P: 10000
  </description>
  <port protocol="tcp" port="10000"/>
  <port protocol="udp" port="10000"/>
</service>

III. Beam node config - /opt/beam-node-7.5.13882/beam-node.cfg

################################################################################
# General options:
################################################################################

# port to start server on
port=10000

# log level [info|debug|verbose]
log_level=debug

# file log level [info|debug|verbose]
file_log_level=debug

# old logs cleanup period (days)
log_cleanup_days=5

################################################################################
# Node options:
################################################################################

# node storage path
storage=/opt/beam-node-7.5.13882/data/node.db
network=mainnet

# nodes to connect to
peer=eu-nodes.mainnet.beam.mw:8100
peer=us-nodes.mainnet.beam.mw:8100

# port to start stratum server on
# stratum_port=0

# path to stratum server api keys file, and tls certificate and private key
# stratum_secrets_path=.

# Enforce re-synchronization (soft reset)
# resync=0

# Owner viewer key
# owner_key=

# Standalone miner key
# miner_key=

# password for keys
# pass

# Fork1 height
# Fork1=

# Path to treasury for testing
# treasury_path=

Lắp ráp hệ thống xịt rửa cho sân vườn.

28/03/2025 @ Saigon Projects

Hey hey hey, chào buổi sáng Việt Nam.

Tôi đã lên kế hoạch lắp ráp hệ thống xịt rửa cho sân thượng được một thời gian rồi. Tuy nhiên, mọi việc cứ trôi đi do bận rộn với dự án quản lý dàn đào tiền mã hóa. Đến hôm nay, 27/3/2025 tôi mới có thể thực hiện được với sự giúp đỡ của hai người em trai.

Cảm nhận đầu tiền sau khi sử dụng là nước hơi hơi yếu, cơ mà dùng một lúc thì nó cũng quen, bây giờ thì tôi thấy khá là ổn, vừa phải. Thực ra vệ sinh sân vườn với cái máy bơm tăng áp này là vừa phải, bên cạnh đó nó cũng góp phần tiết kiệm nước. Tôi thích điều này.

Còn gì thích hơn việc mình làm điều mình yêu, và yêu điều mình làm.

[1] Lắp ráp thử nghiệm
[1] Lắp ráp thử nghiệm

Chi phí cho dự án nhỏ này như sau:

Miêu tả Giá tiền
[1] Bộ bơm tăng áp 560,000
++ Bơm tăng áp 12V Sinleader TH2203 96W  
++ Nguồn 12V  
++ Lọc rác  
++ Vòi xịt rửa xe tăng áp  
++ Ống đây áp lực PU 12mm 6m  
++ Tiền ship bên boba.vn 25,000
[2] Thêm 3m ống dây 36,000
[3] Tủ điện ngoài trời 231,200
++ Tiền ship shopee 20,700
[4] Vít nở 6mm x 10 2,000
[5] Dây điện đôi 0.75mm, 3m dây 24,000
[6] Phích cắm 10,000
[7] Mũi khoan tháp 175,000
Tổng cộng 1,083,900

Để khoan 2 cái lỗ tròn cho dây nước vào và ra, tôi buộc lòng phải mua mũi khoan tháp của shop MR.DIY. Họ bán một bộ 3 mũi khoan tháp là 175,000 VND. Tính ra, mỗi lỗ khoan, có giá trị là hơn 85,000. Đây là những cái lỗ đắt nhất mà tôi từng phải khoan.

Lúc đang chưa có việc làm, mấy thứ tốn tiền hay xảy ra!

Trò đời nó hay thế lắm, nhưng tội cái, tôi lại yêu một cái lỗ hoàn hảo.

[2] 3 mũi khoan tháp với giá 175,000
[2] 3 mũi khoan tháp với giá 175,000

Và còn đây là kết quả, thực sự rất hài lòng.

[3] Thùng điện gắn ngoài trời
[3] Thùng điện gắn ngoài trời
[4] Vòi nước tăng áp này ổn phết. 7/10 điểm
[4] Vòi nước tăng áp này ổn phết. 7/10 điểm

Đặc biệt là cái máy bơm này nó có cảm biến hay sao ý, khi mà tôi khóa nước ở vòi tăng áp, động cơ nó tự động ngắt. Khá là thú vị. Tôi chắc chắn sẽ tìm hiểu cái này.

Lời kết: Cá nhân tôi, tôi nghĩ rằng sẽ tuyệt hơn nếu mà có hệ thống vệ sinh thụ động, ví dụ là hệ thống nước bao xung quanh sân.

Ấn nút là nó xả nước đẩy sân. Tôi chỉ cần gạt nước đi là xong. Kết thúc câu chuyện.

Và, con đường OVER ENGINEER chả bao giờ kết thúc cả.

Cách lưu trữ với tar command

27/03/2025 @ Saigon cheatsheet

Xin chào, khi tôi quyết định viết bài này, tôi buộc lòng phải thừa nhận, tôi không thể nhớ command cũng như các tham số của tar. Bài viết này là dành cho tôi, xem lại sử dụng lệnh tar.

1. Cách tạo lưu trữ (archive) và nén

$ tar -cJvf file_name.tar.xz directory_full_path

Giải thích các tham số:

  • -c: tạo archive‌/lưu trữ
  • -J: nén với định dạng xz, mục đích của nó là giảm dung lượng file lưu trữ. Không có cũng được.
  • -v: verbose, hiện thông tin chi tíết khi chạy lệnh. Không có cũng được.
  • -f: tên file file_name.tar.xz

2. Cách mở lưu trữ (extract)

$ tar -xvf file_name.tar.xz

Giải thích các tham số:

  • -x: extract, mở lưu trữ
  • -v: verbose, hiện thông tin chi tíết khi chạy lệnh. Không có cũng được.
  • -f: tên file file_name.tar.xz

3. References

How to copy files from docker build to host machine?

27/03/2025 @ Saigon etc

This guide is all about copy/extract file from docker build process, then copy it to host machine.

This method is very useful when you have to release/package .rpm file for further usage, but in this post, I will use mkdocs for example, I build mkdocs html files with docker, then copy those html files to host machine.

There are two things to consider:

  • Dockerfile
  • And Build Command for that Dockerfile

I. Dockerfile

The key note is line number 8 and 9

1
2
3
4
5
6
7
8
9
FROM python:3.13.0 AS build

WORKDIR /opt/mining_rig_monitor_document_src
COPY . /opt/mining_rig_monitor_document_src
RUN pip install -r requirements.txt
RUN mkdocs build -c

FROM scratch AS release
COPY --from=build /opt/mining_rig_monitor_document_src/site /

RUN mkdocs build -c will create a directory named site which stores all html files. Then, from scratch image, we copy all thoses html files to /

II. Docker build command

This following command will copy all files from release stage to nginx-dist. The most important is environment variable DOCKER_BUILDKIT=1

$ DOCKER_BUILDKIT=1 docker build -f  Dockerfile --target=release --output nginx-dist .
➜ mining_rig_monitor_document (master) ✗ pwd
/home/nguyenvinhlinh/Projects/mining_rig_monitor_document


➜ mining_rig_monitor_document (master) ✗ tree -L 1
.
├── Dockerfile
├── docs
├── mkdocs.yml
├── nginx-dist      <<-- your files from docker build
├── readme.md
├── requirements.txt
└── wireframe

A new lightning system for K1 Max

26/03/2025 @ Saigon Projects

1. Introduction

I am the owner of a K1 Max 3D printer, the built-in lightning system is not good enought for me. In fact, it’s quite dark.

This project aims at improving the lightning system for K1 Max 3D printer! I designed the lightning frame myself with Plasticity, due to limited size of K1 Max, I have split the whole big model into 8 parts, then print them one by one.

In addition, there are holes to use LED bars with zip ties, no messy with double-size tapes. You gonna be surprise while cleaning a mess of double-size tapes, and I hate it.

[1] 3D design
[1] 3D design
[2] Light's ON/OFF
[2] Light's ON/OFF
[3] Finished Product
[3] Finished Product

2. 3D files

[4] 3D files
[4] 3D files

Main Components

3. Where is the model?

I sell this model on https://cults3d.com/. If you are interest, I also willing to receive in Monero(XMR) instead of USD/VND.

How to create .rpm package for elixir project?

21/03/2025 @ Saigon Elixir

Step 1. Prepare source code tarball

In this step, I would like to use my repo named ASIC Sentry for example

$ git clone https://github.com/nguyenvinhlinh/ASIC-Sentry/ asic-sentry
$ cd asic-sentry
$ git checkout v1.0.0
$ cd ..
$ mv asic-sentry asic-sentry-1.0.0
$ tar -cJvf asic-sentry-1.0.0.tar.xz asic-sentry-1.0.0

For tar command:

  • -c: create a new archive
  • -J: filter the archive through xz
  • -v: verbose
  • -f: use archive file or device ARCHIVE

Now your source code tarball is ready for next step!

Step 2. Setup $HOME/rpmbuild directory

Use this command to create a directory structure for rpmbuild

$ rpmdev-setuptree

$ tree $HOME/rpmbuild
/home/nguyenvinhlinh/rpmbuild
├── BUILD
├── RPMS
├── SOURCES
├── SPECS
└── SRPMS

Step 3. Copy source code tarball to SOURCES.

$ tree $HOME/rpmbuild
/home/nguyenvinhlinh/rpmbuild
├── BUILD
├── BUILDROOT
├── readme.md
├── RPMS
├── SOURCES
│   └── asic-sentry-1.0.0.tar.xz <----- your tarball here!
├── SPECS
│   ├── asic-sentry-1.0.0.spec
└── SRPMS

Step 3. Create new SPECS/.spec file

Ignore this step if you modify existing one!

$ cd SPECS;
$ rpmdev-newspec;

Update:

  • Version
  • Release
  • Source0

This is an example of mine asic-sentry-1.0.0.spec

Name: asic-sentry
Version: 1.0.0
Release:        1%{?dist}
Summary: ASIC Sentry is a monitoring software designed to collect and send operational logs from ASIC Miners to a Mining Rig Monitor

License: GNU General Public License v3.0
URL: https://github.com/nguyenvinhlinh/ASIC-Sentry
Source0: asic-sentry-1.0.0.tar.xz

%description
ASIC Sentry is a monitoring software designed to collect and send operational logs from ASIC Miners to a Mining Rig Monitor

%global debug_package %{nil}

%prep
%autosetup

%build
cd assets;
npm install;
cd ..;
mix deps.get --only prod
MIX_ENV=prod mix compile
MIX_ENV=prod mix assets.deploy
MIX_ENV=prod mix release


%install
mkdir -p %{buildroot}/opt/asic_sentry
cp -r _build/prod/rel/asic_sentry/* %{buildroot}/opt/asic_sentry


%files
...
... A long list of installed files.
...

%changelog
* Tue Feb 04 2025 Nguyen Vinh Linh <nguyenvinhlinh93@gmail.com>
- Support KS5L asic

Step 3. Run rpmbuild

$ cd SPECS;
$ rpmbuild -bb asic-sentry-1.0.0.spec

Gonna see error:

ERROR   0002: file '/opt/asic_sentry/lib/crypto-5.5/priv/lib/crypto.so' contains an invalid runpath '/usr/local/lib64'

crypto is an erlang module. I dont know how to modify it. this is a work around!

$ cd SPECS;
$ export QA_RPATHS=$(( 0x0001|0x0002 ))
$ rpmbuild -bb asic-sentry-1.0.0.spec

Step 4. Provide %files

Those file would be listed after running rpmbuild -bb asic-sentry-1.0.0.spec.

Append it and re-run rpmbuild -bb asic-sentry-1.0.0.spec to make rpm.

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /opt/asic_sentry/bin/migrate
   /opt/asic_sentry/bin/migrate.bat
   /opt/asic_sentry/bin/asic_sentry
   /opt/asic_sentry/bin/asic_sentry.bat
   /opt/asic_sentry/bin/server

Check out RPMS directory! RPM should be there!

➜ rpmbuild (master) ✗ tree -L 3
.
├── BUILD
├── BUILDROOT
├── readme.md
├── RPMS
│   └── x86_64
│       ├── asic-sentry-1.0.0-1.fc40.x86_64.rpm <----------- your file here!
│       ├── asic-sentry-debuginfo-1.0.0-1.fc40.x86_64.rpm
│       └── asic-sentry-debugsource-1.0.0-1.fc40.x86_64.rpm
├── SOURCES
│   └── asic-sentry-1.0.0.tar.xz
├── SPECS
│   ├── asic-sentry-1.0.0.spec
└── SRPMS

References

How to install open-webui for llama model on Fedora?

31/12/2024 @ Saigon LLM

This guide is about installing open-webui on fedora.

1. Update python & pip

$ dnf update python -y
$ pip install --upgrade pip

2. Install open-webui guide

  • Create directory /opt/open-webui
$ mkdir /opt/open-webui
$ cd /opt/open-webui
  • change ownership to your user, do not run with root due to security issue.
$ chown nguyenvinhlinh:nguyenvinhlinh -Rv /opt/open-webui/
  • Setup virtual environment (venv) & install open-webui (do not run as root)
$ python -m venv open-webui-env
$ source open-webui-env/bin/activate
$ pip install open-webui

3. Start open-webui server (do not run as root)

$ open-webui serve
  • Server should be available on http://127.0.0.1:8080
  • All data (sqlite, uploads, cache, db) can be found at /opt/open-webui/open-webui-env/lib/python3.12/site-packages/open_webui/data
open-webui on Chrome
open-webui on Chrome

4. Install Ollama software guide

$ curl -fsSL https://ollama.com/install.sh | sh
$ ollama --version

5. Using ollama to pull/download model

$ ollama pull llama3.2

6. Running with systemd service /etc/systemd/system/open-webui.service

[Unit]
Description=Open WebUI (LLAMA)
After=network.target

[Service]
WorkingDirectory=/opt/open-webui
ExecStart=/opt/open-webui/open-webui-env/bin/open-webui serve
User=nguyenvinhlinh
RemainAfterExit=yes
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Enable and start open-webui service

$ systemctl enable open-webui
$ systemctl start  open-webui

References