หน้าเว็บ

วันศุกร์ที่ 8 พฤษภาคม พ.ศ. 2563

Ubiquiti loco m5 ตั้งค่า AP และ Station

Ubiquiti loco m5 ตั้งค่า AP และ Station
รูป AP to Station
การต่อสาย

ตั้งค่า IP และ User : Password Default
IP : 192.168.1.20
User : ubnt
Pass : ubnt
Set IP เครื่องไปวง 1 เพื่อตั้งค่าเริ่มต้น

ตั้งค่า AP
1. Tab Mani จดค่า Mac ไว้สำหรับ Connect

2. Tab Wireless ตั้งค่า Wireless Mode

3. Tab Network ตั้งค่า

4. Tab Advanced
Distance : ปรับระยะทางให้เหมาะสมกับการใช้งาน กี่กิโลระยะที่ติดตั้งกับ Station

5. Tab System ตั้งค่ารหัส Admin ใหม่

ตั้งค่า Station
1. Tab Network ตั้งค่า

2. Tab Advance ตั้งค่า

3. Tab Wireless ตั้งค่า Wireless Mode

แล้ว Select AP เพื่อให้ Connect ระหว่าง AP และ Station

4. Tab System ตั้งค่ารหัส Admin ใหม่ และชื่อ


นำ Notebook มาต่อ Port Lan ที่ POE ของ Station
Set IP แล้วลอง Ping หา AP ดู

http://sys2u.com/xpert/viewtopic.php?f=37&t=3277

onoff 4CH : Sonoff4CH flash program Tasmota-8.2.0

Sonoff 4CH : Sonoff4CH flash program Tasmota-8.2.0 สำหรับรดน้ำที่สวน
1. Program Tasmota download
https://github.com/arendst/Tasmota/releases/tag/v8.2.0

2. Flash ผ่าน Program Atom ที่ลง platformio ด้วย
https://intranet.sci.com/blog.php?u=281&b=1598

3. เวลา Flash ก่อน เสียบต้องกดปุ่ม IO0 แช่ไว้ก่อนเสียถึงจะ Flash ผ่าน
การต่อสาย
https://intranet.sci.com/blog.php?u=281&b=1685
รูป


4. แตกไฟล์ที่โหลดได้จากข้อ 1 แล้ว Add Project เข้า Atom
แก้ platformio.ini
เอา ; ออก จะเขียนใส่อุปกรณ์ไหนให้เลือกให้ตรง
env_default = tasmota


ใส่ port ที่จะ Upload เดิมเป็น COM5
upload_port = /dev/ttyUSB0


**** สำคัญบางครั้ง Flash แล้ว Config Wifi ไม่เปลี่ยนจำ IP เดิม WIFI เดิม ต้องแก้ที่ข้อ 6 ****
5. แก้ เข้าไปที่ sonoff --> my_user_config.h

// If not selected the default will be SONOFF_BASIC
#define MODULE SONOFF_4CH // [Module] Select default model from tasmota_template.h

// -- Wifi ----------------------------------------
#define WIFI_IP_ADDRESS "192.168.2.7" // [IpAddress1] Set to 0.0.0.0 for using DHCP or enter a static IP address
#define WIFI_GATEWAY "192.168.2.2" // [IpAddress2] If not using DHCP set Gateway IP address
#define WIFI_SUBNETMASK "255.255.255.0" // [IpAddress3] If not using DHCP set Network mask
#define WIFI_DNS "192.168.0.253" // [IpAddress4] If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)

#define STA_SSID1 "SCI_GARDEN" // [Ssid1] Wifi SSID
#define STA_PASS1 "PASSWORD" // [Password1] Wifi password

#define NTP_SERVER1 "192.168.0.2"


6. ถ้ามีปัญหาเรื่อง Wifi ไม่จับกับ Wifi ตัวใหม่ต้องแก้แบบนี้
6.1. กดปุ่ม IO0 4 ครั้งติด ๆ กัน ตัวเครื่อง Sonoff จะปล่อย Hostsport Wifi
6.2. นำ Note book มาต่อ wifi เข้า IP 192.168.4.1 จะพบหน้าตั้งค่า Wifi หรือกด Scan for wifi network เพื่อหา wifi ที่จะต่อแล้วใส่รหัส
จึงจะ connect ได้ซึ่ง Flash บังคับไปในไฟล์ Rom ไม่มีผล

