วันพฤหัสบดีที่ 28 กรกฎาคม พ.ศ. 2565

วิธีการยกเลิก Autoroute เปลี่ยนขนาด width ทองแดง และ Export Gerber ของ Eagle PCB

 ปัญหา เวลา ทำ Autoroute จะมีปัญหา ขนาด ของ ทองแดง กว้าง ขนาด default 10 mil จะเล็กไปสำหรับ โรงงาน และเมื่อปรับมักจะไม่ได้เพราะ ระยะ Gap มันชิดไป

วิธีเลิก route

วิธี ทำ

1. เลือก Group แล้ว 

2. เลือก เลือก บริเวณว่าง

3. กด Mouse ขวาที่รูป ripup group




ตั้ง แสดงขนาด กดที่รูป ตาราง เลือกเป็น mil หรือ mm

ตั้งค่า ก่อน Route ใหม่ กดที่ Netclass

แก้ default เป็นwidth 18 mil และ hole เป็น 25 mil gap เป็น 0.4mm



กด Tool -> Auto Route

จะมี Confime ว่าจะ ก่อนหน้าจะlost ก็ yes ไป 


การ ส่ง Gerber ให้ กดที่ CAM

ก่อนทำไป download ต้ว processor ก่อน ที่ spf_gerber.zip  โดยจะเป็น 2 layer ในหน้า นี้ให้กด File และ เลือก job ที่ file spf_gerber.cam แล้วก็ process Job




จะมี File นามสกุล ตามนี้

ส่งให้ร้าน ทำ PCB ได้

การกำหนด ขนาด board ให้ใช้ Draw line ที่ 
layer 20-Dimension



วันเสาร์ที่ 23 เมษายน พ.ศ. 2565

python สร้าง capture video รูปตัวเอง สำหรับ อัด Video

ต้องลง OpenCv ตาม python version 

import cv2

  

cap = cv2.VideoCapture(1)


# Check if the webcam is opened correctly

if not cap.isOpened():

    raise IOError("Cannot open webcam")


while True:

    ret, frame = cap.read()

    frame = cv2.resize(frame, None, fx=0.25, fy=0.25, interpolation=cv2.INTER_AREA)

    sky = frame[0:200, 70:270]

    sky = cv2.flip(sky,1)

    cv2.namedWindow('Thanaphan',cv2.WINDOW_NORMAL)

    cv2.imshow('Thanaphan', sky)

    cv2.setWindowProperty('Thanaphan', cv2.WND_PROP_TOPMOST, 1)

    c = cv2.waitKey(1)

    if c == 27:

        break


cap.release()

cv2.destroyAllWindows()


วันจันทร์ที่ 11 เมษายน พ.ศ. 2565

Upload file size ของ Node และ IIS

Upload ของ Node จะใช้ express ต้องตั้ง Global ที่ start.js


app.use(express.json({ limit: "150mb" }));

app.use(express.urlencoded({ extended: true, limit: '150mb' }));

และที่ multer

router.post('/upload', userMiddlewares, multer({ dest: 'uploads/', limits: { fileSize: 150000000 } }).single('fileToUpload'), async (req, res, next) => { ....


สำหรับ IIS ต้องตั้งที่ web.config จะใช้ทั้ง Host รวม reverse proxy ด้วย

Request filtering






วันจันทร์ที่ 28 กุมภาพันธ์ พ.ศ. 2565

SQL Server where like ช้อมูลมี []

 กรณี SQL Server where like แบบ [] จะหมายถึง datatable column field ใน [] แต่ถ้า Data มี []

ต้องทำการ ใส่ [[] เข้าไปที่ต้นทาง

Select * from dd where name LIKE 'WC[[]R]S123456'

Select * from dd where nameLIKE 'WC\[R]S123456' ESCAPE '\'



วันพฤหัสบดีที่ 27 มกราคม พ.ศ. 2565

Tunnel ssh ทะลุ Firewall Nat

Tunnel  ssh ในการส่ง data ผ่าน Firewall หรือ nat ไปยังอีกเครื่องโดยใช้ต้วกลาง
การต่อ โดยใช้ Putty แบบ จากเครื่องใน office มี Firewall ต้อง ให้เป็น Remote เช่น Forward ไปที่ Port 9000 เป็นต้น

ถ้าใช้ Tightvnc อย่าลืมต้องไป set Access Control -> Allow Loopback connection


วันศุกร์ที่ 21 มกราคม พ.ศ. 2565

Sharp PM2.5 Sensor

ต้องติดตั้ง
Lib ของDriver for the SSD1306 and SH1106 based 128x64 pixel OLED 


#include <SH1106Wire.h>
#include <OLEDDisplayFonts.h>

#include <OLEDDisplay.h>
#include <SSD1306.h>

#include <SSD1306Wire.h>
#include <OLEDDisplayUi.h>




//#include "SSD1306.h"
int measurePin = 2;
int ledPower = 17;

int samplingTime = 280;
int deltaTime = 40;
int sleepTime = 9680;

float voMeasured = 0;
float calcVoltage = 0;
float dustDensity = 0;
float tDust=0;
SSD1306  display(0x3c, 4, 15);
int loopAvr=5;
void setup(){
 pinMode(16,OUTPUT);
  digitalWrite(16, LOW);    // set GPIO16 low to reset OLED
  delay(50);
  digitalWrite(16, HIGH); // while OLED is running, must set GPIO16 in high
  display.init();

  display.flipScreenVertically();
  display.setFont(ArialMT_Plain_16);
  display.drawString(0,0,"Raw:");
  display.display();
  // for sensor
  Serial.begin(9600);
  pinMode(ledPower,OUTPUT);
}

void loop(){
  digitalWrite(ledPower,LOW); // power on the LED
  delayMicroseconds(samplingTime);

  voMeasured = analogRead(measurePin); // read the dust value

  delayMicroseconds(deltaTime);
  digitalWrite(ledPower,HIGH); // turn the LED off
  delayMicroseconds(sleepTime);

  // 0 - 3.3V mapped to 0 - 1023 integer values
  // recover voltage
  calcVoltage = voMeasured * (3.3 / 1024);

  // linear eqaution taken from http://www.howmuchsnow.com/arduino/airquality/
  // Chris Nafis (c) 2012
  dustDensity = 17.0 *( calcVoltage - 0.1);
 display.clear();
  Serial.print("Raw Signal Value (0-1023): ");
  Serial.print(voMeasured);
  String SerialData="";
SerialData = String(voMeasured,0);
 display.drawString(6,0,SerialData);
  Serial.print(" - Voltage: ");
  Serial.print(calcVoltage);
if(loopAvr==0)
{
 
  String DustData="";
  tDust+=dustDensity;
DustData = String(tDust/5.0,3);
tDust=0;
loopAvr=5;

  Serial.print(" - Dust Density: ");
  Serial.println(dustDensity);
  display.drawString(0,20,"PM2.5");
  display.drawString(50,20,DustData);

 display.display();
} else {
   tDust+=dustDensity; loopAvr--;
  }
  delay(1000);
}

วันอาทิตย์ที่ 26 ธันวาคม พ.ศ. 2564

ตั้งค่า https ให้ IIS

 ไปดาวโหลด

https://github.com/win-acme/win-acme/releases/tag/v2.1.20.1

แล้ว เลือก win-acme.v2.1.20.1185.x64.pluggable.zip

แตกไฟล์ และ run เลือก New Certificate ..

ใน IIS ต้อง แก้ binding เป็นชื่อ Server ด้วย