Jump to content

Discord bot c поддержкой WOL (на финальной прошивке с opkg Keenetic Giga 1 - белый)


Recommended Posts

Доброго дня!

В связи со сложностями обхода блокировок ТГ в РФ (туториал по заведению бота с форума без плясок не работает, adsl РТК ку), для альтернативности, да и для удобства, появилась задачка запускать пакеты WOL с помощью Discord-бота, которого можно поселить в прошивке.

Нашел на просторах github следующую реализацию: Sheera,

Скрытый текст

Sheera

What is Sheera? Sheera is the replacement for Raspberry Discord Bot, written in top of Klasa.

Features

Basic Wake On Lan command to turn on a PC given a MAC address with an exec command. Both limited to bot owner.

Requirements

  • git command line (Linux) installed
  • node Version 8.5.0 or higher
  • A Raspberry PI, Odroid, or similar, with Linux and wakeonlan installed. (apt install wakeonlan)

Downloading

In a command prompt in your projects folder (wherever that may be) run the following:


git clone https://github.com/kyranet/Sheera.git

Once finished:

  • In the folder from where you ran the git command, run cd Sheera and then run npm install
  • Rename config.json.example to config.json
  • Edit config.json and enter your bot token and the YouTube Search API token.

однако на установленной на моем стареньком белом роутере версии прошивке (v2.04(USD.8)C7) в репозитории http://pkg.entware-keenetic.ru/binaries/keenle/Packages.gz есть node только версии 6.11.2-3

Скрытый текст

 


~ # opkg -v
opkg version 0.1.8
~ # opkg info node
Package: node
Version: v6.11.2-3
Depends: libc, libssp, libstdcpp, libopenssl, zlib, libpthread, librt, libuv
Status: install user installed
Section: lang
Architecture: keenle
MD5Sum: 0d2fe0a8c8d1090d965af30275fbcd62
Size: 4370993
Filename: node_v6.11.2-3_keenle.ipk
Description: Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses
 an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js'
 package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
Installed-Time: 1552250370

~ # opkg info node-npm
Package: node-npm
Version: v6.11.2-3
Depends: libc, libssp, node
Status: install user installed
Section: lang
Architecture: keenle
MD5Sum: 3ee83162999dc0ee8f53b7d1012a4adb
Size: 2283558
Filename: node-npm_v6.11.2-3_keenle.ipk
Description: NPM is the package manager for NodeJS
Installed-Time: 1552250423

 

Несмотря на требование версии node я все же попытался поставить данного бота (были установлены пакеты git - 2.15.1-1; git-http - 2.15.1-1; node - v6.11.2-3; node-npm - v6.11.2-3, wakeonlan - 0.41-1), но на этапе разворачивания npm install процесс останавливается :(

~ # cd /opt/home/bot/Sheera/
/opt/home/bot/Sheera # npm install
Aborted

Подскажите, есть ли возможность как-либо иначе залить в opkg ipk-пакет нужной версии node? Подозреваю, что да, но как сделать - не знаю :35_thinking:

Edited by Gromex
тема
Link to comment
Share on other sites

В 12.03.2019 в 00:31, Александр Рыжов сказал:

Почему решили, что ошибка "Aborted" из-за определённой версии node.js?

Какой размер swap'а задействован на стареньком белом роутере?

Я просто не знаю причину, предположил.

~ # df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                    4608      4608         0 100% /
/dev/root                 4608      4608         0 100% /
/dev/mtdblock/7           2048       196      1852  10% /storage
/dev/sda1              4031680     84648   3742232   2% /tmp/mnt/zystor
/dev/sda2             11533308   1865856   9667452  16% /tmp/mnt/kesha
/dev/sda1              4031680     84648   3742232   2% /opt

 

~ # swapon -s
swapon: invalid option -- s
BusyBox v1.25.1 () multi-call binary.

Usage: swapon [-a] [-e] [DEVICE]

Start swapping on DEVICE

        -a      Start swapping on all swap devices
        -e      Silently skip devices that do not exist

 # cat  /proc/swaps
Filename                                Type            Size    Used    Priority
~ #

Видимо он не включался с момента перепрошивки.. Как еще можно посмотреть swap?

Как безопасно включить?

 

Edited by Gromex
Link to comment
Share on other sites

В топике тишина, поэтому я взялся экспериментировать. Попытался я создать swap файл..

~ # dd if=/dev/zero of=/opt/swapfile bs=1M count=128
~ # chmod 600 /opt/swapfile
~ # mkswap /opt/swapfile
~ # swapon /opt/swapfile

сам файл успешно записался и отметился

~ # cat /proc/swap
Filename                                Type            Size    Used    Priority
/opt/swapfile                           file            131064  0       -1

однако воспользоваться им похоже не выйдет, /etc/fstab отсутствует в прошивке и неприменим

~ # swapon -a
swapon: can't open '/etc/fstab': No such file or directory

 

Ошибка "Aborted" сохраняется.

Может я что-то не так делаю? Опыт скромный, поэтому мне и нужна помощь.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...