# STEP 1 : Setting auto boot Wifi

<figure><img src="/files/4qTyLpQLeoj0nnFpC2DH" alt=""><figcaption></figcaption></figure>

หลายคนคงเจอปัญหาที่บอร์ดทดสอบปิดไปแล้ว หรือไฟดับ เพื่อนเรากดปิดบอร์ดแล้วเราต้องต่อจอเพื่อเปิด Terminal ในการเชื่อมต่อ Wifi ใหม่อีกครั้งสามารถนำวิธีในการทดลองนี้ไปประยุกต์ใช้กับงานอื่นๆที่ต้องการให้ทำการรันโปรแกรมอัตโนมัติได้เช่นกัน แต่เป็นการใช้แบบชั่วคราวถ้าจะเป็นโปรดัคจริงควรใช้เป็น Linux service หรือ Docker service ในการมาจัดการระบบ

1. เริ่มจากการที่นิสิตต่อจอและอุปกรณ์ต่อพ่วงต่างๆ กับบอร์ดทดสอบให้เรียบร้อย แล้วทำการเปิดเครื่อง&#x20;

{% hint style="success" %}
ถ้าจำไม่ได้กลับไปทบทวนบทที่ขั้นตอนที่ 2 ของการทดลองในคราวก่อน --> [Link](/fpga-design/c-c++-programming-on-ultra96v2-fpga-board/application-c-c++-on-ultra96v2-part-1/step-2-bring-up-ultra96v2.md)
{% endhint %}

2. ให้ทำการแก้ไขไฟล์ที่ชื่อว่า .bashrc ซึ่งไฟล์นี้จะเป็นตัวคอยจัดการให้ทำการรันคำสั่งที่เราเขียนไว้ก่อนที่จะเปิด Terminal ในทุกๆครั้ง&#x20;

{% hint style="danger" %}
ตรวจสอบไฟล์ wpa\_supplicant.sh ว่ารหัสไวไฟที่แชร์ Hotspot นั้นเป็น Hotspot ที่แชร์สัญญาณไวไฟอยู่
{% endhint %}

{% code title="Terminal" %}

```bash
# Write the comment to .bashrc
$ echo "# Setting Wifi from User" >> .bashrc
# Write running wifi routing script
$ echo "./wifi.sh" >> .bashrc
```

{% endcode %}

3. หลังจากนั้นให้ทดสอบการทำงานโดยการ reboot เพื่อทดสอบการเชื่อมต่อ Wifi

{% code title="Terminal" %}

```
# Reboot Ultra96v2 board
$ reboot
```

{% endcode %}

เราก็จะสามารถทำการเชื่อมต่อไวไฟได้อัตโนมัติซึ่งสามารถนำไปประยุกต์ใช้กับการใช้งานอื่นๆ ได้อีกในการตั้งค่า .bashrc เพื่อ auto command ในการทำงาน


---

# 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://docs.aic-eec.com/fpga-design/c-c++-programming-on-ultra96v2-fpga-board/application-c-c++-on-ultra96v2-part-2/step-1-setting-auto-boot-wifi.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.
