跳到主要內容

發表文章

目前顯示的是 2022的文章

TP-Link Archer C7 V2由DD-WRT改安裝 Openwrt

最近DD-WRT的DHCP突然掛掉,決定改用Open-WRT  1.改為TP-Link原廠韌體- ArcherC7v2_webrevert.rar DD-WRT TP-Link Archer C7 (AC1750) 2.x 2.登錄192.168.0.1(admin/admin),升級Open-WRT(openwrt-22.03.2-ath79-generic-tplink_archer-c7-v2-squashfs-factory) https://openwrt.org/toh/tp-link/archer-c5-c7-wdr7500 3.登錄192.168.1.1 4.停用IPv6 uci set 'network.lan.ipv6=0' uci set 'network.wan.ipv6=0' uci set 'dhcp.lan.dhcpv6=disabled' /etc/init.d/odhcpd disable uci commit uci -q delete dhcp.lan.dhcpv6 uci -q delete dhcp.lan.ra uci commit dhcp /etc/init.d/odhcpd restart uci set network.lan.delegate="0" uci commit network /etc/init.d/network restart /etc/init.d/odhcpd disable /etc/init.d/odhcpd stop uci -q delete network.globals.ula_prefix uci commit network /etc/init.d/network restart

透過Node-Red來撥放天氣預報TTS

1.去 氣象資料開放平台 註冊,並取得 API授權碼 2.以下例子是取得新北市土城區未來一週天氣預報的API網址 https://opendata.cwb.gov.tw/dist/opendata-swagger.html?urls.primaryName=openAPI#/%E9%A0%90%E5%A0%B1/get_v1_rest_datastore_F_D0047_071 3.建立Node-Red,記得更新URL Node-Red Code [{"id":"de12f26a26ae775c","type":"tab","label":"流程4","disabled":false,"info":"","env":[]},{"id":"6b33595bc6a16e20","type":"inject","z":"de12f26a26ae775c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":200,"wires":[["540d0db5b62256fd"]]},{&

透過Node-Red來使用HomePod Mini TTS(Microsoft Edge TTS)

1.在HACS安裝Microsoft Edge TTS 2.在configuration.yaml新增以下文字,並重新啟動HA tts:   - platform: edge_tts     language: zh-CN # Default language or voice (Optional) 3.先到Media \ Text to Speech \ Edge TTS 測試訊息 4.設定Node-Red TTS Node-Red Code [{"id":"04e98de49f7c87e7","type":"tab","label":"流程3","disabled":false,"info":"","env":[]},{"id":"22d845f946fbba59","type":"function","z":"04e98de49f7c87e7","name":"fn_Microsoft Edge TTS","func":"var message = \"Node-Red 測試 Microsoft Edge TTS\";\n\nmsg.payload_tts = {\n    \"message\": message, \n    \"cache\": true,\n    \"options\": {\n        \"volume\": \"+50%\",\n        \"voice\": \"zh-TW-HsiaoChenNeural\",\n        \"pitch\": \"+0Hz\",\n        \"rate\": \&quo

cc2530 + cc2591整合Wemos D1-mini(ESP8266)

cc2530 + cc2591透過Wemos D1-mini(ESP8266),直接具備Wifi功能 1. 刷cc2530 + cc2591韌體 2.接線 ESP8266 CC2530 3v3 VCC GND GND TX P02 RX P03 GND P20 GND P04 GND P05 3.燒錄ESPEasy到Wemos D1-mini(ESP8266) 下載 ESPEasy_binaries.zip ,取出ESP_Easy_mega_20221105_normal_ESP8266_4M1M.bin 下載ESPEasy_dist.zip 執行 ESPEasy_dist\FlashESP8266.exe 燒錄 ESP_Easy_mega_20221105_normal_ESP8266_4M1M.bin 4.設定ESPEasy 尋找Wifi(ESP-Easy) Wifi default password:configesp ESPEasy web interface Devices \  Communication - Serial Server a.    Name: ZIGBEE2MQTT b.    Enabled: checked c.    TCP Port: a number between 1000 and 9999 "1775" d.    Baud Rate: 115200 e.    Data bits: 8 f.    Parity: No Parity g.    Stop bits: 1 h.    Reset target after boot: - none – i.    RX receive timeout: 0 j.    Event processing: Generic Submit 5.設定Zigbee2MQTT serial:     port: 'tcp://192.168.1.xx:1775'     adapter: zstack 註:Tasmota刷了zbbridge版本,但是一直沒有出現Wifi設定畫面,連不上網路,就放棄了 參考文章 https://www.zigbee2mqtt.io/guide/adapters/flashing/connecting_cc2530.ht

