akc42 / pi_record

ffmpeg and nodejs based audio recorder with web based interface to start and stop recordings and to show audio volume
GNU General Public License v3.0
1 stars 0 forks source link

Install instructions #22

Open tizfra opened 1 year ago

tizfra commented 1 year ago

Hi, how can I install your project on my raspberry pi 4? Can you write tutorial?

akc42 commented 1 year ago

@tizfra Wow, you are the first person to take an interest in this project since I first wrote it 3 years ago.

Start with the files in the docs directory. In particular there is quite lot about creating and setting up a btrfs filesystem on the sd card. I think I dumped a load of files from another project (so refers to PAS on pas.accuvision.local) which is built with the same principles.

There is quite a lot and some of it is repeated. Start with the README and if necessary the BTRFS_Readme, but you could also look at the setup.tex file. Its in latex but you can still read the raw code and get a good ideal (the setup.pdf file is an earlier version from the other project - which could help you get an idea of what the raw text converts into)

I'm a bit busy at the moment, but if you ask questions (in this thread) or I get some time, I'll try to be more specific and improve them.

tizfra commented 1 year ago

Thanks for the quick answer, I've read all the readme files, but I can't find how i can install the recorder. Can you help me? Where can I find how i can build your.json project?

Can I install recorder in a not-btrfs system?

akc42 commented 1 year ago

@tifra I pretty sure it will run on any filesystem. I use btrfs because of its ability to take snapshot backups

I am not sure where your at in terms of having set up your pi. Install raspbian and make sure you can reference it on you home network via a name (I have mine setup on my home network as recorder.home as I'm running another raspberry pi as a dhcp and dns server (and mail and etc etc...)

set it up so you can ssh into the pi account with a password less key pair. (use ssh-keygen to generate a public and private key pair you can use). Also see Set up SSH Keys to avoid having to enter a password on each connection section in docs/setup.tex

keep reading to see how to set up so you can access the root account via the same ssh keys. (THIS IS NOT NECESSARY, but can be a help in getting backups off the machine, and avoiding the use of sudo all the time)

further reading shows upgrading and rebooting before finally installing the software that you need from the pi account

sudo apt-get install git htop wget nginx rsync tar anacron ffmpeg (you don't need git any more on the actual box itself, tar and anacron are only related to backup and can be ignored.

Create the user recorder and set yourself up so you can ssh into it

I use nvm to install node you should be able to find how to set it up. Something like the following

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Its sets some environment up so exit the login and then reenter.

nvm install v18.14.2 npm install -g pm2 mkdir recorder recordings keys

See the makeRelease script to copy the right bits of your clone of this app and to install the correct bits of the node packages. I think rollup gets run automatically because its a "prepare" script. Rollup is the only building you need as it puts necessary packages in the client/libs directory where all the client code assumes it is. There are no other build steps. So for instance you can live edit your code and its immediately available. You only need to run it when you change the libraries not any of the main code. (npm prepare if you want to run rollup manually for any reason).

In the pi account install nginx and in /etc/nginx/sites-enabled create a link called recorder to /home/recorder/recorder/nginx.conf

I think that is basically it.

Feel free to ask questions if you don't understand parts of this