Difference between revisions of "Template:BuildMecar Kit Setup"

From Waveshare Wiki
Jump to: navigation, search
 
(13 intermediate revisions by 2 users not shown)
Line 34: Line 34:
 
:For example:
 
:For example:
 
:[[File:Wlan-config-02.png|400px]]
 
:[[File:Wlan-config-02.png|400px]]
*Save and start the Pi
+
*Save and start the Pi.
 +
 
 +
==Configure SSH (Optional)==
 +
*Our image has SSH enabled by default. If users are using the official buster image, they need to enable SSH by themselves.
 +
*The opening method is as follows:
 +
*Create a folder named SSH under the boot drive letter.
 +
[[File:boot01.png]]
 +
 
 
==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===
+
 
*If you do not have a display, you can access the Pi via SSH. It requires:
+
==Remote Login==
*#The Raspberry Pi has connected to the network by WIFI or wired network
+
*If you want to use remote login to Raspberry Pi, you need to meet the following requirements:
*#The Raspberry Pi should be connected to the same network as your PC
+
#Make sure the Raspberry Pi is connected to the network, either via WLAN or a cable.
*#The SSH function of Pi should be enabled. (You can directly create an empty file named '''ssh''' in the boot directory)
+
#Make sure the Raspberry Pi and your computer are under the same router or on the same network segment.
*Get the IP address of the Pi on your router manager page
+
#Make sure that the corresponding remote login function is enabled on the Raspberry Pi.
*Use a putty tool or the CMD tool in Windows PC
+
*In addition to these requirements, if you have multiple Raspberry Pis online under the same network segment, you also need to obtain the IP address of your Raspberry Pi
*: Enter the following command to access pi
+
*You can use some LAN IP scanning tools, here is an example of [https://www.advanced-ip-scanner.com/ Advanced IP Scanner] (if you do not have multiple Raspberry Pi online or use the mirror provided by us, you can skip this step).
:<pre>ssh pi@<IP address of PI>
+
:1. Run Advanced IP Scanner.<br/>
*:For example, if the address is 192.168.10.51, it should be:
+
:2. Click the Scan button to scan the IP address in the current LAN.<br/>
 +
[[File:BuildMecar Kit Setup01.jpg]]<br/>
 +
:3. Find all IP addresses with the word Raspberry Pi in the Manufacturer and record them.<br/>
 +
[[File:BuildMecar Kit Setup02.jpg]]<br/>
 +
:4. Power on the device and make sure the device is connected to the network.<br/>
 +
:5. Click the Scan button again to scan the IP address in the current LAN.<br/>
 +
:6. Exclude all the IP addresses that have the word Raspberry Pi in the previously recorded Manufacturer, and the rest is your Raspberry Pi IP address.<br/>
 +
 
 +
==SSH Login==
 +
*Make sure SSH is enabled, here use the SSH login command that comes with Windows.
 +
<ol>
 +
<li>Press win and R at the same time, type cmd, and enter to open the command line.<br/>
 +
[[File:BuildMecar Kit 09.jpg]]<br/></li>
 +
<li>Input the corresponding commands, there are roughly three cases:<br/>
 +
*If you are using the image we provide, use the following command:
 +
<pre>ssh pi@BuildMecar</pre>
 +
*If you are using the original Raspberry Pi image and only one Raspberry Pi device is online, use the following command:
 +
<pre>ssh pi@raspberrypi</pre>
 +
*If you are using the original Raspberry Pi image and multiple Raspberry Pi devices are online, please use the following command:
 +
<pre>ssh pi@IP address</pre>
 +
*A method of obtaining an IP address has been described above, so I won't repeat it here.
 +
*Suppose you get the address 192.168.10.51, the command should be:
 
:<pre>ssh [email protected]</pre>
 
:<pre>ssh [email protected]</pre>
 
:[[File:CmdSSH-01.png|400px]]
 
:[[File:CmdSSH-01.png|400px]]
*Input the password '''raspberry'' and Enter
+
</li>
:[[File:CmdSSH-02.png|400px]]
+
<li>Input the password '''raspberry'' and Enter.
 +
:[[File:CmdSSH-02.png|400px]]</li>
 +
<li>Here the SSH login was successful.</li>
 +
</ol>
 +
 
 
==Software Setup==
 
==Software Setup==
 
If you use the pre-built image, you can just skip this part.
 
If you use the pre-built image, you can just skip this part.
Line 61: Line 93:
 
sudo raspi-config
 
sudo raspi-config
 
</pre>
 
</pre>
Choose Interfacing Options -> Serial -> No -> Yes
+
Choose Interfacing Options -> Serial -> No -> Yes.
==Download Demo codes and install libraries==
+
 
Open a terminal and run the following commands
+
==Download Demo and Install Libraries==
 +
Open a terminal and run the following commands.
 
<pre>
 
<pre>
 
cd ~
 
cd ~
 
sudo apt-get install unzip -y
 
sudo apt-get install unzip -y
wget https://www.waveshare.com/w/upload/a/ad/BuildMecar-code.zip
+
wget https://files.waveshare.com/upload/a/ad/BuildMecar-code.zip
 
unzip BuildMecar-code.zip
 
unzip BuildMecar-code.zip
 
sudo pip3 install -r ~/BuildMecar-code/requirements.txt
 
sudo pip3 install -r ~/BuildMecar-code/requirements.txt
wget https://www.waveshare.com/w/upload/9/91/Python-build-hat.zip
+
wget https://files.waveshare.com/upload/9/91/Python-build-hat.zip
 
unzip Python-build-hat.zip
 
unzip Python-build-hat.zip
 
cd python-build-hat/
 
cd python-build-hat/

Latest revision as of 03:55, 20 December 2023

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.

Configure SSH (Optional)

  • Our image has SSH enabled by default. If users are using the official buster image, they need to enable SSH by themselves.
  • The opening method is as follows:
  • Create a folder named SSH under the boot drive letter.

Boot01.png

Login Raspberry Pi

With Display

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

Remote Login

  • If you want to use remote login to Raspberry Pi, you need to meet the following requirements:
  1. Make sure the Raspberry Pi is connected to the network, either via WLAN or a cable.
  2. Make sure the Raspberry Pi and your computer are under the same router or on the same network segment.
  3. Make sure that the corresponding remote login function is enabled on the Raspberry Pi.
  • In addition to these requirements, if you have multiple Raspberry Pis online under the same network segment, you also need to obtain the IP address of your Raspberry Pi
  • You can use some LAN IP scanning tools, here is an example of Advanced IP Scanner (if you do not have multiple Raspberry Pi online or use the mirror provided by us, you can skip this step).
1. Run Advanced IP Scanner.
2. Click the Scan button to scan the IP address in the current LAN.

BuildMecar Kit Setup01.jpg

3. Find all IP addresses with the word Raspberry Pi in the Manufacturer and record them.

BuildMecar Kit Setup02.jpg

4. Power on the device and make sure the device is connected to the network.
5. Click the Scan button again to scan the IP address in the current LAN.
6. Exclude all the IP addresses that have the word Raspberry Pi in the previously recorded Manufacturer, and the rest is your Raspberry Pi IP address.

SSH Login

  • Make sure SSH is enabled, here use the SSH login command that comes with Windows.
  1. Press win and R at the same time, type cmd, and enter to open the command line.
    BuildMecar Kit 09.jpg
  2. Input the corresponding commands, there are roughly three cases:
    • If you are using the image we provide, use the following command:
    ssh pi@BuildMecar
    • If you are using the original Raspberry Pi image and only one Raspberry Pi device is online, use the following command:
    ssh pi@raspberrypi
    • If you are using the original Raspberry Pi image and multiple Raspberry Pi devices are online, please use the following command:
    ssh pi@IP address
    • A method of obtaining an IP address has been described above, so I won't repeat it here.
    • Suppose you get the address 192.168.10.51, the command should be:
    ssh [email protected]
    CmdSSH-01.png
  3. Input the password 'raspberry and Enter.
    CmdSSH-02.png
  4. Here the SSH login was successful.

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 and Install Libraries

Open a terminal and run the following commands.

cd ~
sudo apt-get install unzip -y
wget https://files.waveshare.com/upload/a/ad/BuildMecar-code.zip
unzip BuildMecar-code.zip
sudo pip3 install -r ~/BuildMecar-code/requirements.txt
wget https://files.waveshare.com/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