7. ตั้งค่า MQTT เพิ่มเติม จะได้ไม่ต้องแก้ Home Assistant ใหม่ 2 ที่
7.1. MQTT

7.2. รหัส Login Sonoff และชื่อที่เรียกใช้ เพื่อให้ HA เดิมสั่งงานได้ โดยไม่ต้องแก้ที่ HA

Next Cloud : Next Cloud Update แล้วเปิดไฟลื PDF ไม่แสดงข้อมูลใน PDF

Next Cloud : Next Cloud Update แล้วเปิดไฟลื PDF ไม่แสดงข้อมูลใน PDF ต้อง Download แล้วมาเปิดข้างนอกถึงจะดูข้อมูลได้
วิธีแก้
แก้ที่ apache
  1. nano /etc/apache2/conf-enabled/ssl-params.conf

ใส่ # หน้าแถว
#Header always set X-Frame-Options DENY

แล้ว Restart apache

https://help.nextcloud.com/t/new-nextcloud-15-installation-pdf-viewing-does-not-work/43767

Code PHPBB3 Post Reply Topic.

Code PHPBB3 Post Reply Topic.
ถ้า Submit Post Action ไปไฟล์อื่น ต้องใส่ enctype="multipart/form-data" ด้วย
แต่กรณีนี้จะส่งผ่าน Java ไม่ต้อง Reload หน้า Web Code ดังนี้
HTML
  1. <div id="dialog-edit-upload" title="Upload รายงานความคืบหน้า Project หรือ PMC" style="display:none;">
  2.     <form method="POST" enctype="multipart/form-data" id="myform">
  3.         <div>Upload pdf ไฟล์ เพื่อแนบรายงานความคืบหน้าแต่ละเดือน</div>
  4.         <table width='100%' border='0'>
  5.         <tr>
  6.             <td nowrap>ประจำเดือน : </td>
  7.             <td><input name='P_Month' id='P_Month_field' size='3' readonly="readonly"><input type="hidden" name='PHPBBID' id='PHPBBID_field'></td>
  8.         </tr>      
  9.         <tr>
  10.             <td nowrap>Upload PDF ไฟล์ : </td>
  11.             <td align='left' class='default'><input type="file" name="P_FILE_MONTH" id="P_FILE_MONTH_ID"></td>
  12.         </tr>                                                  
  13.         </table>   
  14.     </form>
  15. </div>


Java
  1. function editUpload(ACTION){
  2.     var str = ACTION;
  3.     var ActionArray = str.split(',');
  4.    
  5.     $('#P_Month_field').val('');
  6.     $('#P_FILE_MONTH_ID').val('');
  7.     $('#PHPBBID_field').val('');
  8.    
  9.     $('#PHPBBID_field').val(ActionArray[0]);
  10.     $('#P_Month_field').val(ActionArray[1]);
  11.    
  12.     //var target = "project_upload.php?ACTION=" + ActionArray[0] + ',' + ActionArray[1];
  13.     var target = "project_upload.php";
  14.     $( "#dialog-edit-upload" ).dialog({
  15.         resizable: false,
  16.         width:420,
  17.         height:250,
  18.         modal: true,   
  19.         buttons: {
  20.             "Yes": function() {            
  21.             //$('#PHPBBID_field').val() ;
  22.             // Get form
  23.             var form = $('#myform')[0];
  24.      
  25.            // Create an FormData object
  26.             var data = new FormData(form);
  27.      
  28.            // If you want to add an extra field for the FormData
  29.            //data.append("CustomField", "This is some extra data, testing");
  30.      
  31.            // disabled the submit button
  32.             //$("#btnSubmit").prop("disabled", true);
  33.      
  34.             $.ajax({
  35.                 type: "POST",
  36.                 enctype: 'multipart/form-data',
  37.                 url: target,
  38.                 data: data,
  39.                 processData: false,
  40.                 contentType: false,
  41.                 cache: false,
  42.                 timeout: 800000,
  43.                     success: function(ret) {
  44.                         //alert("บันทึกข้อมูลสำเร็จ !");
  45.                         if(ret == 'OK'){
  46.                             alert("บันทึกข้อมูลสำเร็จ ");                      
  47.                         } else {
  48.                             alert("บันทึกข้อมูลไม่สำเร็จ กรุณาตรวจสอบ ! ");   
  49.                         }
  50.                         $('#P_Month_field').val('');
  51.                         $('#P_FILE_MONTH_ID').val('');
  52.                         $('#PHPBBID_field').val('');
  53.                     },
  54.                 });
  55.                 $( this ).dialog( "close" );
  56.           },
  57.             Cancel: function() {
  58.                 $( this ).dialog( "close" );
  59.             }
  60.         }   
  61.     });
  62. }


