RiiConnect24 / RiiTag-RPC

A Discord rich presence for RiiTag
https://tag.rc24.xyz
GNU General Public License v3.0
46 stars 5 forks source link

How is RiiTag RPC supposed to work on Raspberry Pi, when there's no Discord client for ARM? #31

Closed libewa closed 1 year ago

libewa commented 1 year ago

When starting riitag-rpc, the app hangs a little, and then crashes with this error:

+-------------------------------------------------------+
RiiTag-RPC failed to start :/ 

Please contact us with this ID so we can help you out:
0ad92d2b-3b8e-4076-85e4-0ad0dcc36d93
+-------------------------------------------------------+

** Original exception was: **
Error in sys.excepthook:
Traceback (most recent call last):
  File "sentry_sdk/integrations/excepthook.py", line 63, in sentry_sdk_excepthook
  File "start.py", line 54, in on_error
TypeError: print_exception() missing 2 required positional arguments: 'value' and 'tb'

Original exception was:
Traceback (most recent call last):
  File "start.py", line 240, in <module>
  File "start.py", line 235, in main
  File "start.py", line 135, in __init__
  File "riitag/presence.py", line 38, in __init__
  File "pypresence/presence.py", line 13, in __init__
  File "pypresence/baseclient.py", line 28, in __init__
pypresence.exceptions.DiscordNotFound: Could not find Discord installed and running on this machine.
[101854] Failed to execute script 'start' due to unhandled exception!

The cause of the error is apparent: Discord is not installed, as it can't run on the Pi's aarch64 architecture. How is this planned? Am I supposed to use box64 or Wine (x64)?

malmeloo commented 1 year ago

Hi,

That's a really good question which I unfortunately do not have an answer to. I added arm64 builds in since it was requested in #27, but if there exists no aarch64 Discord client then I don't know how to run it either. Maybe @TheAlienDrew could shed some light on this.

I am currently still waiting on #29 and #30, but once the rpi binaries are attached to the latest release I'd like to make it more clear that raspberry pi support is based on a best-effort basis. It's simply much too difficult for me to test before every release, and as you can see from those two issues the platform appears to have some weird quirks which do not appear to be present on regular desktops.

libewa commented 1 year ago

got the discord client to run (slowly) using box64 steps for ppl googling:

  1. be on pi 3 or 4 and install 64 bit pi os
  2. get pi-apps: https://github.com/botspot/pi-apps
  3. install box64
  4. download discord tgz: https://discord.com/api/download?platform=linux&format=tar.gz
  5. extract the tgz (to /usr/local/bin/Discord):
    cd ~/Downloads
    sudo tar -xzvf -C /usr/local/bin/Discord
  6. (optional) copy the Discord.desktop file to the Desktop (you'll need to edit the Exec property:
    cp /usr/local/bin/Discord/Discord.desktop ~/Desktop/Discord.desktop
  7. run discord:
    box64 /usr/local/bin/Discord/Discord
  8. profit
libewa commented 1 year ago

btw @DismissedGuy can i make an install script for riiconnect rpc on pi-apps?

malmeloo commented 1 year ago

Sure, although I'd rather not have it in this repo as that would indicate official support. Feel free to put it in your own repo though, I'll put a link to it in the README if you decide to do that.

Edit: nevermind I cannot read, sure feel free to add it to pi-apps :)

libewa commented 1 year ago

kay, pr opened. thx. (i will sleep now)

Andrew-J-Larson commented 1 year ago

When starting riitag-rpc, the app hangs a little, and then crashes with this error:

+-------------------------------------------------------+
RiiTag-RPC failed to start :/ 

Please contact us with this ID so we can help you out:
0ad92d2b-3b8e-4076-85e4-0ad0dcc36d93
+-------------------------------------------------------+

** Original exception was: **
Error in sys.excepthook:
Traceback (most recent call last):
  File "sentry_sdk/integrations/excepthook.py", line 63, in sentry_sdk_excepthook
  File "start.py", line 54, in on_error
TypeError: print_exception() missing 2 required positional arguments: 'value' and 'tb'

Original exception was:
Traceback (most recent call last):
  File "start.py", line 240, in <module>
  File "start.py", line 235, in main
  File "start.py", line 135, in __init__
  File "riitag/presence.py", line 38, in __init__
  File "pypresence/presence.py", line 13, in __init__
  File "pypresence/baseclient.py", line 28, in __init__
pypresence.exceptions.DiscordNotFound: Could not find Discord installed and running on this machine.
[101854] Failed to execute script 'start' due to unhandled exception!

The cause of the error is apparent: Discord is not installed, as it can't run on the Pi's aarch64 architecture. How is this planned? Am I supposed to use box64 or Wine (x64)?

I use ArmCord with it, it's a modded electron client of discord that supports arm: https://github.com/ArmCord/ArmCord

And creates its own rich presence server, which is what I use as an automated means of updating my rich presence without having to think about it.

It works great when you have a Pi setup headless correctly with Riitag-RPC connecting to ArmCord. (despite the occasional re-logins that you have to do for ArmCord)

Andrew-J-Larson commented 1 year ago

Also, here's the script I made for getting things working, at least for my Pi (running 64 bit Raspberry OS)

autostart-armcord-riitag-rpc.sh:

#!/bin/bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "${SCRIPT_DIR}"

# Wait for internet access
while ! ping -q -c 1 "pool.ntp.org" > /dev/null 2>&1; do
  clear
  echo "Waiting for internet connection..."
done

# Start ArmCord
clear
ARMCORD_LOG="/tmp/armcord.log"
nohup armcord >"${ARMCORD_LOG}" 2>&1 &

# Wait for ArmCord
while ! cat "${ARMCORD_LOG}" | grep -qF '[Window state manager] [object Object]'; do
  clear
  echo "Waiting for ArmCord to finish loading..."
done
sleep 30 # rough amount of time needed for the rest of ArmCord to load

# Start RiiTag-RPC
xterm -maximized -e "./riitag-rpc"
Andrew-J-Larson commented 1 year ago

By the way, I have my account set to auto login, and I've put the script to auto start inside of /etc/rc.local

Andrew-J-Larson commented 1 year ago

got the discord client to run (slowly) using box64 steps for ppl googling: 0. be on pi 3 or 4 and install 64 bit pi os

  1. get pi-apps: https://github.com/botspot/pi-apps
  2. install box64
  3. download discord tgz: https://discord.com/api/download?platform=linux&format=tar.gz
  4. extract the tgz (to /usr/local/bin/Discord):
cd ~/Downloads
sudo tar -xzvf -C /usr/local/bin/Discord
  1. (optional) copy the Discord.desktop file to the Desktop (you'll need to edit the Exec property:
cp /usr/local/bin/Discord/Discord.desktop ~/Desktop/Discord.desktop
  1. run discord:
box64 /usr/local/bin/Discord/Discord
  1. profit

When doing this, @libewa, did you ever notice this bug happening? https://github.com/RiiConnect24/RiiTag-RPC/issues/29

Andrew-J-Larson commented 1 year ago
sudo tar -xzvf -C /usr/local/bin/Discord

Also this line is wrong, you should probably fix it @libewa (missing the .tar.gz file in the parameters)

Andrew-J-Larson commented 1 year ago

Also it would probably be worth mentioning that the client needs to be started a few several times before it actually launches (at least while I was testing with booting the client directly from my Downloads folder).