https://www.raspberrypi.org/software/operating-systems/
diskutil list
to find out the rdisk that your SD is associated withdiskutil unmountDisk /dev/diskN
replacing the rdiskN with the number of the disk your SD card is associated withsudo dd bs=1m if=path_of_your_image.img of=/dev/rdiskN; sync
replacing the rdiskN with the number of the disk your SD card is associated with. In my case this is sudo dd bs=1m if=/Users/andrew/Downloads/2021-03-04-raspios-buster-armhf-lite.img of=/dev/rdisk3; sync
(you can see the progress by pressing ctrl+t)sudo diskutil eject /dev/rdiskN
to eject the SD card.https://www.raspberrypi.org/documentation/configuration/wireless/headless.md
cd /Volumes/boot
vim wpa_suplicant.conf
enter wifi and country code in the file but that note that this will need to be the 2.4GHz network if you have a Raspberry Pi that does not support 5GHz.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB<Insert 2 letter ISO 3166-1 country code here>
network={
ssid="<Name of your wireless LAN>"
psk="<Password for your wireless LAN>"
}
enable ssh https://www.raspberrypi.org/documentation/remote-access/ssh/README.md easiest is to place a ssh
file in the sd card during setup
eject the SD card and put in the raspberry pi and turn it on
sudo diskutil eraseDisk FAT32 RASPBIAN MBRFormat /dev/diskN
replacing diskN with your disk number found by running diskutil list
. Note that this gives the name RASBIAN to the SD Card so now you can cd into /Volumes/RASPBIAN. I followed this site: https://www.michaelcrump.net/the-magical-command-to-get-sdcard-formatted-for-fat32/wget https://nodejs.org/dist/v14.16.1/node-v14.16.1-linux-armv7l.tar.gz
tar -xzf node-v14.16.1-linux-armv7l.tar.gz
cd node-v14.16.1-linux-armv7l/
sudo cp -R * /usr/local/
node -v
npm -v
http://raspberrypi.lan/
/var/www/html/
directorysudo apt install vim nginx git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo apt install openssl direnv
cargo build --release
sudo apt install libprotobuf-dev protobuf-compiler
cargo build --release
npm run build
pm2 start npm --name "Next App" -- start
pm2 save
sudo chown -R pi:www-data /var/www
const five = require('johnny-five');
const Raspi = require('raspi-io').RaspiIO;
const board = new five.Board({
io: new Raspi(),
});
board.on('ready', function () {
const button1 = new five.Button('P1-7');
button1.on('press', async () => {
console.log('button1 pressed');
});
});
sudo node index.js