Sunday, September 22, 2024

Raspberry Pi: first encounter

It's been almost 13 years since my last post here. Quite a lot of things happened this time...

I got this Adeept AWR 4WD WiFi Smart Robot Car Kit for Raspberry Pi. It is built on Raspberry Pi and requires assembling. There are no instructions provided and after I opened the box I felt like I was going to overcome many challenges. 

Assembling and first start

I found the tutorials and samples (here) and they looked pretty good. After I installed an operation system, car server, and all dependencies I tried to start a car's webserver. The server returned an error: 'Could not determine default I2C'. I googled it and found that the webserver uses a deprecated library: Adafruit_Python_GIRO. The recommendation was to use a new library called Blinka

I installed Blinka but it didn't help to start the server. I looked in the server's code and tried to hack it so it works with the new library. No success here as well - the server requires many changes to migrate to the new library. So disappointing...

I was desperate and about to scrap everything when I suddenly realized the manufacturer had included the image file with Raspberry Pi OS and the webserver (here is the link). The tutorial described this option as a "not recommended" way to install the system. So I followed that "not recommended" approach and everything worked smoothly! My servo motor reacted and I started assembling the car following the instructions. 

Useful tip: Start from this step

Install cooling for Raspberry Pi! See Useful Tip 2 below. Then proceed with the next steps. 
 
Follow "Not recommended approach" in section 2.1.3 of the tutorial if you want your car to work :)

I configured my home WiFi in the Imager settings. I enabled ssh and configured the user name and password. Although the tutorial says you can skip it for "not recommended approach", I did it because I wasn't able to find credentials for pre-configured ssh access.

After that follow the assembling instructions from Section 4. You do not need to install anything as everything is already preinstalled in the provided image file.

Here is what I got (Front)

And back


I turned on my car, logged into it by ssh and started the server: 
sudo python3 Adeept_AWR/server/webServer.py


I ignored all errors and warnings and pointed my browser to the server : http://<server>.local:5000. I was able to control the car, camera works fine and able to move up and down.  

Here is a control screen


Useful tip 2:

The Raspberry Pi quickly overheats. Especially if there are several devices on it like servos, motors etc.  In my case after I started the car's temperature went above 65 degrees after 5 mins or so of driving. It really affects the driving experience because to cool down the processor Raspberry Pi slows down itself. I bought and installed Copper cooling for Raspberry Pi to resolve the overheating problem.

Useful links

Adeept AWR 4WD WiFi Smart Robot Car Kit for Raspberry PI

Image file (local copy)

Motor HAT documentation

Tutorials and samples (local copy)

Github repo with the car code  

Copper cooling for Raspberry Pi


Next I will install dev environment and will try to write some code...

No comments:

Post a Comment