Does anyone here have any experience installing NodeJS on an Organelle? If so, any tips / advice that you can share?
Steps to follow and a pointer to the best (or any?) source of precompiled packages would be great (a boy can dream). Or is the answer more like “cross compile and install it manually?”
I was looking into this… Thought it might be nice to include in the next OS update.
The Organelle M is based on the Raspbian distro with minimal modifications, so generally installing software is the same as on the Raspberry Pi.
For NodeJS, it looks like folks are grabbing the packages maintained by NodeSource. This should do it:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
Thanks for this. I went ahead and tried it, and unfortunately ran into difficulty. I’m still looking into it and just wanted to drop a note here as a possible warning to others.
I started out following the directions, except with
setup_12.x since Node 12 went LTS about a month ago… and found at the end that the script had installed Node 8 and failed to install
npm at all. I then went back and tried doing
setup_10.x, and it reported back that
nodejs is already the newest version (8.11.1~dfsg-2~bpo9+1).
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
I looked at the issue tracker, and it seems like others have had similar weirdness.
I dug into this a little more, and it turns out the
curl command was failing on the Organelle due to a certificate validation issue, and so the setup never ran, which meant that the
apt-get didn’t try to get the right version of Node.
curl failure was the — initially surprising — error
certificate is not yet valid. It took me a couple beats to figure out what was going wrong…
… (spoiler alert?) …
The Organelle doesn’t have a clock that remembers the date (that is, no battery backup or what-have-you), it’s not configured to get set/updated when connected to a network[*], and it just gets set to what’s presumably the date/time around when the OS build was made (June of 2019 for me) on every boot.
I’d never tried to set the date, leaving my Organelle with the impression that “now” was last June. After manually running
sudo date --set... the original instructions from @oweno, updated to go for Node 12, worked like a charm.
[*] Feature request?
Ah, yes… Thanks for the update. I must have set the date manually at some point before running the commands. Having an incorrect date makes the system unworkable and annoying in so many ways! We’ve been working on a bunch of OS updates so I’ll try to get network time stuff fixed as well.
The inevitable update:
Please see https://github.com/danfuzz/fuzz-synth/tree/master/organelle-node-test for an installable patch written in Node. It does (practically) nothing, beyond sniff at OSC.
I am now of course curious about the recommended way to receive and send audio data!
README reproduced below for the curious and lazy.
Happy T-Day for them what celebrates it.
This is a work-in-progress to demonstrate the use of Node to implement a patch on an Organelle. As of this writing, it does nothing other than update the display with an increasing count and a bit of detail of received OSC messages. It’s also pretty janky. Notably, it does not receive or send audio data.
The one thing it does sensibly is that it will quit itself if it receives a
/quit message (or any message whose name begins with
/quit, really), since otherwise the Organelle OS gets forlorn and confused, and maybe even just a little depressed.
You need to have Node 12 installed on your Organelle for this to work. Find some details about that here: https://forum.critterandguitari.com/t/nodejs/5146
Build and Install
You need to have a relatively recent version of Node installed on your local (desktop / laptop) machine. Run the script
scripts/build on your machine, and then copy the entire contents of this directory to a directory under
Patches on your Organelle.
When you run it, in addition to spewing a bit of data to the display, it writes out the contents of received OSC messages to the file
output.txt in the patch directory.