piBeacon: 2- creating the SSD and configuring the rPi

User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

piBeacon: 2- creating the SSD and configuring the rPi

Post by kw123 »

Create and install a (new) micro SD into the RPi and set it up with pibeacon:

you need plugin v >= 2022.174.89 for this to work

A) once for all SD
https://www.raspberrypi.com/software/operating-systems/
- download "Raspberry Pi Imager" App

on MAC:
- Install Raspberry Pi Imager

B) Start Raspberry Pi Imager

1. RPI device >> IT MATTERS WHICH RPI YOU SELECT<<

2. Operating System: use v 11 or v12 (32 or 64 bit) both work
OS Bookworm (12) has many libraries used missing ie gpio functions. The programs have been converted to use the new libraries (PIGPIO and gpiozero)

3. Storage: slide the SD card into your mac; select your "sd media” ;

4. NEXT

5. Edit settings
in “General" set
user id = pi; password anything you like, but you must remember
set hostname eg rpi-kitchen, it is just a name
set locale (timezones etc) ;
if you want to use wifi, set the proper parts (sid, uid, pwd)
in “Services" check: (this is important, if not enabled, nothing will work)
-- Enable SSH, use password
— SAVE
YES
— answer Wifi question.
— All existing … erase: YES
— you will need to enter your mac password to execute
it will take some minutes to write and verify

6. Exit Raspberry Pi Imager when finished


C) Remove SD, slide SD into rpi, power up rpi, find its IP number


D) After rpi has started (first rpi start can take 2-6 minutes. It starts the graphical interface and sets standard RPI configs)
To check if you can continue with (E) do: ping the RPI in a terminal , when it answers you can continue with (E)


E) In indigo :

1 pibeacon plugin menu / “Initial BASIC setup …":
— select rPi #,
— CONFIRM
— On (don’t forget)
— set ip#, userid, password from (B)
— CONFIRM
— CLOSE

That should be it.
it will set console auto login, setup all directories, copy files from the plugin directory to the rpi, download all libs for sensors and output devs and will reboot after ~ 3-6 minutes.
It will reboot earlier if all is installed eg RPI-4 vs RPI-0
After the reboot the RPI should be up and running and finished


F) on RPI: if you want to check the progress of (E)

open terminal
ssh pi@ipnumber of rpi
enter password set in (B.5)

ps -ef | grep python | grep -v grep
if there are only programs like
master.py ... beaconloop.py …
no no adafruit or setStartupParams etc —> it is done


G) Finish setup of RPI, recommended

with "sudo raspi-config”
you can change things manually, like location, timezone etc.


!!!! To keep your rpi updated do this every 3 months and at new install !!!
sudo apt-get --yes -- assume-yes update

sudo apt-get —yes --assume-yes upgrade

sudo apt-get —yes --assume-yes auto remove

Or you can use indigo plugin menu / “Send/get Config…—> : “Upgrade op-sys on rpi” that does the same

These steps might take 5 minutes … 1 hour


A reboot should be beneficial after everything is done
If the graphic interface is running (it should not) a simple "sudo reboot now" might not actually stop the rpi
you then need to do
sudo reboot -f
That is a HARD stop with restart, similar to a power cycle, just pending writes are finished before restart

That should be it.

The whole process takes < 15 minutes, mostly waiting for sd creation, initial boot of rpi, and wait at the end before final reboot
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: piBeacon: creating the SSD and configuring the rPi

Post by kw123 »

other utilities you could install on your SSD

VNC server
for convenience install vnc server to enable vnc sessions from mac on raspberry (graphic interface)

Code: Select all

sudo apt-get install tightvncserver
AVAHI apple fileshare utility
install AFP server to enable MAC to browse files

Code: Select all

sudo apt-get install avahi-daemon
Next, make sure it runs at startup, enter

Code: Select all

sudo update-rc.d avahi-daemon defaults
Create a configuration file containing information about the server. Run:

Code: Select all

sudo nano /etc/avahi/services/afpd.service
Enter (or copy/paste) the following:

Code: Select all

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
   <name replace-wildcards="yes">%h</name>
   <service>
      <type>_afpovertcp._tcp</type>
      <port>548</port>
   </service>
</service-group> 
Press CTRL and x to exit, then press y to to save changes and return after confirming the location.

Restart Avahi:

Code: Select all

sudo /etc/init.d/avahi-daemon restart
if you want to use the VNC/graphics: start the following manually - it is not in autostart (not part of this package). Check the raspberry docs on the internet how to do it at boot time

Code: Select all

tightvncserver
startx
how to COPY an SSD

open terminal:
put ssd card into reader connected to your MAC

Code: Select all

 diskutil list
to find you ssd card (~ 8/16/GB total) ==> xx

copy image to desktop xx = your disk number

Code: Select all

sudo dd if=/dev/diskxx of=~/Desktop/raspberrypi.dmg

Code: Select all

diskutil unmountDisk /dev/diskxx
take old out and follow above steps to create a new SSD
Locked

Return to “piBeacon”