🛠 Premier script Python sur le Linux embarqué

LattePanda 3 Delta (id: lattepanda-3) · debutant · Schéma : IMG-lattepanda-3-debutant-3-premier-script-python.svg — La LattePanda 3 Delta sous Ubuntu 22.04 avec un terminal affichant les informations du processeur Celeron N5105 et un éditeur de texte ouvrant un script Python.

Objectives

Before touching the pins, get familiar with the PC side of the board. The LattePanda 3 Delta is a standard x86-64 UEFI PC: DFRobot publishes an official guide for installing Ubuntu 22.04 LTS. This tutorial verifies the detected hardware (Celeron N5105 4 cores, Intel AX201 Wi-Fi module) and then writes a first Python script that displays system information. The lscpu/lspci method used here is the standard diagnostic command under Linux; the expected hardware strings come from the official datasheet.

Hardware

Complete code

First, check the hardware in a terminal:

# Confirmer le SoC Celeron N5105 (4 cœurs/4 threads, jusqu'à 2,9 GHz)
lscpu | grep -E 'Model name|Socket|CPU\(s\):|MHz'
# Attendu : Intel(R) Celeron(R) N5105 @ 2.00GHz, 4 CPUs

# Confirmer le module Wi-Fi 6 / BT 5.2 Intel AX201
lspci -nnk | grep -A3 -i network     # attendu : Intel AX201 [8086:2725]

Then the first script, info_systeme.py:

#!/usr/bin/env python3
"""Premier script : présente la LattePanda 3 Delta."""
import platform
import os
import shutil

print("=== Ma LattePanda 3 Delta ===")
print("OS        :", platform.system, platform.release)
print("Machine   :", platform.machine)   # x86_64 : c'est un PC !
print("Processeur:", platform.processor)

memo = os.sysconf("SC_PAGE_SIZE") * os.sysconf("SC_PHYS_PAGES")
print("RAM       :", round(memo / 1024**3), "Go (8 Go LPDDR4 attendus)")

usage = shutil.disk_usage("/")
print("Disque /  :", round(usage.used / 1024**3), "Go utilisés sur",
      round(usage.total / 1024**3), "Go (eMMC 64 Go attendus)")

Run it with python3 info_systeme.py.

Expected verification

platform.machine returns x86_64 (and not aarch64: this is indeed an Intel PC, not a Raspberry Pi). RAM shows ~8 GB, the root disk ~64 GB if Ubuntu is installed on the eMMC. lscpu displays the Celeron N5105 with 4 CPUs.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials