Node-RED my OLD ARMv7l Raspberry PI

sudo apt update
sudo apt upgrade
uname -m เช็คว่า CPU เป็น ARMv7 ขึ้นไปหรือไม่

ติดตั้ง NodeJS และติดตั้ง Node-RED
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

ตอบ Y

ตอนนี้จะเข้าได้ทาง http://x.x.x.x:1880
ตั้ง authen
sudo nano /home/XXX/.node-red/settings.js
เอา comment ออก
adminAuth: {
type: “credentials”,
users: [{
username: “admin”,
password: “$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.”,
permissions: “*”
}]
},
แก้ admin ตามที่ชอบ

sudo npm install -g –unsafe-perm node-red-admin
สร้าง hash password
node-red-admin hash-pw
ใส่ password จะได้ hash ไปใส่ใน password: ไฟล์ settings.js

sudo node-red-stop หรือ sudo systemctl stop nodered หยุดการทำงาน Node-RED
sudo node-red-start หรือ sudo systemctl start nodered เริ่มการทำงาน Node-RED อีกครั้ง
sudo node-red-log ดู log
sudo sudo systemctl enable nodered.service to autostart Node-RED at every boot
sudo systemctl disable nodered.service to disable autostart on boot

MQTT Mosquitto Websockets

สมมุติว่า port mqtt คือ 8883 และ websocket คือ 8083

sudo nano  /etc/mosquitto/mosquitto.conf

 

 

  GNU nano 5.4                                /etc/mosquitto/mosquitto.conf

# Place your local configuration in /etc/mosquitto/conf.d/

#

# A full description of the configuration file is at

# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

per_listener_settings true

pid_file /run/mosquitto/mosquitto.pid

persistence true

persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

connection_messages true

log_timestamp true

log_timestamp_format %Y-%m-%dT%H:%M:%S

include_dir /etc/mosquitto/conf.d

#allow_anonymous false

listener 8883 0.0.0.0

protocol mqtt

allow_anonymous false

password_file /etc/mosquitto/passwordfile

listener 9001 0.0.0.0

protocol websockets

allow_anonymous false

password_file /etc/mosquitto/passwordfile

#socket_domain ipv4


passwordfile example

aaaa:bbb

encrypt file

sudo mosquitto_passwd -U passwordfile


Share Printer Error 0x00000709 Win 10,11 22H2

SADPTool System Error MSVCR120.dll

SADPTool
System Error
The code execution cannot proceed because MSVCR120.dll was not found. Reinstalling the program may fix this problem

download install

https://download.microsoft.com/download/C/C/2/CC2DF5F8-4454-44B4-802D-5EA68D086676/vcredist_x64.exehttps://download.microsoft.com/download/c/c/2/cc2df5f8-4454-44b4-802d-5ea68d086676/vcredist_x86.exe

win32 only x86.exe

win64 both file

Mikrotik Hotspot Login Logo Change

Mikrotik ตั้งแต่ รุ่น 6.47 ปรับปรุง login hotspot ใหม่ เป็นรูปแบบ SVG

แก้ไข Login.html มองหา

				
					<svg class="logo" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 174 42">
                        <path fill="#fff" d="M7.32 13.66L0 41.74 3.12 41.74 9.49 15.94 9.58 15.94 15.01 41.74 18.22 41.74 36.86 16.34 36.95 16.34 30.02 41.74 33.18 41.74 40.4 13.66 35.73 13.66 17.23 38.87 11.99 13.66 7.32 13.66zM43.43 21.45L38.19 41.74 41.16 41.74 46.4 21.45 43.43 21.45zM50.68 21.45L45.5 41.74 48.47 41.74 50.36 34.39 55.55 30.77 62.02 41.74 65.27 41.74 57.91 29.28 69.43 21.45 65.46 21.45 51.21 31.36 51.12 31.28 53.66 21.45 50.68 21.45z" />
                        <path d="M71.18 21.45L65.94 41.74h3l2.74-10.62c1-3.81 3.82-7.39 9.16-7.47.56 0 1.13 0 1.7 0l.66-2.48c-.52 0-1.09 0-1.61 0-4.34 0-6.94 2-8.82 5h-.1l1.23-4.68zM103.8 28.8c0-5-4-7.94-9.63-7.94-8.69 0-13.59 6.37-13.59 13 0 5.07 3.44 8.45 9.72 8.45 9 0 13.5-6.68 13.5-13.53m-3 .52c0 4.72-3.44 10.93-9.95 10.93-5 0-7.32-2.68-7.32-6.61 0-4.76 3.59-10.7 10.1-10.7 4.77 0 7.17 2.6 7.17 6.38M132.33 21.43L134.26 13.66 105.19 13.66 103.27 21.45 112.59 21.45 112.59 21.45 122.99 21.45 122.99 21.45 132.33 21.43zM111.67 25.17L107.55 41.74 117.93 41.74 122.06 25.17 122.06 25.16 111.67 25.16 111.67 25.17zM134 25.17l-4.11 16.57h9.35l4.1-16.57zm10.28-3.73l1.94-7.78h-9.34l-2 7.79zM150.09 13.66L143.11 41.74 152.45 41.74 153.91 35.92 156.04 34.34 159.34 41.74 169.49 41.74 163.26 29.55 174.26 21.33 163.07 21.33 156.18 27.3 156.09 27.3 159.44 13.66 150.09 13.66zM47.45 0c1.14 7.93 5.39 12.74 14.07 13.14A10.69 10.69 0 0 1 47.45 0" fill="#fff" fill-rule="evenodd" />
                        <path d="M42.91,1.4c.1,0,.11,0,.12.11A16.55,16.55,0,0,0,48.26,13a16.6,16.6,0,0,0,12,4.66c-10,4-20.55-5.6-17.33-16.28" fill="#fff" fill-rule="evenodd" /></svg>

				
			

จากนั้นไปเวป https://editor.method.ac/

https://boxy-svg.com/app

สร้างรูปแก้ไขปรับปรุง แล้วเอามาใส่แทน เช่น

				
					<svg class="logo" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 744.000000 246.000000" >
 <text transform="matrix(10.5683 0 0 15.5699 -190.632 -2500.72)" stroke="#000" font-weight="bold" xml:space="preserve" text-anchor="start" font-family="'Yrsa'" font-size="NaN" id="svg_8" y="171.85095" x="19.44624" stroke-width="0" fill="#0000ff">EDD EASY</text>
</svg>
				
			

add remote user command line

example create USER01

net user USER01 password /add

net localgroup “Remote Desktop Users” USER01 /add

hide user

REG ADD “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList”

REG ADD “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList” /v USER01 /t REG_DWORD /d 1

 

 

Install DotNet 3.5 Windows 10 with source (no Internet)

เอาไฟล์จาก usb หรือ iso

เอาไฟล์จาก usb หรือ iso ของ windows 10 ใน

\\sources\sxs 

microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab

กับ

Microsoft-Windows-NetFx3-OnDemand-Package~31bf3856ad364e35~amd64~en-US~.cab

ไม่รู้อันไหนก็ copy มาทั้งสองอันใส่ใน d:\sources\sxs

cmd สิทธิ์ admin

Dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess

 

ESP32 ลูป reboot นรก Brownout detector was triggered

  1. ESP32 มีระบบเตือน Error ออกมาเมื่อ แรงดันไฟต่ำกว่า 2.4V และจะ Reset ตัวเองอัตโนมัติ
    สาเหตุ น่าจะเกิดจากแหล่งจ่ายไฟ USB ที่มีไฟเลี้ยงไม่เกิน 500mA
    การแก้ไขคือ เพิ่มแหล่งจ่าย 5V
    หรือ ใช้ library โดยเพื่อปิด Brownout detector

    #include “soc/soc.h”
    #include “soc/rtc_cntl_reg.h”

    และ void setup() {
    WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable detector
    //โค้ดอื่น ๆ
    }