Index>Robot Kit>Alter All in One Kit for RPi>Lesson 23 Common Problems and Solutions(Q&A)
No related product information!

Lesson 23 Common Problems and Solutions(Q&A)

1531

1.Where to find the IP address of the Raspberry Pi?

         Before connecting the Raspberry Pi via SSH, you need to know the IP address of the Raspberry Pi. Check the Management interface for your router, or download the app `Network Scanner` -> search for a device named `RASPBERRY` or `Raspberry Pi Foundation` to get the IP address.  

        For other methods of obtaining the IP address of Raspberry Pi, refer to the official documentation [IP Address]


2.Errors occur with `permission denied` prompt when I manually run `server.py` or `webServer.py`.

The Raspberry Pi needs the root permission to run the dependent libraries for WS2812 LED lights control.

You need to add `sudo` to the beginning of `server.py` or `webServer.py` to run the program.

sudo python3 [PATH]/server.py

sudo python3 [PATH]/webServer.py


3.I can't create the hots pot for the robot.

You need to use the open source project create_ap to setup the robot's hotspot. Prior to use, disconnect WiFi network but DO NOT turn the WiFi module off, or the create_ap will show an error of hardware being blocked.


4.The servo rotates to an abnormal degree. 

Before assembling the rocker arm and servo, you need to make the servo gears rotate to the central position of its rotating range. Then assemble the rocker arm based on the angle instructed in the documentation. There can be a deviation of less than 9° due to the structure of the servo (number of teeth is 20 for the servo gears). For better performance, you may refer to the servo control documentation for initial degree adjustment by code.


5.The servo is shaking. 

Probably the servo reducing gear is broken.


6.Raspberry Pi can't boot. 

Remove all parts on the driver board. Only connect the board to Raspberry Pi and power supply, reboot.


7."Remote side unexpectedly closed network connection" shows on a popup window. 

There can be error prompts during installation because the Raspberry Pi will auto reboot after the installation, which will disconnect the board.


8.Program crashes after double clicking on client.py or GUI.py.

Run the script by `python client.py` or `python GUI.py` in cmd and check the error reports.


9.How to initialize the servo's angle?

If you've finished software installation on the Raspberry Pi, just boot it up and the servo will be initialized.


10.I can connect to the Raspberry Pi terminal via SSH \ Raspberry Pi failed to connect a WiFi.

The power supply methods will not influence control by SSH. Check whether you've created the file `wpa_supplicant.conf` for multiple times. If yes, that's problem causing SSH errors.


11.Can I supply the Motor HAT and Raspberry Pi via USB?

A 2A output is required for a Raspberry Pi 3B, when at least 3A is needed for a Raspberry Pi 4. You can use the USB power for software installation and testing, but it's not suitable for high power module like servo or motor adjustment as it may result in low voltage. It's recommended to use battery for power here.


12.After installation, the robot shows no response when booting.

The `server.py` or `webServer.py` may not run due to some reasons. Try to manually run `server.py` or `webServer.py` and check whether there's any error prompt.


13.The servo doesn't return to the central position when connected to the driver board. 

In general, the Raspberry Pi will auto run `webServer.py` when booting, and `webServer.py` will run and control the servo ports to send a signal of rotating to the central position. When assembling the servo, you can connect it to any servo port anytime. After connecting the servo to the port, the gears will rotate to the central position; assemble the rocker arm to the servo, disconnect the servo from the port, and insert more servos to repeat rocker arm assembly (all servos will be in the central position).

When the servo is powered on, try moving the rocker arm. If it can't be moved, it indicates the program for the servo works; otherwise there's error for the servo program. Run the line `[RobotName]/initPosServos.py` (replace `[RobotName]` with the folder name of your robot's program) to make the servo rotate to the central position.  

When booting (it may take 30-50s), it takes a while for the Raspberry Pi to control PCA9685 to set signal of all servo ports for central position rotating.


14.no cv2 error occurs when I manually run `server.py` or `webServer.py`.

OpenCV is not installed correctly. Type in the command sudo pip3 install opencv-contrib-python in the Raspberry Pi to manually install OpenCV.


15.When using a computer to copy ssh and wpa_supplicant.conf to the SD card, it prompts that there is no SD card.

If this happens, unplug the card reader and connect it to the computer.


16.SSH can't connect, error WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

Enter the following in the command line and press Enter

ssh-keygen -R Add the Raspberry Pi's IP address

For example:

ssh-keygen -R 192.168.3.157

Then you can SSH to the Raspberry Pi again


17.Raspberry Pi automatically restarts after booting / restart the robot once it starts to move.

If your robot automatically restarts after powering on, or disconnects and restarts when the robot starts to move after normal power on, it is likely because your power supply does not output enough current, and the robot will automatically run the program when it starts Put all the servos in the neutral position, the voltage drop caused by this process causes the Raspberry Pi to restart.

We have tested that when using 7.4V power supply, the peak current of the robot is about 3.75A, so you need to use support 4A output battery.


18. The servo is moving in the wrong direction

Due to the different batches of servos, when the same angle change trend is given to the servos, the actual movement direction of the servos may be opposite. We have set up the interface for adjusting the direction of the servos in the program. You need to open RPIservo.py and find the array sc_direction in ServoCtrl. If the direction of the servo of port 3 is reversed, you change the fourth 1 to -1 (the array number starts from zero, so port 3 corresponds to the fourth 1) .

If the servo of port 3 moves in the wrong direction:

Before modification:

self.sc_direction = [1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1]

After modification (the sequence number of the array starts from zero, so port 3 corresponds to the fourth 1):

self.sc_direction = [1,1,1,-1, 1,1,1,1, 1,1,1,1, 1,1,1,1]


19. The direction of motor movement is incorrect.

Due to different batches of motors, when the same signal is given, the direction of rotation of the motor may be different from time to time. We have set up an interface to adjust the direction of rotation of the motor in the program. You need to open move.py. In the upper part of the program, you can see the following variable definitions:

Dir_forward   = 0
Dir_backward  = 1
left_forward  = 0
left_backward = 1
right_forward = 0
right_backward= 1

If all motor actions are reversed, you just change Dir_forward = 0 to Dir_forward = 1, and change Dir_backward = 1 to Dir_backward = 0.

If you only have one motor whose action is reversed, you only need to change the corresponding set of variables.


20. After running the server, an error was reported that config.txt could not be found.

This is because the installation script did not copy config.txt to the specified location due to permission issues during installation. The new version of webServer will not use this file. Only the old version of the server will use it. You need to remove this file from the tree Copy the server folder of Raspberry Pi to //etc/ of Raspberry Pi, by using the following command

sudo cp -f //home/pi/adeept_alter/server/config.txt //etc/config.txt


Just replace the adept_alter above with your product name. Let’s take alter as an example.