# Raspberry Pi

{% embed url="<https://youtu.be/DKgI4VWSGUM?si=eChZLV6MoFySbS5z>" %}

{% hint style="info" %}
รุ่นที่มีหน่วยความจำน้อยกว่า (RAM) อาจส่งผลให้ประสิทธิภาพช้าลง **แนะนำให้ใช้ Raspberry Pi ที่มีหน่วยความจำอย่างน้อย 4GB**

หากคุณไม่มี Raspberry Pi ให้พิจารณา [เครื่องเสมือน](/english-th/getting-started/quickstart/virtual-machine/virtualbox.md) สำหรับการติดตั้ง

ทางเลือกอื่นคือ [ซื้อ iHost](https://sonoff.tech/products/sonoff-ihost-smart-home-hub/58) ที่จัดส่งพร้อม CUBE OS จากเว็บไซต์ SONOFF หรือ Amazon หากทั้งสองตัวเลือกไม่สะดวก
{% endhint %}

## 1. การเตรียมการ

{% stepper %}
{% step %}
เยี่ยมชม [repo](https://github.com/eWeLinkCUBE/CUBE-OS/releases/) เพื่อนำภาพล่าสุดไปดาวน์โหลด
{% endstep %}

{% step %}
เตรียม [Raspberry Pi](https://amzn.to/2S0Gcl1) และเตรียมอุปกรณ์ตาม [คู่มือ](https://www.raspberrypi.com/documentation/computers/getting-started.html) ของ Raspberry Pi อย่างเป็นทางการ หากคุณมีชุดอุปกรณ์เช่น ตัวเคสและพัดลมระบายความร้อน
{% endstep %}

{% step %}
อุปกรณ์เสริมที่ต้องมีเพิ่มเติม:

1. การ์ด micro SD (TF Card) และเครื่องอ่านการ์ด แนะนำให้ใช้การ์ดที่มีขั้นต่ำเป็น C10 และ A1
2. สายอีเทอร์เน็ต
3. หากคุณต้องการเพิ่มอุปกรณ์ Zigbee ให้เตรียม Zigbee Dongle โดย Dongle ที่ทดสอบแล้วรวมถึง:
4. อะแดปเตอร์ไฟ (หรือถ้ามี PoE Hat ติดตั้งอยู่ ให้แน่ใจว่าสวิตช์หรือเราเตอร์เครือข่าย รวมถึงสายอีเทอร์เน็ต สามารถจ่ายไฟได้เพียงพอ)

{% hint style="info" %}
ตรวจสอบให้แน่ใจว่าคุณมี [แหล่งจ่ายไฟที่เหมาะสม](https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#power-supply) สำหรับ Raspberry Pi โดยอะแดปเตอร์โทรศัพท์มือถือบางรุ่นอาจไม่เหมาะสม เนื่องจากบางรุ่นจ่ายไฟเต็มเฉพาะกับโทรศัพท์ยี่ห้อบางยี่ห้อ พอร์ต USB บนคอมพิวเตอร์มักไม่จ่ายไฟเพียงพอและไม่ควรใช้
{% endhint %}
{% endstep %}
{% endstepper %}

## 2. บันทึก CUBE OS ลงในการ์ด SD

{% stepper %}
{% step %}
ดาวน์โหลดและติดตั้ง Raspberry Pi Imager จาก [เว็บไซต์ Raspberry Pi](https://www.raspberrypi.com/software/).

<img src="/files/45f48c39fb82ed6151f4e9cac4e9e9da89eb9490" alt="" data-size="original">
{% endstep %}

{% step %}
เปิด Raspberry Pi Imager และเลือกอุปกรณ์ Raspberry Pi ของคุณ

<img src="/files/1fb493f3b4ebed9e388bd2f65968ac55ee1616bf" alt="" data-size="original">
{% endstep %}

{% step %}
สำหรับระบบปฏิบัติการ ให้เลือก “Use Custom” และเลือกภาพ CUBE ที่ดาวน์โหลดไว้

<img src="/files/0e37bb447af62e9b5c9e2aac14ae04572ed8e020" alt="" data-size="original">![](/files/631510f495c425011155d60e97f581003daf45f3)
{% endstep %}

{% step %}
ใส่การ์ด SD เข้ากับคอมพิวเตอร์แล้วเลือกเป็นสตอเรจที่ใช้

<img src="/files/4d032d352b5efb6f0065c39871fcaa7d1dba2497" alt="" data-size="original">
{% endstep %}

{% step %}
หากมีตัวเลือกการปรับแต่งปรากฏขึ้น ให้คลิก `NO`.

<img src="/files/2b2a616c0fd4af509fea246425f958063ac04f72" alt="" data-size="original">
{% endstep %}

{% step %}
คลิก “Next” เพื่อเขียนภาพลงในการ์ด SD โปรดทราบว่าข้อมูลบนการ์ดจะถูกเขียนทับ

<img src="/files/9a82aa89e74217ead54c292193b1246715c9a270" alt="" data-size="original">
{% endstep %}

{% step %}
รอจนกระทั่งกระบวนการเขียนถึง 100% แล้วถอดการ์ด SD เมื่อเสร็จสิ้น

<img src="/files/2b084018f91a19ed2204e72327f536df6207bdda" alt="" data-size="original">
{% endstep %}
{% endstepper %}

## 3. บูต Raspberry Pi และการเข้าถึง CUBE:

{% stepper %}
{% step %}
ใส่การ์ด Micro SD ลงใน Raspberry Pi (ด้านสั้นของบอร์ดใกล้ LED)

<img src="/files/23490b9aba9452c138a50ac11faffaffa44cc0df" alt="" data-size="original">
{% endstep %}

{% step %}
เชื่อมต่อ Raspberry Pi กับแหล่งจ่ายไฟและสายอีเทอร์เน็ต โดยให้แน่ใจว่าอยู่ในเครือข่ายเดียวกับคอมพิวเตอร์ของคุณและเชื่อมต่ออินเทอร์เน็ต

<img src="/files/3f3375a4a01e87a75df0e8a89223711ffb3d5dea" alt="" data-size="original">
{% endstep %}

{% step %}
ไม่บังคับ: หากคุณมี Zigbee Dongle ให้เสียบเข้ากับพอร์ต USB

<img src="/files/8ec8e924700f57d0ba3af8c86adf302b549a22f3" alt="" data-size="original">
{% endstep %}

{% step %}
หลังจากจ่ายไฟให้ Raspberry Pi ให้รอไม่กี่นาทีเพื่อให้บูตขึ้น แล้วเข้าหน้าจอจัดการเว็บโดยใช้ [cube.local](http://cube.local).

<img src="/files/f90f41b58e3acc8873e4fb806554818a0df343ba" alt="" data-size="original">

หรือคุณสามารถค้นหา IP ของ CUBE จากอินเทอร์เฟซเราเตอร์ของคุณแล้วใช้เพื่อเข้าหน้าจอจัดการ โดยปกติคุณจะเห็น IP อยู่ข้างอุปกรณ์ที่ชื่อ `cube`ซึ่งมักจะมีระยะเวลาเช่า (Leasetime remaining) เหลือมากที่สุด

<img src="/files/bd22087226129469e4d864f98d74d72d0a53c70a" alt="" data-size="original">
{% endstep %}

{% step %}
เมื่อเข้าถึงสำเร็จ ให้ดูรหัสสั้นๆ บนหน้าการตั้งค่า จากนั้นเข้าหน้าจอจัดการเว็บของ CUBE โดยใช้ cube-{short id}.local ซึ่งมีประโยชน์ในการแยกความแตกต่างของ CUBE หลายเครื่องในเครือข่ายท้องถิ่นเดียวกัน

<img src="/files/0c2c9f07a6d22699fba8aaf4a9010978217101d5" alt="" data-size="original">
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cube.ewelink.cc/english-th/getting-started/quickstart/raspberry-pi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
