الدليلGuide ←→ إعداد البوردةBoard setup
إعداد البوردة (ملف التعريف)
Board setup (device profile)
هذه الصفحة تشرح كل زر وخيار في صفحة «إعداد الجهاز» داخل التطبيق — بطريقة مبسّطة يفهمها أي شخص، حتى لو لأول مرة.This page explains every button and option on the “Device setup” screen in the app — in plain terms anyone can follow, even first-time.
1 ما هي هذه الصفحة؟What is this page?
كل بوردة (ESP32 / ESP8266) عبارة عن «عقل» فيه عدّة أطراف كهربائية تُسمّى منافذ GPIO. صفحة الإعداد هي المكان الذي تُخبر فيه البوردة بما هو موصّل بكل طرف — مفتاح إضاءة؟ ديمر؟ إضاءة ملوّنة؟ حسّاس حرارة؟ — وعلى أي منفذ.
Each board (ESP32 / ESP8266) is a small “brain” with several electrical pins called GPIO pins. This page is where you tell the board what's wired to each pin — a light switch? a dimmer? RGB lighting? a temperature sensor? — and on which pin.
بعد أن تحفظ، تُكتب هذه التعريفات داخل البوردة وتُقفل بشكل دائم، فتعرف البوردة وظيفتها وتعمل وحدها حتى بدون إنترنت.
Once you save, these definitions are written into the board and locked permanently, so it knows its job and runs on its own — even with no internet.
2 كيف تفتح الصفحةHow to open the page
- أثناء إضافة جهاز جديد: تظهر تلقائيًا للوحدة الجديدة التي لم تُعرَّف بعد.
- لاحقًا: اضغط مطوّلًا على الجهاز ← إعداد الوحدة، أو من شاشة «الجهاز يحتاج إعداد» اضغط إضافة التعريفات.
- بالأعلى يمين الصفحة زر ؟ يفتح هذا الشرح في أي وقت.
- While adding a new device: it opens automatically for a new, unconfigured unit.
- Later: long-press the device → Configure unit, or from the “Device needs setup” screen tap Add definitions.
- A ? button at the top of the page opens this guide any time.
الصفحة فيها ثلاثة تبويبات بالأعلى:The page has three tabs at the top:
| التبويب | ماذا يحتوي |
|---|---|
| القنوات | تعريف كل مخرج/مدخل (الأهم — ابدأ من هنا) |
| الإعدادات | سلوك متقدّم للمفاتيح والريليه (اختياري) |
| العتاد | اسم المشروع ومنافذ الأزرار والمؤشّرات (اختياري) |
| Tab | What it holds |
|---|---|
| Channels | Define each output/input (the important one — start here) |
| Settings | Advanced switch and relay behaviour (optional) |
| Hardware | Project name, button and indicator pins (optional) |
3 البداية السريعة بالقوالب الجاهزةQuick start with ready templates
أسهل طريقة على الإطلاق. في أعلى تبويب القنوات ستجد صفًّا من القوالب الجاهزة تتنقّل بينها بالسحب يمينًا/يسارًا.
By far the easiest way. At the top of the Channels tab you'll find a row of ready templates you swipe through.
- افتح تبويب القنوات (أول تبويب بالأعلى).
- اسحب صفّ القوالب لتشاهد كل الخيارات، ثم اضغط القالب الذي يطابق بوردتك (مثلًا «4 مفاتيح»).
- سيملأ التطبيق القنوات فورًا، ويختار منافذ GPIO المتاحة تلقائيًا، ويسمّيها أسماءً افتراضية (مفتاح 1، مفتاح 2…).
- انزل لقائمة القنوات بالأسفل وعدّل الأسماء لتصير واضحة (مثلًا «إضاءة الصالة»). اختياري.
- تأكّد أن شريط الملخّص بالأعلى أخضر بدون تنبيهات، ثم اضغط إنشاء ملف التعريف.
- Open the Channels tab (the first tab at the top).
- Swipe the template row to see all options, then tap the template that matches your board (e.g. “4 switches”).
- The app fills the channels instantly, picks free GPIO pins automatically, and gives them default names (Switch 1, Switch 2…).
- Scroll to the channel list below and edit the names to be clear (e.g. “Living-room light”). Optional.
- Check the summary bar at the top is green with no warnings, then tap Create profile.
الجدول التالي يوضّح أي قالب يناسب أي حالة:This table shows which template fits which case:
| القالب | يناسب |
|---|---|
| مفتاح واحد | إضاءة أو جهاز واحد |
| مفتاحان / 4 / 6 مفاتيح | لوحات المفاتيح المتعددة |
| إضاءة معتّمة (ديمر) | إضاءة قابلة للتعتيم |
| إضاءة RGB | إضاءة ملوّنة (3 منافذ) |
| ستارة | ستارة/شتر كهربائي (فتح وغلق) |
| حسّاس حرارة | حسّاس حرارة ورطوبة DHT |
| مفاتيح + حسّاس | 3 مفاتيح مع حسّاس حرارة |
| Template | Best for |
|---|---|
| Single switch | One light or appliance |
| 2 / 4 / 6 switches | Multi-gang switch panels |
| Dimmable light | A light you can dim |
| RGB light | Colour lighting (3 pins) |
| Curtain | Motorised curtain / shutter (open & close) |
| Temperature sensor | A DHT temperature & humidity sensor |
| Switches + sensor | 3 switches with a temperature sensor |
4 القنوات وأنواعهاChannels & their types
كل قناة (سطر) لها: اسم تختاره، ونوع يحدّد ما هو الموصّل، ومنفذ GPIO واحد أو أكثر. اختر النوع «بلا» لأي قناة غير مستخدمة.
Each channel (row) has: a name you choose, a type that says what's connected, and one or more GPIO pins. Set the type to “None” for any unused channel.
تعريف قناة يدويًا — خطوة بخطوة
Defining a channel by hand — step by step
- اضغط على خانة النوع في القناة، واختر ما هو موصّل بها (مثلًا «تشغيل/إيقاف» لمفتاح إضاءة).
- اضغط على خانة GPIO واختر رقم المنفذ الذي وصّلت إليه السلك على البوردة.
- لو النوع RGB ستظهر خانتان إضافيتان (G وB) — حدّدهما. ولو ستارة ستظهر خانة «منفذ الخفض».
- لو النوع حرارة/رطوبة (DHT) اختر نوع الحسّاس الذي وصّلته: DHT22 (AM2302) أو DHT11.
- اكتب اسمًا واضحًا للقناة في الخانة العلوية.
- كرّر لكل قناة مستخدمة، واترك الباقي على «بلا».
- Tap the channel's Type field and choose what's wired to it (e.g. “On/Off” for a light switch).
- Tap the GPIO field and pick the pin number you wired the cable to on the board.
- For type RGB, two extra fields appear (G and B) — set them. For Curtain, a “down pin” field appears.
- For type Temp/Humidity (DHT), choose the sensor type you connected: DHT22 (AM2302) or DHT11.
- Type a clear name for the channel in the top field.
- Repeat for each used channel, and leave the rest on “None”.
| النوع | الاستخدام | عدد المنافذ |
|---|---|---|
| تشغيل/إيقاف | مفتاح إضاءة أو جهاز عادي (ريليه) | 1 |
| باهت (ديمر) | إضاءة قابلة للتعتيم | 1 |
| مروحة | مروحة بسرعات | 1 |
| إضاءة RGB | إضاءة ملوّنة (أحمر/أخضر/أزرق) | 3 (R + G + B) |
| شريط RGB | شريط LED ملوّن (WS2812) + عدد اللمبات | 1 (منفذ البيانات) |
| ستارة | ستارة/شتر — رفع وخفض | 2 (رفع + خفض) |
| حرارة/رطوبة (DHT) | حسّاس حرارة ورطوبة | 1 |
| تناظري | قراءة حسّاس تناظري (قيمة متغيّرة) | 1 |
| رقمي | مدخل رقمي (باب/حركة: مفتوح/مغلق) | 1 |
| Type | Use | Pins |
|---|---|---|
| On/Off | A light switch or plain appliance (relay) | 1 |
| Dimmer | A dimmable light | 1 |
| Fan | A multi-speed fan | 1 |
| RGB light | Colour light (red/green/blue) | 3 (R + G + B) |
| RGB strip | Addressable LED strip (WS2812) + LED count | 1 (data pin) |
| Curtain | Curtain / shutter — up and down | 2 (up + down) |
| Temp/Humidity (DHT) | Temperature & humidity sensor | 1 |
| Analog | An analog sensor reading (variable value) | 1 |
| Digital | A digital input (door/motion: open/closed) | 1 |
5 ما هو منفذ GPIO؟What is a GPIO pin?
GPIO هو رقم الطرف الكهربائي على البوردة الذي وصّلت إليه السلك. عند توصيل المفتاح أو الحسّاس بالبوردة، تكون قد وصّلته إلى رقم منفذ معيّن — اختر نفس الرقم هنا.
A GPIO is the number of the electrical pin on the board that you wired the cable to. When you connect a switch or sensor to the board, you connect it to a specific pin number — choose that same number here.
كيف تعرف رقم المنفذ؟
How do you find the pin number?
- انظر إلى البوردة نفسها — الأرقام مطبوعة بجانب الأطراف (مثل
D5أوGPIO14أو رقم فقط). - الرقم الذي وصّلت إليه سلك المفتاح/الجهاز هو ما تختاره في خانة GPIO.
- لو لم تركّب الأسلاك بعد، استخدم قالبًا جاهزًا ودع التطبيق يقترح المنافذ، ثم وصّل أسلاكك على نفس الأرقام التي ظهرت.
- Look at the board itself — the numbers are printed next to the pins (like
D5,GPIO14, or just a number). - The number you wired the switch/device cable to is what you pick in the GPIO field.
- If you haven't wired yet, apply a template and let the app suggest the pins, then wire to the same numbers it shows.
6 مفتاح الحائط الإضافي (اختياري)Extra wall switch (optional)
لأي قناة من نوع تشغيل/إيقاف يمكنك إضافة مفتاح حائط فيزيائي — أي مفتاح الإضاءة التقليدي على الحائط — فيتحكّم في نفس الخرج جنبًا إلى جنب مع التطبيق. اختر له منفذ GPIO الخاص به في خانة «مفتاح حائط».
For any On/Off channel you can add a physical wall switch — the traditional light switch on the wall — so it controls the same output alongside the app. Give it its own GPIO pin in the “Wall switch” field.
7 تبويب «الإعدادات» (متقدّم)The “Settings” tab (advanced)
هذه الخيارات تضبط طريقة عمل المفاتيح والريليه حسب تركيبتك الكهربائية. اتركها كما هي إن لم تكن متأكدًا — القيم الافتراضية تناسب معظم اللوحات.
These options tune how the switches and relays behave for your wiring. Leave them as-is if unsure — the defaults suit most boards.
| الإعداد | الوظيفة | افتراضي |
|---|---|---|
| اسم شبكة الإعداد | اسم نقطة الواي فاي التي تنشئها الوحدة عند الإعداد | UNIT |
| وضع المفاتيح | عادي / ثلاثي (تتبّع الحالة الحقيقية) / ضغط (زر لحظي) | عادي |
| معالجة المفاتيح | استطلاع (ثابت، موصى به) / مقاطعات (أسرع) | استطلاع |
| توصيل المفاتيح | رفع (Pull-up) / خفض (Pull-down) | رفع |
| وضع المرحّلات | فعّال-مرتفع / فعّال-منخفض | فعّال-مرتفع |
| سلوك مؤشّر الواي فاي | الحالة (يضيء حسب الاتصال) / صامت (مطفأ) | الحالة |
| توصيل مؤشّرات LED | فعّال-مرتفع / فعّال-منخفض | فعّال-مرتفع |
| توصيل زر الإعداد | رفع / خفض | رفع |
| Setting | What it does | Default |
|---|---|---|
| Setup network name | Name of the Wi-Fi access point the unit creates during setup | UNIT |
| Switch mode | Normal / three-way (follow real state) / push (momentary) | Normal |
| Switch handling | Polling (stable, recommended) / interrupts (faster) | Polling |
| Switch wiring | Pull-up / pull-down | Pull-up |
| Relay mode | Active-high / active-low | Active-high |
| Wi-Fi LED behaviour | Status (lights by connection) / silent (off) | Status |
| LED wiring | Active-high / active-low | Active-high |
| Setup-button wiring | Pull-up / pull-down | Pull-up |
8 تبويب «العتاد» (متقدّم)The “Hardware” tab (advanced)
هنا تحدّد منافذ الأزرار والمؤشّرات والمستقبِلات على البوردة:Here you set the pins for buttons, indicators and receivers on the board:
| العنصر | الوظيفة |
|---|---|
| المشروع | اسم وصفي للوحة (مثلًا «غرفة المعيشة») |
| زر الإعداد | منفذ زر الدخول لوضع الإعداد |
| مؤشّر حالة الواي فاي | لمبة تبيّن حالة الاتصال |
| مؤشّر الإعداد / السحابة | لمبات حالة إضافية (اختياري) |
| مستقبل RF 433 ميجاهرتز | لاستقبال الريموتات والحسّاسات اللاسلكية |
| مستقبل الأشعّة (IR) | لاستقبال أوامر ريموت الأشعّة |
| Item | What it's for |
|---|---|
| Project | A descriptive name for the board (e.g. “Living room”) |
| Setup button | Pin for the button that enters setup mode |
| Wi-Fi status LED | An LED that shows connection state |
| Setup / cloud LED | Extra status LEDs (optional) |
| 433MHz RF receiver | For receiving remotes and wireless sensors |
| Infrared (IR) receiver | For receiving IR remote commands |
10 الحفظ والقفلSave & lock
- راجع شريط الملخّص بالأعلى — يبيّن عدد القنوات وأي تعارض في المنافذ.
- تأكّد من عدم وجود تنبيه أحمر (منفذ مكرّر، أو RGB/ستارة ناقصة منافذ).
- اضغط إنشاء ملف التعريف بالأسفل.
- تُرسَل التعريفات إلى البوردة وتظهر القنوات في التطبيق فورًا. ✅
- Review the summary bar at the top — it shows the channel count and any pin conflicts.
- Make sure there's no red warning (a duplicate pin, or an RGB/curtain missing pins).
- Tap Create profile at the bottom.
- The definitions are sent to the board and the channels appear in the app instantly. ✅
? حلّ المشكلاتTroubleshooting
تنبيه «منفذ GPIO مستخدم أكثر من مرة»؟
اخترت نفس رقم المنفذ في قناتين. غيّر إحداهما إلى رقم آخر متاح حتى يختفي التنبيه الأحمر.
«القناة تحتاج منافذ R وG وB»؟
إضاءة RGB تتطلّب ثلاثة منافذ. أكمل تحديد المنافذ الثلاثة (G وB بعد المنفذ الأساسي).
«الستارة تحتاج منفذي رفع وخفض»؟
حدّد منفذ الرفع ومنفذ الخفض معًا للستارة.
«عيّن نوعًا ومنفذ GPIO لقناة واحدة على الأقل»؟
كل القنوات مضبوطة على «بلا». فعّل قناة واحدة على الأقل بنوع ومنفذ — أو استخدم قالبًا جاهزًا.
أريد تغيير الإعداد بعد الحفظ؟
ملف التعريف مقفول. يجب إعادة رفع السوفت وير على البوردة (مسح الذاكرة + برمجة من جديد) لإعادة الإعداد.
“GPIO pin used more than once” warning?
You picked the same pin number on two channels. Change one to another free number until the red warning clears.
“Channel needs R, G and B pins”?
RGB lighting needs three pins. Finish setting all three (G and B after the main pin).
“Curtain needs up and down pins”?
Set both the up pin and the down pin for the curtain.
“Set a type and GPIO for at least one channel”?
All channels are on “None”. Enable at least one with a type and pin — or use a ready template.
I want to change the setup after saving?
The profile is locked. You must re-flash the board (erase memory + reprogram) to set it up again.