PHP
  1. if(!empty($PHPBBID)){      
  2.         include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
  3.         include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
  4.                
  5.         $message_parser = new parse_message();
  6.         $message_parser->parse_attachments('P_FILE_MONTH', 'post', 139, true, false, false);
  7.         //$message_parser->parse_attachments('P_FILE_MONTH', 'post', $NumberForum, true, false, false);
  8.        
  9.         //function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false);
  10.         //$upload_parser = new parse_upload();
  11.         //$upload_parser -> upload_attachment('P_FILE_MONTH', 18429, $local = false, $local_storage = '', $is_message = false, $local_filedata = false);
  12.        
  13.         $my_subject = "รายงานความคืบหน้าเดือน $P_Month";
  14.         $my_text = "รายงานความคืบหน้าเดือน $P_Month";
  15.         $poll = $uid = $bitfield = $options = '';
  16.         generate_text_for_storage($my_subject, $uid, $bitfield, $options, false, false, false);
  17.         generate_text_for_storage($my_text, $uid, $bitfield, $options, true, true, true);      
  18.        
  19.         $data = array(
  20.             'forum_id'      => 139,
  21.             'topic_id'      => $PHPBBID,
  22.             //'topic_id'      => 18429,
  23.  
  24.             'icon_id'       => false,
  25.  
  26.             'enable_bbcode'     => true,
  27.             'enable_smilies'    => true,
  28.             'enable_urls'       => true,
  29.             'enable_sig'        => true,
  30.  
  31.             'message'       => $my_text,
  32.             'message_md5'   => md5($my_text),
  33.                        
  34.             'bbcode_bitfield'   => $bitfield,
  35.             'bbcode_uid'        => $uid,
  36.  
  37.             'post_edit_locked'  => 0,
  38.             'topic_title'       => $my_subject,
  39.             'notify_set'        => false,
  40.             'notify'            => false,
  41.             'post_time'         => 0,
  42.             'forum_name'        => '',
  43.             'enable_indexing'   => true,
  44.            
  45.             'attachment_data' => $message_parser->attachment_data,
  46.             'filename_data' => $message_parser->filename_data
  47.                
  48.         );
  49.        
  50.         submit_post('reply', $my_subject, '', POST_NORMAL, $poll, $data);      
  51.        
  52.         echo "OK";
  53.     } else {
  54.         echo "ERROR";   
  55.     }

วันพฤหัสบดีที่ 9 เมษายน พ.ศ. 2563

Ubuntu :: Ubuntu Scan Virus ClamAV

Ubuntu :: Ubuntu Scan Virus ClamAV
https://www.howtoforge.com/tutorial/clamav-ubuntu/

1. ติดตั้ง
  1. sudo apt-get install clamav

2. Update
  1. sudo freshclam

3. Scan Folder ข้อมูลเล็กน้อย (ไม่เก็บ Log แสดงไฟล์ที่ติด Virus ให้ดู)
  1. clamscan -r --bell -i /home/bill/Downloads


แต่ถ้า Scan Folder ที่ข้อมูลเยอะ ๆ Log จะถูกทับ ไม่เห็นข้อมูลต้อง สั่งแบบเก็บ Log
  1. clamscan -r --bell -i /DATA2/Software/ >> /var/log/clamav-scan.log


ถึงจะดู Log ทั้งหมดได้ที่ไฟล์ /var/log/clamav-scan.log
https://askubuntu.com/questions/19699/how-to-view-results-of-last-clamscan-scan

วันอาทิตย์ที่ 5 เมษายน พ.ศ. 2563

Nextcloud : Nextcloud Secure Apache with Let's Encrypt on Ubuntu And Update Version.

Nextcloud : Nextcloud Secure Apache with Let's Encrypt on Ubuntu And Update Version.

