bitfocus / companion-pi

Bitfocus Companion enables the reasonably priced Elgato Streamdeck to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
MIT License
28 stars 8 forks source link

Downgrade from 3 to 2.4 Script Failing: Missing yarn Package #26

Closed jreynolds67 closed 7 months ago

jreynolds67 commented 7 months ago

Started with a pre-built CompanionPi image from the downloads page, v3.2. Followed the instructions to clone 2.4 to my Pi.

sudo git clone https://github.com/bitfocus/companion.git -b stable-2.4 /usr/local/src/companion

Ran sudo-companion-update, which gets most of the way there, however fails during package retrieval.

`yarn run v1.22.21 $ ./tools/update.sh You are not currently on a branch. Please specify which branch you want to merge with. See git-pull(1) for details.

git pull <remote> <branch>

Check Node version Found v14.19.0 Node version is OK Core [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... error Error: https://registry.yarnpkg.com/secure-json-logic/-/secure-json-logic-0.9.11.tgz: Request failed "404 Not Found" at ResponseError.ExtendableBuiltin (/opt/fnm/node-versions/v14.19.0/installation/lib/node_modules/yarn/lib/cli.js:696:66) at new ResponseError (/opt/fnm/node-versions/v14.19.0/installation/lib/node_modules/yarn/lib/cli.js:802:124) at Request. (/opt/fnm/node-versions/v14.19.0/installation/lib/node_modules/yarn/lib/cli.js:66218:16) at Request.emit (events.js:400:28) at Request.module.exports.Request.onRequestResponse (/opt/fnm/node-versions/v14.19.0/installation/lib/node_modules/yarn/lib/cli.js:141751:10) at ClientRequest.emit (events.js:400:28) at HTTPParser.parserOnIncomingClient (_http_client.js:647:27) at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17) at HTTPParser.execute () at TLSSocket.socketOnData (_http_client.js:515:22) info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

Manually checked, could not find a package on yarn or npm by the name secure-json-logic.

Julusian commented 7 months ago

Try again I've removed the module which wants that dependency, so it should now be able to install everything

jreynolds67 commented 7 months ago

No change. Started with a fresh image, fresh git clone and ran updater from scratch, got exactly the same error log.

jreynolds67 commented 7 months ago

Screenshot 2024-02-06 at 23 16 33

Julusian commented 7 months ago

Oh, I didn't realise that it would force you to update to a specific release version. I've created a new version v2.4.2b which will hopefully be an option for you to update to. This should work without needing to reset the image

jreynolds67 commented 7 months ago

Still no luck, does not appear in the list. Could I type it in manually into the custom field? It asks: "What git ref?"

Appreciate your help.

Screenshot 2024-02-07 at 15 52 14

Julusian commented 7 months ago

v2.4.2b might work as the ref. Or 53ccee641bcba120aaa6fb85948826e6365b61aa

jreynolds67 commented 7 months ago

That was able to push past that missing dependency, however it looks like it fails during the build. A cursory search tells me that the rU command is depreciated? Terminal output attached. Question as well, the whole point of trying to do this build is to run a module that was not updated for V3. Is there just a V2 pre-built image anywhere that exists? Attempt1 - String.rtf.zip

Julusian commented 7 months ago

Was it the raspberrypi-gpio module you are wanting? It turns out I did start updating that months ago, but never managed to find time to test it. I've pushed the updated code https://github.com/bitfocus/companion-module-raspberry-gpio, if you clone the repository to I think its /opt/module-local-dev on the pi and run yarn inside the clone, it might install itself. I have no idea if it works yet though.

I know it needs some work before it can be included in the official builds, as part of it is picky about where it is compiled

jreynolds67 commented 7 months ago

Haha how'd you know! In all seriousness, yes that is the module. I remember seeing install instructions on where to put things in the issues there, so I'll play around and see what I can find, and I'll see if I can get it installed on 3.2.0. You're awesome, thank you.

jreynolds67 commented 7 months ago

Hey it installed and at least works in the web GUI! Had to follow the instructions listed here as a base: https://github.com/bitfocus/companion-module-raspberry-gpio/issues/10

Steps to install:

  1. Start with fresh 3.2.0 CompanionPi image.
  2. cd /opt/companion-module-dev
  3. sudo git clone https://github.com/bitfocus/companion-module-raspberry-gpio.git
  4. cd companion-module-raspberry-gpio
  5. sudo apt install npm
  6. npm install -g yarn
  7. This part is where getting yarn to install got a little weird because of some permissions issues alluded to in that original issue I linked. I just created/gave permissions to any directories it wanted until it was happy using sudo chown -R $USER . Not sure if it matters, but I ensured that I was in the /opt/companion-module-dev/companion-module-raspberry-gpio when I installed yarn.
  8. yarn add onoff
  9. yarn install
  10. sudo reboot

This gets companion to recognize the module. After playing around, it seems to be working well. It's capable of feedbacks and triggers with no issues I've found yet. Have only tested GPI ins, no outs. Will do more extensive testing.