Difference between revisions of "Template:BuildMecar Kit Setup"

From Waveshare Wiki
Jump to: navigation, search
Line 37: Line 37:
 
==Login Raspberry Pi==
 
==Login Raspberry Pi==
 
===With Display===
 
===With Display===
*You can directly connect a display to the Pi and login the Desktop directly
+
*You can directly connect a display to the Pi and login the Desktop directly.
 
:[[File:Th.png|400px]]
 
:[[File:Th.png|400px]]
 +
 
===Without Display===
 
===Without Display===
 
*If you do not have a display, you can access the Pi via SSH. It requires:
 
*If you do not have a display, you can access the Pi via SSH. It requires:

Revision as of 09:18, 25 August 2022

Connection of Motor and Wheel

Build HAT Port Motor Position Wheel Direction
PORT A right-back L
PORT B right-front R
PORT C left-back R
PORT D left-front L
Buildmecar-wheel-01.png

Write Image

  • We recommend you to use the pre-built image: BuukdMecar image
  • Please download the image and write to a Micro SD card (recommend 16G) by Win32DiskImage tool.

Configure WLAN (optional)

  • If you have a keyboard and display to connect the Raspberry Pi, you can just connect the wifi on the GUI desktop and skip this part.
  • Create a file wpa_supplicant.conf under boot directory.
Wlan-config-03.png
  • Append the following lines to the file and modify according to the actual situation
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev 
country=<The country number based on ISO 3166-1> 
update_config=1 

network={ 
 ssid="<The SSID of WIFI>" 
 psk="<The Password of WIFI>" 
}
For example:
Wlan-config-02.png
  • Save and start the Pi

Login Raspberry Pi

With Display

  • You can directly connect a display to the Pi and login the Desktop directly.
Th.png

Without Display

  • If you do not have a display, you can access the Pi via SSH. It requires:
    1. The Raspberry Pi has connected to the network by WIFI or wired network
    2. The Raspberry Pi should be connected to the same network as your PC
    3. The SSH function of Pi should be enabled. (You can directly create an empty file named ssh in the boot directory)
  • Get the IP address of the Pi on your router manager page
  • Use a putty tool or the CMD tool in Windows PC
    Enter the following command to access pi
ssh pi@<IP address of PI>
  • For example, if the address is 192.168.10.51, it should be:
<pre>ssh [email protected]
CmdSSH-01.png
  • Input the password 'raspberry and Enter
CmdSSH-02.png

Software Setup

If you use the pre-built image, you can just skip this part.

Enable UART

Execute the following command to enter the Raspberry Pi configuration:

sudo raspi-config

Choose Interfacing Options -> Serial -> No -> Yes:
You need to disable the login shell and enable the srial port hardware:

L76X GPS Module rpi serial.png


Reboot Raspberry Pi:

sudo reboot

Open the /boot/config.txt file and find the following configuration statement to enable the serial port, if not, add it at the end of the file:

enable_uart=1

Reboot to take effect.

Enable Camera

Open a terminal and run the following command:

sudo raspi-config

Choose Interfacing Options -> Serial -> No -> Yes

Download Demo codes and install libraries

Open a terminal and run the following commands

cd ~
sudo apt-get install unzip -y
wget https://www.waveshare.com/w/upload/a/ad/BuildMecar-code.zip
unzip BuildMecar-code.zip
sudo pip3 install -r ~/BuildMecar-code/requirements.txt
wget https://www.waveshare.com/w/upload/9/91/Python-build-hat.zip
unzip Python-build-hat.zip
cd python-build-hat/
chmod +x ./*
sudo pip3 install . --user
sudo ./build.sh