https://linuxize.com/post/secure-apache-with-let-s-encrypt-on-ubuntu-18-04/
1.
  1. sudo apt update
  2. sudo apt install certbot

2.
  1. openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

3.
  1. mkdir -p /var/lib/letsencrypt/.well-known
  2. chgrp www-data /var/lib/letsencrypt
  3. chmod g+s /var/lib/letsencrypt

4.
  1. nano /etc/apache2/conf-available/letsencrypt.conf

insert this.
Alias /.well-known/acme-challenge/ "/var/lib/letsencrypt/.well-known/acme-challenge/"
<Directory "/var/lib/letsencrypt/">
AllowOverride None
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Require method GET POST OPTIONS
</Directory>

5.
  1. nano /etc/apache2/conf-available/ssl-params.conf

insert this.
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder On
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
Header always set X-Frame-Options DENY
Header always set X-Content-Type-Options nosniff
# Requires Apache >= 2.4
SSLCompression off
SSLUseStapling on
SSLStaplingCache "shmcb:logs/stapling-cache(150000)"
# Requires Apache >= 2.4.11
SSLSessionTickets Off

SSLOpenSSLConfCmd DHParameters "/etc/ssl/certs/dhparam.pem"

6.
  1. a2enmod ssl
  2. a2enmod headers
  3. a2enconf letsencrypt
  4. a2enconf ssl-params
  5. a2enmod http2
  6. systemctl reload apache2


7.
  1. certbot certonly --agree-tos --email suwit@scivalve.com --webroot -w /var/lib/letsencrypt/ -d nextcloud.scivalve.com.com -d http://www.nextcloud.scivalve.com


8. output show
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/example.com/privkey.pem
Your cert will expire on 2020-03-12. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you like Certbot, please consider supporting our work by:

Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le

9.
  1. nano /etc/apache2/sites-available/000-default.conf


  1. <VirtualHost *:80>
  2.   ServerName nextcloud.scivalve.com
  3.   ServerAlias http://www.nextcloud.scivalve.com
  4.  
  5.   Redirect permanent / https://nextcloud.scivalve.com/
  6. </VirtualHost>
  7.  
  8. <VirtualHost *:443>
  9.   ServerName nextcloud.scivalve.com
  10.   ServerAlias http://www.nextcloud.scivalve.com
  11.  
  12.   Protocols h2 http:/1.1
  13.  
  14.   <If "%{HTTP_HOST} == 'www.nextcloud.scivalve.com'">
  15.     Redirect permanent / https://nextcloud.scivalve.com/
  16.   </If>
  17.  
  18.   DocumentRoot /var/www/nextcloud
  19.   ErrorLog ${APACHE_LOG_DIR}/nextcloud.scivalve.com-error.log
  20.   CustomLog ${APACHE_LOG_DIR}/nextcloud.scivalve.com-access.log combined
  21.  
  22.   SSLEngine On
  23.   SSLCertificateFile /etc/letsencrypt/live/nextcloud.scivalve.com/fullchain.pem
  24.   SSLCertificateKeyFile /etc/letsencrypt/live/nextcloud.scivalve.com/privkey.pem
  25.  
  26.   # Other Apache Configuration
  27.  
  28. </VirtualHost>


10.
  1. systemctl reload apache2

11. SSL Server Test
https://www.ssllabs.com/ssltest/
12. Auto Renew
  1. nano /etc/cron.d/certbot

insert
0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew --renew-hook "systemctl reload apache2"

13. Test Run Renew
  1. certbot renew --dry-run


Update Vertion 13 ---> 15
ทำได้โดย Up ทีละ Version จะ Up ข้ามเลยไม่ได้
13 --> 14 --> 15 (ปัจจุบันถึง Version 18 แล้ว)

วิธี Update เข้าชื่อ admin --> Setting --> Overview --> กด check update
ถ้ามี Version ใหม่จะมีให้กด Open Update แล้วทำตามขั้นตอน เลือก Update Web Browser

ต้องดูคำเตือน ด้วย ถ้าไม่มี Update ได้เลยถ้ามีต้องแก้คำเตือนก่อน

วันอาทิตย์ที่ 23 กุมภาพันธ์ พ.ศ. 2563

Home Assistant : HA Install On Pi Run Play MP3

Home Assistant : HA Install On Pi Run Play MP3
1. Download PI และ Restore ใส่ SD Card นำไป Boot
https://www.raspberrypi.org/downloads/raspbian/

2. ตั้งค่า wifi
https://raspberrypihq.com/how-to-connect-your-raspberry-pi-to-wifi/
ถ้ามี Error แสดง
Wi-Fi is currently blocked by rfkill

ใช้คำสั่ง
  1. sudo rfkill unblock 0
  2. ifconfig wlan0 up

https://www.raspberrypi.org/forums/viewtopic.php?t=206223

3. Set Wifi Connect
  1. iwlist wlan0 scan
  2. nano /etc/wpa_supplicant/wpa_supplicant.conf

เพิ่ม
network={
ssid="SCI_EMP"
psk="XXXXXX"
}
แล้ว reboot เครื่อง Run คำสั่ง
  1. ifconfig wlan0

จะได้ IP

4. Config rapberry pi
เลือก Time zone
  1. open ssh timezone

  1. raspi-config

- เปลี่ยนชื่อ Host ตามที่ต้องการ เช่น pi-moning
- เปิด ssh
และอื่น ๆ
Run set locale
  1. locale-gen en_US en_US.UTF-8 th_TH th_TH.UTF-8

ติดตั้ง ntp และ config ntp

5. ติดตั้ง
https://www.home-assistant.io/docs/installation/raspberry-pi/
Run Command
  1. sudo apt-get update
  2. sudo apt-get upgrade -y
  3. sudo apt-get install python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev
  4. sudo useradd -rm homeassistant -G dialout,gpio,i2c
  5. cd /srv
  6. sudo mkdir homeassistant
  7. sudo chown homeassistant:homeassistant homeassistant
  8. sudo -u homeassistant -H -s
  9. cd /srv/homeassistant
  10. python3 -m venv .
  11. source bin/activate
  12. python3 -m pip install wheel
  13. pip3 install homeassistant


hass ใช้เวลาสักพัก ประมาณ 20-30 นาที
ถ้าขึ้น INFO (MainThread) [homeassistant.core] Timer:starting คือเสร็จแล้ว
6. เข้าหน้า Web ตั้งรหัสผ่าน user
http://ipaddress:8123

7. ทำ hass auto service
ทำต่อจากข้อ 8
https://intranet.sci.com/blog.php?u=281&b=1603
เพิ่มเติม
https://www.home-assistant.io/docs/autostart/systemd/
https://community.home-assistant.io/t/unit-home-assistant-homeassistant-service-not-found/28507

8. Confing configuration.yaml
all config file
  1. cd /home/homeassistant/.homeassistant

คำสั่ง restart service
  1. systemctl restart home-assistant@homeassistant

AIQ
สร้างไฟล aqi.sh
#!/bin/sh
#New Key 20200206 348 Day
result=$(curl -s --location --request GET "api.airvisual.com/v2/city?city=Samut%20Sakhon&state=Samut%20Sakhon&country=Thailand&key=XXXXXXXXXXXXXX")
echo $result | jq -r .data.current.pollution.aqius


สมัครฟรี 10000 ครั้ง/เดือน หมดอายุ 348 วัน XXXX คือคีย์ที่ได้จาก Web
https://www.airvisual.com/thailand/bangkok

9. ติดต้ง jq
  1. sudo apt install jq

10. Code sh ยัดค่าใส่ sensor
  1. nano configuration.yaml

เพิ่ม
#AIQ From aiq.sh
sensor:
- platform: command_line
name: AQI
scan_interval: 3600
command: "/home/homeassistant/.homeassistant/aqi.sh"


11. เล่นเพลง MP3
copy mp3 ไปไว้ตามที่ต้องการ
ติดตั้งโปรแกรม
  1. apt-get install omxplayer

ทดลองเล่นด้วยคำสั่ง
  1. omxplayer /home/pi/MP3/Auto_7.55.mp3

ถ้ามี Error
Error: Unable to open font

ให้ติดตั้ง fonts เพิ่ม
  1. apt-get install libpcre3 fonts-freefont-ttf

https://raspberrypi.stackexchange.com/questions/32755/install-omxplayer-on-the-commandline