透過Wemos D1-mini(ESP8266)刷cc2530 + cc2591韌體

  1.下載 CCLoader   2.準備Z-Stack Firmware      燒錄 CCLoader_Arduino.bin 到Wemos D1-mini(ESP8266)      下載 CC2530_CC2591_20190523.zip      下載 objcopy.exe, binutils-2.28-1-mingw32-bin.tar.xz      下載  libiconv  ,並解壓縮到 \ binutils-2.28-1-mingw32-bin\bin           objcopy.exe --gap-fill 0xFF --pad-to 0x040000 -I ihex CC2530ZNP-with-SBL.hex -O binary CC2530ZNP-with-SBL.bin 3.燒錄 CCLoader_Arduino.bin 到Wemos D1-mini(ESP8266) 使用 Tasmotizer! ,  NodeMCU-pyflasher ,  esptool.py  燒錄  CCLoader_Arduino.bin 到ESP-8266 4. 燒錄cc2530 + cc2591韌體前置作業 編輯 \CCLoader\src\CCLoader.ino,在大約86-90行,確認以下文字 // Debug control pins & the indicate LED int DD = 14; //GPIO14=D5 on NodeMCU/WeMos D1 Mini int DC = 4; //GPIO4=D2 on NodeMCU/WeMos D1 Mini int RESET = 5; //GPIO5=D1 on NodeMCU/WeMos D1 Mini int LED = 2; //GPIO2=D4 and the Blue LED on the WeMos D1 Mini and the ESP-12E module on the NodeMCU, or can use GPIO16=D0 for the other Blue LED on NodeMCU 連接PIN腳 (可參考 https://zigbee.blakadder.com/coordinators.html) Pin Name NodeMCU

Sonoff Zigbee 3.0 USB Dongle Plus燒錄ZigBee Router 模式

前言       Sonoff Zigbee 3.0 USB Dongle Plus燒錄為ZigBee Router 模式,可加以延伸ZigBee訊息(提供給ZHA 或Zigbee2MQTT) 1.下載韌體 https://github.com/Koenkk/Z-Stack-firmware/raw/master/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_router_20220125.zip 2.下載燒錄軟體(FLASH-PROGRAMMER-2 — SmartRF Flash Programmer v2) 要註冊才能下載 https://www.ti.com/tool/FLASH-PROGRAMMER 3.拆除Sonoff Zigbee 3.0 USB Dongle Plus外殼,按住靠近USB的按鈕不放,插入電腦USB後,等待10秒後,再放開 4.開啟燒錄軟體     點選COM Port(Unknow)- > CC2652P -> 勾選 Erase + Program -> Play(燒錄)     如果遇到失敗,大部份是步驟3沒做好,再重新拔插一下 5.如果看到成功,就大功告成了,開啟 ZHA 或Zigbee2MQTT配對模式後,就可以看到它了。 註:目前不知道如何重新配對,我都是執行重新燒錄動作 參考文章 https://forum.automata.id/t/topic/247 https://github.com/Koenkk/Z-Stack-firmware/raw/master/router/Z-Stack_3.x.0/

[ZHA]將小米網關變為ZHA閘道

前言     因為小米網關在Zigbee2MQTT太容易無回應,所以改為ZHA 注意事項      原本透過小米網關的ZigBee設備會全部消失,不影響小米藍芽、Wifi設備 步驟 1.將小米網關啟用  [DANGER] ZHA 或 zigbee2mqtt 模式 -> 傳送(需等待幾分鐘) 完成後,它會提供訊息 Radio Type: EZSP Path: socket://192.168.1.xx:8888 2.新增整合->Zigbee Home Automation。依步驟1的訊息填入相關資訊。 3.點選 新增裝置 ,將各ZigBee裝置開始進行重新配對。

[ZHA]支援小米無線開關按鈕

  匯入小米無線開關(WXKG01LM)後,按鈕動作只會出現以下訊息,NR會無法直接動作。 1.建立BluePrint (1)HA->自動化與場景 (2)匯入 https://community.home-assistant.io/t/longpress-and-shortpress-script-automation-for-xiaomi-round-button-with-zha/229367  (3)在BluePrint點選剛才建立的BluePrint->自動化 (4)指定各按鈕的指定動作 (5)完成 參考文章 https://community.home-assistant.io/t/zha-xiaomi-mijia-round-wireless-switch-wxkg01lm-with-hold-lumi-sensor-switch/263075 https://community.home-assistant.io/t/zha-xiaomi-mijia-round-wireless-switch-wxkg01lm-lumi-sensor-switch/258472/18

Sonoff S31燒錄ESPHome

 1.線路連接 VCC<->3.3V RX<->TX TX<->RX GND<->GND #短路燒錄器上的3.3V 2.下載FTDI驅動程式,並安裝它 https://ftdichip.com/drivers/ 3.到HA Add-On新增ESPHome 4.New Devices->ESP8266 5.編輯yaml 註:注意device_name要唯一 https://www.esphome-devices.com/devices/Sonoff-S31 https://esphome.io/devices/sonoff_basic.html 6.執行Validate,確認yaml檔正確 7.執行Install->Manual Download->Legacy format->存好ESPHome.bin檔 8.按住S31上的reset鍵不放,插入USB後,維持5秒再放開 9.執行FlashESP8266.exe,並選取S31 ESPHome韌體(.bin) 10.燒錄成功後,看看wifi有新IP 11.HA 新增整合EPSHome,輸入S31的IP

Sonoff S31燒錄Tasmota

 1.線路連接 VCC<->3.3V RX<->TX TX<->RX GND<->GND #短路燒錄器上的3.3V 2.下載FTDI驅動程式,並安裝它 https://ftdichip.com/drivers/ 3.下載S31 Tasmota靭體 https://github.com/arendst/Tasmota/releases 4.下載ESPEasy燒錄軟體 https://github.com/letscontrolit/ESPEasy/releases 5.解壓縮ESPEasy,並把S31 Tasmota靭體(.bin)放到根目錄 6.按住S31上的reset鍵不放,插入USB後,維持5秒再放開 7.執行FlashESP8266.exe,並選取S31 Tasmota韌體(.bin) 8.燒錄成功後,看看wifi有沒有tasmota-xx-的WIFI SSID #Tasmota 12.2.0會遇到常常掉wifi的情形,可能跟Wifi 6 OFDMA、Mesh有關 https://github.com/tasmota/docs/blob/master/docs/FAQ.md https://tasmota.github.io/docs/FAQ/#device-disconnects-from-wi-fi-often

TuYa(塗鴉)整合到Home Assistant

  一、安裝「智能生活」App(uya Smart app or Smart Life app) 二、註冊「智能生活」帳號,帳號地區 台灣 加入設備 三、註冊TuYa IOT帳號 首頁 右上角選 English,才能用Email註冊) 進入後選 個人使用 My Account/Basic Information\Country/Region設定為 United States of America Cloud\Development\Create Cloud Project Industry和Development Method都選Smart Home Data Center都選起來 Create 點選Project Service API\Go to Authorize\選擇 Device Status Notification Devices\Link Tuya App Account\Add App Account\出現QR Code 「智能生活」App\加入設備\掃描上一步的QR Code\全部+唯讀 正常的話,在App裡面的設備就會匯進來了 回到OverView,複製Access ID/Client ID和Access Secret/Client Secret 四、加入到Home Assistant 新增整合\Tuya 國家選United States,Tuya IOT Access ID和Tuya IOT存取私鑰輸入三-13的內容 收工

停用Qnap MariaDB binary log

 停用Qnap MariaDB binary log 1.vi /etc/config/my.cnf 新增skip-log-bin # log-bin =mysql-bin skip- log-bin 2.重啟服務 https://www.qnap.com/zh-tw/how-to/faq/article/%E6%88%91%E5%8F%AF%E4%BB%A5%E5%9C%A8%E7%B3%BB%E7%B5%B1%E7%9A%84%E5%93%AA%E8%A3%A1%E6%89%BE%E5%88%B0-mariadb-%E7%9A%84%E8%A8%AD%E5%AE%9A%E6%AA%94 https://dba.stackexchange.com/questions/72770/disable-mysql-binary-logging-with-log-bin-variable

[bitnami]設定固定ip

  Log in to the server console. Obtain the network interface name using the command below. Typically, the interface name is of the form  enXXXX . Note the virtual machine’s IP address associated with the interface. sudo ifconfig Create a configuration file for the network interface by copying an existing configuration file and placing it in the  /etc/systemd/network  directory. In this example, assume that the new configuration file is named 25-wired.network: cd /etc/systemd/network sudo cp 99-dhcp.network 25-wired.network Edit the new configuration file and update it to look like the configuration below. Replace the INTERFACE-NAME, HOST-IP-ADDRESS and GATEWAY-IP-ADDRESS placeholders with the name of the network interface, the host IP address obtained previously, and the gateway IP address, as shown in the example. [Match] Name=INTERFACE-NAME [Network] Address=HOST-IP-ADDRESS Gateway=GATEWAY-IP-ADDRESS Here is an example screenshot: Save your changes and restart the virtual

[bitnami]如何重啟服務

Start Or Stop Services Each Bitnami stack includes a control script that lets you easily stop, start and restart services. Obtain the status of a service: sudo /opt/bitnami/ctlscript.sh status Call it without any service name arguments to start all services: sudo /opt/bitnami/ctlscript.sh start Or use it to restart a single service, such as Apache only, by passing the service name as argument: sudo /opt/bitnami/ctlscript.sh restart apache Use this script to stop all services: sudo /opt/bitnami/ctlscript.sh stop Restart the services by running the script without any arguments: sudo /opt/bitnami/ctlscript.sh restart 參考網址 Start Or Stop Services

[bitnami]如何遠端連phpMyAdmin

 [Mac] Open a new terminal window on your local system (for example, using “Finder -> Applications -> Utilities -> Terminal” in macOS or the Dash in Ubuntu). Make sure that you have your  SSH credentials ( .pem  key file)  in hand. Run the following command to configure the SSH tunnel using the SSH key file. Remember to replace KEYFILE with the path to your private key and SERVER-IP with the public IP address or hostname of your server: ssh -N -L 8888:127.0.0.1:80 -i KEYFILE bitnami@SERVER-IP Remember that if you are redirecting HTTP requests to the HTTPS port, you must use destination port 443 instead of 80. NOTE: If successful, the above command will create an SSH tunnel but will not display any output on the server console. Access the phpMyAdmin console through the secure SSH tunnel you created, by browsing to  http://127.0.0.1:8888/phpmyadmin . Log in to phpMyAdmin by using the following credentials: Username:  root Password: application password. (Refer to our  FAQ  to le

[bitnami]如何遠端連ssh

Debian sudo rm -f /etc/ssh/sshd_not_to_be_run sudo systemctl enable ssh sudo systemctl start ssh Log in to the server console as the  bitnami  user. Edit the  /etc/ssh/sshd_config  and modify or add the following line: PasswordAuthentication yes Restart the SSH server for the new configuration to take effect: sudo /etc/init.d/ssh force-reload   參考網址 Activate Or Deactivate The SSH Server Connect To The Server Using SSH Configure Password-Based SSH Authentication Configure Key-Based SSH Authentication