vasani-arpit / WBOT

A simple Web based BOT for WhatsApp™ in NodeJS 😜. Working as of 📅 Feb 4th, 2024
Other
980 stars 314 forks source link

WBOT-Linux to Raspberry PI ARM #354

Open chalfling opened 10 months ago

chalfling commented 10 months ago

Is your feature request related to a problem? Please describe. I've tried to build and run on my raspberry pi 3, but got some errors.

Describe the solution you'd like Release a ARM version.

vasani-arpit commented 10 months ago

Haven't worked with ARM before. How can I test it?

lucasvmx commented 10 months ago

Haven't worked with ARM before. How can I test it?

You can test it by running WBot inside a docker container. https://github.com/lukechilds/dockerpi

lucasvmx commented 10 months ago

Is your feature request related to a problem? Please describe. I've tried to build and run on my raspberry pi 3, but got some errors.

Describe the solution you'd like Release a ARM version.

1) What's your nodeJS version? node --version 2) What commands did you run? 3) What's your raspbian version? cat /etc/os-release

chalfling commented 10 months ago

Is your feature request related to a problem? Please describe. I've tried to build and run on my raspberry pi 3, but got some errors. Describe the solution you'd like Release a ARM version.

  1. What's your nodeJS version? node --version v12.22.9
  2. What commands did you run? node src/index.js
  3. What's your raspbian version? cat /etc/os-release PRETTY_NAME="Ubuntu 22.04.2 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.2 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
vasani-arpit commented 10 months ago

okay. CI/CD pipelines in wbot are written in docker also. You can experiment with it.

Take a look at this folder https://github.com/vasani-arpit/WBOT/tree/master/.github/build

There is a command npm run pack which is responsible for making a binary. Instead of making an binary you can directly run the source in raspberry pi using command npm run start

Let me know if you have any doubts.

chalfling commented 10 months ago

npm run start

npm run start

wbot@0.43.0 start node src/index.js

/home/ubuntu/WBOT/src/index.js:396 const data = msg?.body; ^

SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) at internal/main/run_main_module.js:17:47

lucasvmx commented 10 months ago

Is your feature request related to a problem? Please describe. I've tried to build and run on my raspberry pi 3, but got some errors. Describe the solution you'd like Release a ARM version.

  1. What's your nodeJS version? node --version v12.22.9
  2. What commands did you run? node src/index.js
  3. What's your raspbian version? cat /etc/os-release PRETTY_NAME="Ubuntu 22.04.2 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.2 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

Maybe WBOT is just unable to be executed correctly with nodeJS 12.x. Try upgrading your node version to at least the maitanance LTS version (16.x). After doing that, try running WBOT again and tell us

curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
node -v