1.7 Basic Commands for Using the Smart Pi One Board¶
Introduction¶
The Smart Pi One board runs on Debian with Armbian, a distribution optimized for Single Board Computers (SBCs). This guide provides essential commands to manage the board, focusing on GPIO control, network configuration, and basic system management.
1. System Update¶
Before configuring the board, it’s crucial to update the system for the latest security patches and package updates:
2. System Information¶
To check hardware specifications and active services on the Smart Pi One board, here are some useful commands:
-
Check the Armbian version:
-
Get information about the board and CPU:
-
Check available memory:
-
Monitor disk usage:
3. GPIO Management with SmartPi-GPIO¶
The Smart Pi One board allows control of GPIO pins for connecting sensors, LEDs, etc. SmartPi-GPIO provides a Python-based interface to manage GPIO, PWM, and interrupts efficiently.
-
Install SmartPi-GPIO (if not already installed):
-
To view the available GPIO pins and their states:
-
Configuring a GPIO pin as an output (e.g., GPIO 18):
-
Writing a high or low state to a GPIO pin:
-
Using PWM on a pin (e.g., GPIO 19):
4. Enabling and Configuring I2C¶
I2C is used for connecting sensors and peripherals. To enable and configure I2C:
-
Enable I2C:
-
Install I2C tools:
-
Scan connected I2C devices:
5. Enabling and Configuring SPI¶
SPI is another interface used for fast communication with external devices.
-
Enable SPI via Armbian Config:
-
Check SPI interface:
6. Managing Services and Autostart¶
Armbian uses systemd to manage services. You can start, stop, and enable services at boot with the following commands:
-
Check the status of a service (e.g., SSH):
-
Start a service:
-
Enable a service at boot:
-
Disable a service:
7. Basic Network Configuration¶
For configuring Internet access or handling network settings, here are some basic commands:
-
View network interfaces:
-
Set a static IP address (edit configuration as needed):
-
Restart the network after changes:
8. Obtain the IP Address¶
To find the IP address of your Smart Pi One board, you can use the following commands:
-
Display the IP address of network interfaces:
-
Display only the IP address of the main interface (e.g.,
eth0
orwlan0
):
9. Display and Modify the Hostname¶
To view and change the name of your Smart Pi One board:
-
Display the current hostname:
-
Edit the hostname file:
Replace the content with the desired new name, then save and exit the editor. -
Edit the hosts file:
Update the line containing the old hostname with the new name. -
Restart the system to apply the changes:
10. Managing Real-Time Clock (RTC)¶
To enable and configure an external RTC module:
-
Load the RTC module:
-
Synchronize the hardware clock with the system clock:
11. Modify a File¶
To edit a configuration file (e.g., using nano
):
/path/to/file
with the actual path of the file you want to edit.
12. Shutdown and Reboot¶
To safely power off the Smart Pi One:
To restart the Smart Pi One: