Install Rasperry Pi OS On Your SD Card With The Raspberry Pi Imager
Install Rasperry Pi OS On Your SD Card With The Raspberry Pi Imager
Many vendors sell SD cards with a simple Rasperry Pi OS installer called NOOBS
preinstalled but you can really easily install Rasperry Pi OS yourself using a computer
that has an SD card port or using an SD card reader.
Using the Raspberry Pi Imager is the easiest way to install Rasperry Pi OS on your SD
card.
Note: More advanced users looking to install a particular operating system should use
this guide to installing operating system images.
Note: Make sure you are selcting the correct drive. The drives memory capacity can be
a useful indication of which drive you are selecting.
Once you have selected both the OS and the SD card, a new WRITE button will appear.
o Then simply click the WRITE button.
o Wait for the Raspberry Pi Imager to finsh writing.
o Once you get the following message, you can eject your SD card.
Apache installation
Before installing the server, make sure we have an up-to-date machine. To do
this we must have administrator rights, either because of the sudo command.
By the way, we’ll take advantage of it to give rights to the apache file that you can
easily manage your sites. To do this, run the following commands:
Let’s execute the following commands to install the required packages
first on your system. Then import packages signing key. After that
configure PPA for the PHP packages on your system.
Now use one of the below options to install PHP of your requirements.
Install phpMyAdmin
In order to manage our MySQL databases, it’s far easier to use phpMyAdmin so let’s go
ahead and install it by entering the following command, but note* you’ll be asked the
following questions during the installation process:
Automatic Configuration? – Choose [*]apache2 with your Spacebar, hit Tab then Enter
Configure database for phpmyadmin with dbconfig-common? – Choose Yes
phpMyAdmin application password – [enter new password] [confirm new password] this
is for logging into the phpMyAdmin web interface
Once you are ready, type the following command:
Now let’s check if phpMyAdmin is working by entering the IP address of your Pi into
your web browsers address bar appended with /phpmyadmin/, like this:
http://192.xxx.x.xxx/phpmyadmin/ hit Enter and you should be presented with the
standard phpMyAdmin login page as shown below:
These steps differ for both Apache and NGINX so make sure you follow the correct list
of steps.
Note that this documentation was tested on a Raspberry Pi 3, and it is possible that
some USB dongles may need slight changes to their settings. If you are having trouble
with a USB wireless dongle, please check the forums.
In order to work as an access point, the Raspberry Pi will need to have access point
software installed, along with DHCP server software to provide connecting devices with
a network address. Ensure that your Raspberry Pi is using an up-to-date version of
Raspbian (dated 2017 or later).
Since the configuration files are not ready yet, turn the new software off as follows:
sudo reboot
Configuring a static IP
To configure the static IP address, edit the dhcpcd configuration file with:
Go to the end of the file and edit it so that it looks like the following:
interface wlan0
static ip_address=192.168.4.1/24
nohook wpa_supplicant
Now restart the dhcpcd daemon and set up the new wlan0 configuration:
The DHCP service is provided by dnsmasq. By default, the configuration file contains a
lot of information that is not needed, and it is easier to start from scratch. Rename this
configuration file, and edit a new one:
Type or copy the following information into the dnsmasq configuration file and save it:
There are many more options for dnsmasq; see the dnsmasq documentation for more
details.
Add the information below to the configuration file. This configuration assumes we are
using channel 7, with a network name of NameOfNetwork, and a password
AardvarkBadgerHedgehog. Note that the name and password should not have quotes
around them. The passphrase should be between 8 and 64 characters in length.
To use the 5 GHz band, you can change the operations mode from hw_mode=g to
hw_mode=a. Possible values for hw_mode are:
interface=wlan0
driver=nl80211
#driver=rtl871xdrv
ssid=RFIDServer
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=raspberry
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
We now need to tell the system where to find this configuration file.
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Start it up
net.ipv4.ip_forward=1
Edit /etc/rc.local and add this just above "exit 0" to install these rules on boot.
Reboot
Collecting evdev
Downloading https://files.pythonhosted.org/packages/7e/53/374b82dd2ccec240b738
Building wheels for collected packages: evdev
Running setup.py bdist_wheel for evdev ... done
Stored in directory: /root/.cache/pip/wheels/f6/ad/e1/5d30bce69dba5c09b23c054a
Successfully built evdev
Installing collected packages: evdev
Successfully installed evdev-1.1.2
This is a very short helping tutorial explaining how to get gammu working with an USB 3G modem (in my
case a Huawei K3565) in CentOS which will be used in sending out alert messages for critical events.
Start by connecting the modem and figuring out if it is recognised by the system:
# lsusb
Bus 001 Device 002: ID 045e:0779 Microsoft Corp. LifeCam HD-3000
Bus 003 Device 002: ID 04d9:1203 Holtek Semiconductor, Inc. Keyboard
Bus 004 Device 002: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
We can see the device correctly identified (it uses the same chip as several other Huawei models).
Next we figure out which ttyUSB device the modem shows up as. Looking at the list above it is on Bus
004, Device 002 with two other devices on precedent buses, so that would make it ttyUSB2 (with
ttyUSB0 being the camera and ttyUSB1 the keyboard).
port = /dev/ttyUSB2
connection = at115200
# gammu --identify
Manufacturer : huawei
Model : unknown (K3565)
Firmware : 11.608.10.51.00
IMEI : phone_imei_number
SIM IMSI : sim_imsi_number
# gammu --networkinfo
Network state : home network
Network : 226 03 (Cosmote), LAC 3A55, CID 4393
# gammu --monitor 1
Press Ctrl+C to break...
Entering monitor mode...
Enabling info about incoming SMS : No error.
Enabling info about incoming CB : No error.
Enabling info about calls : No error.
Enabling info about USSD : No error.
SIM phonebook : 0 used, 250 free
Own numbers : 0 used, 1 free
Battery level : 0 percent
Charge state : battery connected and is being charged
Signal strength : -73 dBm
Network level : 100 percent
SIM SMS status : 6 used, 0 unread, 40 locations
Phone SMS status : 0 used, 0 unread, 23 locations
Network state : home network
Network : 226 03 (Cosmote), LAC 3A55, CID 4393
Leaving monitor mode...
If you’ve received the test message on your target number then gammu works and you can use the
above command to programatically send SMS messages out of any other application or script.