จากข้อ 11. user อื่น ๆ เล่นได้แต่พอไป Test run จาก หน้า Web Home Assistant จะไม่ได้ ไม่เล่นเพลง
ต้อง Add user homeassistant เข้า Group ด้วย ไม่อย่างนั้น จะ Error เมื่อเรียกจาก homeassistant
  1. usermod -a -G audio homeassistant
  2. usermod -G video homeassistant

แล้ว reboot เครื่อง

ลอง Run ที่ User homeassistant
  1. su - homeassistant
  2. /usr/bin/omxplayer /home/pi/MP3/1.mp3


12. Fix IP Wifi
https://electrondust.com/2017/11/25/setting-raspberry-pi-wifi-static-ip-raspbian-stretch-lite/
  1. nono /etc/dhcpcd.conf

เพิ่มไว้ล่างสุด
interface wlan0
static ip_address=192.168.0.175
static routers=192.168.0.2
static domain_name_servers=8.8.8.8

แล้ว Reboot เครื่อง

13. configuration.yaml
  1. nano configuration.yaml

shell_command:
auto_normal: /usr/bin/omxplayer /home/homeassistant/.homeassistant/MP3/Auto_7.55.mp3
song_national: /usr/bin/omxplayer /home/homeassistant/.homeassistant/MP3/Song_National.mp3
no_act: /usr/bin/omxplayer /home/homeassistant/.homeassistant/MP3/No_Act.mp3
song_enough: /usr/bin/omxplayer /home/homeassistant/.homeassistant/MP3/Song_Enough.mp3
stop_mp3: bash /home/homeassistant/.homeassistant/stop_mp3.sh


14. scrip.yaml
  1. nano scrip.yaml

'1582256882671':
alias: 1. ^{ ^a ^d ^h ^` ^b ^i ^a ^v Manual
sequence:
- service: shell_command.no_act
- service: system_log.write
'1582256923595':
alias: 2. ^` ^~ ^g ^h ^h ^g ^~ ^` ^~ ^g Manual
sequence:
- service: shell_command.song_enough
'1582256950346':
alias: 3. ^` ^~ ^g ^j ^u Manual
sequence:
- service: shell_command.song_national
'1582259558847':
alias: Stop Sound
sequence:
- data: {}
service: shell_command.stop_mp3


15. automations.yaml
  1. nano automations.yaml

- id: '1582084332514'
alias: 1. ^` ^b ^i ^a ^v ^{ ^a ^u ^{ ^a ^w ^a ^y 7:55
description: ^` ^b ^i ^a ^v ^{ ^a ^u ^` ^{ ^t ^` ^~ ^g ^h ^h ^g ^~ ^` ^~ ^g + ^` ^~ ^g ^j ^u
trigger:
- at: '7:54:57'
platform: time
condition: []
action:
- service: shell_command.auto_normal
initial_state: true
- id: '1582106072377'
alias: 2. ^g ^t ^a ^h ^a 7:30, 7:50 ^a ^` ^{ ^t ^` ^~ ^g ^j ^u 8:00
description: ^{ ^a ^g ^t ^a ^h ^a ^a ^` ^{ ^t ^` ^~ ^g ^j ^u 8:00
trigger:
- at: '7:30:00'
platform: time
condition: []
action:
- data: {}
service: shell_command.no_act
- delay: 00:19:45
- service: shell_command.no_act
- delay: 00:09:45
- service: shell_command.song_national
initial_state: false


***** เพิ่มเติม IP Wifi มีปัญหา ****
พบปัญหา Wifi ที่ Config จาก Service dhcpcd มีปัญหา
เครื่องเปิดปกติทำงานปกติ แต่ Wifi ใช้ไม่ได้เข้าไม่ได้

เปลี่ยนวิธี Config ip wifi ใหม่ ใช้
https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-networking-wifi-static-ip-address

  1. nano /etc/network/interfaces

เพิ่ม
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.175
netmask 255.255.255.0
gateway 192.168.0.2
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


ของ Lan ถ้าต้องการใช้ก็ Fix จากไฟล์นี้เหมือนกัน เช่น
auto eth0
iface eth0 inet static
address 10.1.1.30
netmask 255.255.255.0
gateway 10.1.1.1


แล้วปิด Service dhcpcd ไปให้ไปใช้ network/interfaces แทน
  1. sudo systemctl disable dhcpcd
  2. sudo systemctl enable networking


แล้ว Reboot เครื่อง ก็จะสามารถใช้ IP ที่ Fix ได้