مهم
إذا كنت تقوم بالترقية من الإصدار 7 إلى الإصدار 8، فيرجى التأكد من قراءة قسم الاستخدام، حيث تغيرت أوامر بدء التشغيل!
لوحة نتائج LED لدوري البيسبول الرئيسي. يعرض لوحة النتائج المباشرة لمباراة فريقك في ذلك اليوم.
يتطلب Raspberry Pi ولوحة LED متصلة عبر دبابيس GPIO.
اللوحات المدعومة حاليًا:
إذا كنت ترغب في رؤية الدعم لمجموعة أخرى من أبعاد اللوحة، أو لديك اقتراحات تصميمية لمجموعة موجودة، فأرسل مشكلة!
Pi مع المشكلات المعروفة
يمكنه عرض الألعاب الحية أثناء اللعب، والتدوير اختياريًا كل 15 ثانية خلال كل لعبة في اليوم.
تقوم اللوحة بتحديث قائمة الألعاب كل 15 دقيقة.
إذا لم تبدأ اللعبة بعد، فسيتم عرض شاشة ما قبل المباراة مع الرماة المحتملين.
يمكنه عرض الترتيب للقسم المقدم. نظرًا لأن اللوحة مقاس 32 × 32 صغيرة جدًا بحيث لا يمكنها عرض المكاسب والخسائر معًا، يتم تبديل المكاسب والخسائر على اللوحة كل 5 ثوانٍ. يمكنك أيضًا تحديد "NL Wild Card" أو "AL Wild Card" كقسم لرؤية أفضل 5 فرق في سباق Wild Card لكل دوري.
راجع صفحة wiki الخاصة بالمشروع الأصلي للحصول على دليل خطوة بخطوة. يركز ملف README هذا في المقام الأول على برنامج MLB، ولكن بالنسبة لأولئك القادمين إلى هنا من Reddit أو من أي مكان آخر لم يقوموا أبدًا ببناء أشياء باستخدام Raspberry Pi، فمن المفترض أن يساعدك هذا على المضي قدمًا.
توجد عينة من فاتورة المواد (BOM) هنا
أنت بحاجة إلى Git لاستنساخ هذا الريبو وPIP لتثبيت برنامج لوحة النتائج.
sudo apt-get update
sudo apt-get install git python3-pip
ستستغرق عملية التثبيت هذه حوالي 10-15 دقيقة. Raspberry Pis ليس أسرع أجهزة الكمبيوتر، لذا كن صبورًا!
git clone https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard.git
cd mlb-led-scoreboard/
sudo ./install.sh
سيؤدي هذا إلى إنشاء بيئة بايثون الافتراضية وتثبيت كافة التبعيات المطلوبة. ستكون البيئة الافتراضية موجودة على mlb-led-scoreboard/venv/
.
سيؤدي هذا إلى تثبيت ثنائيات rgbmatrix، التي نحصل عليها من مكتبة أخرى مفتوحة المصدر. إنه يتحكم في العرض الفعلي للوحة النتائج على مصابيح LED. إذا كنت فضوليًا، فيمكنك قراءة وثائقهم حول كيفية عمل جميع العناصر ذات المستوى الأدنى.
سيتم أيضًا تثبيت مكتبات بايثون التالية المطلوبة لتشغيل أجزاء معينة من لوحة النتائج.
تتوفر علامات إضافية لتخصيص التثبيت الخاص بك:
-a, --skip-all Skip all dependencies and config installation (equivalent to -c -p -m).
-c, --skip-config Skip updating JSON configuration files.
-m, --skip-matrix Skip building matrix driver dependency. Video display will default to emulator mode.
-p, --skip-python Skip Python 3 installation. Requires manual Python 3 setup if not already installed.
-v, --no-venv Do not create a virtual environment for the dependencies.
-e, --emulator-only Do not install dependencies under sudo. Skips building matrix dependencies (equivalent to -m)
-d, --driver Specify a branch name or commit SHA for the rpi-rgb-led-matrix library. (Optional. Defaults may change.)
-h, --help Display this help message
تم تصميم البرنامج النصي للتثبيت للأجهزة المادية. عند محاولة تثبيته على منصات أخرى، يجب ألا تستخدم sudo
لتثبيت التبعيات. بالإضافة إلى ذلك، يمكنك تمرير وسيطة --emulator-only
لتخطي خطوات التثبيت غير المطلوبة.
sh install.sh --emulator-only
git pull
في مجلد mlb-led-scoreboard الخاص بك لجلب أحدث التغييرات. في كثير من الأحيان، سيكون هذا كافيًا، ولكن إذا بدا أن هناك شيئًا مكسورًا:sudo ./install.sh
مرة أخرى. سيتم تثبيت أي تبعيات إضافية تمت إضافتها مع التحديث بهذه الطريقة. إذا كنت تنتقل إلى إصدار إصدار رئيسي جديد، أجب بـ "Y" ليقوم بإنشاء ملف تكوين جديد لك.ينبغي أن يكون ذلك! من المفترض أن يعمل الإصدار الأخير لديك الآن مع أي ميزات جديدة تمت إضافتها للتو.
يمكنك التحقق من معلومات الإصدار الخاصة بتثبيت mlb-led-scoreboard عن طريق تشغيل python3 version.py
.
أحدث إصدار من البرنامج متاح هنا.
تأكد من تكوين المنطقة الزمنية لـ Raspberry Pi وفقًا لمنطقتك الزمنية المحلية. غالبًا ما يكون لديهم وقت لندن افتراضيًا. يمكنك تغيير المنطقة الزمنية لـ Raspberry pi الخاص بك عن طريق تشغيل sudo raspi-config
.
يضيف البرنامج النصي للتثبيت سطرًا إلى أعلى main.py
لالتقاط البيئة الافتراضية تلقائيًا. وهذا يعني أن إعادة تنشيط البيئة ( source ./venv/bin/activate
) ليس شرطًا.
sudo ./main.py
يعد التشغيل كجذر بنسبة 100% أمرًا ضروريًا، وإلا فلن يتم عرض المصفوفة.
مستخدمو Adafruit HAT/Bonnet: يجب عليك توفير علامة سطر الأوامر:
sudo ./main.py --led-gpio-mapping="adafruit-hat"
راجع قسم العلامات أدناه للحصول على المزيد من العلامات التي يمكنك تقديمها اختياريًا.
يمكن تشغيل لوحة النتائج على منصات أخرى عن طريق محاكاة البرامج عبر RGBMatrixEmulator
. عند التشغيل عبر المحاكي، لا تحتاج إلى إضافة أوامر بدء التشغيل الخاصة بك مسبقًا باستخدام sudo
:
./main.py
يمكنك أيضًا فرض لوحة النتائج على وضع المحاكاة باستخدام العلامة --emulated
:
./main.py --emulated
عند التشغيل في وضع المحاكاة، يمكنك الاستمرار في استخدام إشارات سطر الأوامر الموجودة لديك كالمعتاد.
راجع RGBMatrixEmulator للتعرف على خيارات تكوين المحاكي.
يتم تضمين ملف config.json.example
الافتراضي كمرجع. انسخ هذا الملف إلى config.json
وقم بتعديل القيم حسب الحاجة.
"preferred": Options for team and division preference
"teams" Array An array of preferred teams. The first team in the list will be used as your 'favorite' team. Example: ["Cubs", "Brewers"]
"divisions" Array An array of preferred divisions that will be rotated through in the order they are entered. Example: ["NL Central", "AL Central"]
"news_ticker": Options for displaying a nice clock/weather/news ticker screen
"always_display" Bool Display the news ticker screen at all times. Supercedes the standings setting.
"team_offday" Bool Display the news ticker when your prefered team is on an offday.
"preferred_teams" Bool Include headlines from your list of preferred teams. Will only use the first 3 teams listed in your preferred teams.
"display_no_games_live" Bool Display news and weather when none of your games are currently live.
"traderumors" Bool Include headlines from mlbtraderumors.com for your list of preferred teams. Will only use the first 3 teams listed in your preferred teams.
"mlb_news" Bool Include MLB's frontpage news.
"countdowns" Bool Include various countdowns in the ticker.
"date" Bool Display today's date to start the ticker. This will always be enabled if no other ticker options are.
"date_format" String Display the date with a given format. You can check all of the date formatting options at https://strftime.org
"standings": Options for displaying standings for a division
"always_display" Bool Display standings for your preferred divisions.
"mlb_offday" Bool Display standings for your preferred divisions when there are no games on the current day.
"team_offday" Bool Display standings for your preferred divisions when the one of your preferred teams is not playing on the current day.
"display_no_games_live" Bool Display standings when none of your games are currently live.
"rotation": Options for rotation through the day's games
"enabled" Bool Rotate through each game of the day according to the configured `rates`.
"scroll_until_finished" Bool If scrolling text takes longer than the rotation rate, wait to rotate until scrolling is done.
"only_preferred" Bool Only rotate through games in your preferred teams.
"only_live" Bool Only rotate through games which are currently playing. Can be composed with `only_preferred`.
"rates" Dict Dictionary of Floats. Each type of screen can use a different rotation rate. Valid types: "live", "pregame", "final".
Float (DEPRECATED) A Float can be used to set all screen types to the same rotate rate.
"while_preferred_team_live": Options for rotating between screens while one of your preferred teams is live
"enabled" Bool Enable rotation while a preferred team is live.
"during_inning_breaks" Bool Enable rotation while a preferred team is live during an inning break.
"weather": Options for retrieving the weather
"apikey" String An API key is required to use the weather service.
You can get one for free at Open Weather Map (https://home.openweathermap.org/users/sign_up).
"location" String The `{city name},{state code},{country code}` according to ISO-3166 standards (https://www.iso.org/obp/ui/#search).
Check out the OpenWeather documentation (https://openweathermap.org/current#name) for more info.
Ex: `"Chicago,il,us"`
"metric_units" Bool Change the weather display to metric units (Celsius, m/s) instead of imperial (Fahrenheit, MPH).
"time_format" String Sets the preferred hour format for displaying time. Accepted values are "12h" or "24h" depending on which you prefer.
"end_of_day" String A 24-hour time you wish to consider the end of the previous day before starting to display the current day's games. Uses local time from your Pi.
"full_team_names" Bool If enabled on a board width >= 64, displays the full team name on the scoreboard instead of their abbreviation. This config option is ignored on 32-wide boards.
"short_team_names_for_runs_hits" Bool If full_team_names is enabled, will use abreviated team names when runs or hits > 9 to prevent overflow of long names into RHE.
"scrolling_speed" Integer Sets how fast the scrolling text scrolls. Supports an integer between 0 and 6.
"preferred_game_update_delay_in_10s_of_seconds" Integer Sets how long to wait before updating the preferred game. Must be positive.
"pregame_weather" Bool If enabled, will display the weather for the game's location on the pregame screen.
"debug" Bool Game and other debug data is written to your console.
"demo_date" String A date in the format YYYY-MM-DD from which to pull data to demonstrate the scoreboard. A value of `false` will disable demo mode.
عمليات التشغيل/الضربات/الأخطاء - تظهر عمليات التشغيل دائمًا على شاشة الألعاب، ولكن يمكنك تمكين أو ضبط التباعد بين شاشة "عمليات التشغيل والضربات والأخطاء". قم بإلقاء نظرة على ملف الإحداثيات التمهيدي للحصول على التفاصيل.
بيانات الملعب - يمكن عرض بيانات الملعب على شاشة اللعبة، راجع الملف التمهيدي للإحداثيات للحصول على التفاصيل. بالإضافة إلى ذلك، يمكن تغيير وصف العرض short
long
في data/pitches.py
بيانات التشغيل السابقة - يمكن عرض بيانات اللعب السابق على شاشة اللعبة. راجع الملف التمهيدي للإحداثيات للحصول على التفاصيل. يمكن تغيير أوصاف اللعب الطويلة والقصيرة في data/plays.py
يمكنك تكوين مصفوفة LED الخاصة بك بنفس العلامات المستخدمة في مكتبة rpi-rgb-led-matrix. يمكن العثور على مزيد من المعلومات حول هذه الوسائط في وثائق المكتبة.
--led-rows Display rows. 16 for 16x32, 32 for 32x32. (Default: 32)
--led-cols Panel columns. Typically 32 or 64. (Default: 32)
--led-chain Daisy-chained boards. (Default: 1)
--led-parallel For Plus-models or RPi2: parallel chains. 1..3. (Default: 1)
--led-pwm-bits Bits used for PWM. Range 1..11. (Default: 11)
--led-brightness Sets brightness level. Range: 1..100. (Default: 100)
--led-gpio-mapping Hardware Mapping: regular, adafruit-hat, adafruit-hat-pwm
--led-scan-mode Progressive or interlaced scan. 0 = Progressive, 1 = Interlaced. (Default: 1)
--led-pwm-lsb-nanosecond Base time-unit for the on-time in the lowest significant bit in nanoseconds. (Default: 130)
--led-show-refresh Shows the current refresh rate of the LED panel.
--led-slowdown-gpio Slow down writing to GPIO. Range: 0..4. (Default: 1)
--led-no-hardware-pulse Don't use hardware pin-pulse generation.
--led-rgb-sequence Switch if your matrix has led colors swapped. (Default: RGB)
--led-pixel-mapper Apply pixel mappers. e.g Rotate:90, U-mapper
--led-row-addr-type 0 = default; 1 = AB-addressed panels. (Default: 0)
--led-multiplexing Multiplexing type: 0 = direct; 1 = strip; 2 = checker; 3 = spiral; 4 = Z-strip; 5 = ZnMirrorZStripe; 6 = coreman; 7 = Kaler2Scan; 8 = ZStripeUneven. (Default: 0)
--led-limit-refresh Limit refresh rate to this frequency in Hz. Useful to keep a constant refresh rate on loaded system. 0=no limit. Default: 0
--led-pwm-dither-bits Time dithering of lower bits (Default: 0)
--config Specify a configuration file name other, omitting json xtn (Default: config)
--emulated Force the scoreboard to run in software emulation mode.
--drop-privileges Force the matrix driver to drop root privileges after setup. (Default: true)
إذا كنت تشعر بالمغامرة (ونحن نشجعها بشدة!)، فإن الأقسام أدناه توضح كيف يمكنك تخصيص لوحة النتائج الخاصة بك وجعلها خاصة بك!
لديك القدرة على تخصيص طريقة وضع الأشياء على اللوحة (ربما تفضل رؤية نص التمرير للعبة ما قبل اللعبة أعلى أو أقل قليلاً). راجع coordinates/
الدليل لمزيد من المعلومات.
لديك القدرة على تخصيص ألوان كل شيء على اللوحة. راجع دليل colors/
لمزيد من المعلومات.
ستستخدم لوحة النتائج هذه واجهة برمجة تطبيقات الطقس لجمع معلومات الطقس في أوقات مختلفة. يتم عرض هذه المعلومات في أيام العطل الخاصة بفريقك في منطقتك ويتم عرضها أيضًا أثناء معلومات ما قبل المباراة لكل لعبة. واجهة برمجة تطبيقات الطقس التي نستخدمها هي من OpenWeatherMaps. تتطلب واجهة برمجة تطبيقات OpenWeatherMaps مفتاح واجهة برمجة التطبيقات لجلب هذه البيانات، لذا ستحتاج إلى قضاء دقيقة سريعة للتسجيل للحصول على حساب ونسخ مفتاح واجهة برمجة التطبيقات الخاص بك إلى config.json
الخاص بك.
يمكنك العثور على صفحة الاشتراك في OpenWeatherMaps على https://home.openweathermap.org/users/sign_up. بمجرد تسجيل الدخول، ستجد علامة تبويب API keys
حيث ستجد أن المفتاح الافتراضي قد تم إنشاؤه لك بالفعل. يمكنك نسخ هذا المفتاح ولصقه في config.json
ضمن "weather"
و "apikey"
.
يمكنك تغيير الموقع المستخدم عن طريق إدخال رمز مدينتك وولايتك وبلدك مفصولاً بفواصل. إذا كنت ترغب في استخدام القياسات المترية، فاضبط خيار "metric"
على true
.
يعتمد هذا المشروع على مكتبتين: MLB-StatsAPI هي مكتبة Python المستخدمة لاسترداد بيانات اللعبة المباشرة. rpi-rgb-led-matrix هي المكتبة المستخدمة لجعل كل شيء يعمل مع لوحة LED.
يتم تحديث لوحة النتائج بشكل متكرر، ولكن لا يمكنها استرداد المعلومات التي لم يقم MLB بإتاحتها بعد. إذا كان هناك شيء غريب أو يبدو متأخرًا، فإن المشتبه به الأول هو MLB web API.
إذا واجهت أية مشكلات ولديك خطوات لإعادة الإنتاج، فافتح مشكلة. إذا كان لديك طلب ميزة، افتح مشكلة. إذا كنت تريد المساهمة بتغيير صغير إلى متوسط الحجم، فافتح طلب سحب. إذا كنت تريد المساهمة بميزة جديدة، فافتح العدد أولاً قبل فتح العلاقات العامة.
تتم إدارة متطلبات التبعيات باستخدام pipreqs
. إذا كنت تقوم بإضافة تبعية أو إجراء تغيير عليها (مثل تحديث إصدارها)، فتأكد من تحديث ملف المتطلبات باستخدام pipreqs
:
# If not already installed
pip3 install pipreqs
pipreqs . --force
يستخدم هذا المشروع اعتبارًا من الإصدار 1.1.0 رخصة جنو العامة. إذا كنت تنوي بيعها، فيجب أن يظل الكود مفتوح المصدر.
النسخة الأصلية من هذا المجلس
مستوحاة من هذه اللوحة، تحقق من لوحة نتائج NHL؟