GithubHelp home page GithubHelp logo

sunfounder / sunfounder_picar-v Goto Github PK

View Code? Open in Web Editor NEW
110.0 32.0 175.0 86.07 MB

Smart Video Car Kit V2.0 for Raspberry Pi from SunFounder

License: GNU General Public License v2.0

Python 96.41% C 0.58% Shell 0.32% CSS 0.23% JavaScript 0.36% HTML 2.09%

sunfounder_picar-v's Introduction

SunFounder Smart Video Car Kit for Raspberry Pi

SunFounder Smart Video Car Kit V2.0

Quick Links:

About this kit:

This kit is a upgrade from Sunfounder Smart Video Car Kit for Raspberry Pi. With wide angle camera, new motor driver, with-sensor-extension Robot HATS, makes this kit cleaner, much more beautiful and much more useful. Also, as motor driver has been change to TB6612FNG, this code is not compatible with Version 1.

This code is divided into two part, server and client. Server runs under Python 3 and Django 2, and client runs under Python 3 and PyQt 5. Server side runs on Raspberry Pi, and you can run the client side on Windows and Linux (Haven't test on Mac.). Also, you can control the car via web browser. Even though its not that better, but it works.

We are happy to see your issus and pull request. Feel free to be apart.


About SunFounder

SunFounder is a technology company focused on Raspberry Pi and Arduino open source community development. Committed to the promotion of open source culture, we strives to bring the fun of electronics making to people all around the world and enable everyone to be a maker. Our products include learning kits, development boards, robots, sensor modules and development tools. In addition to high quality products, SunFounder also offers video tutorials to help you make your own project. If you have interest in open source or making something cool, welcome to join us!


License

This is the code for SunFounder Smart Video Car Kit V2.0. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied wa rranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

SunFounder Smart Video Car Kit for Raspberry Pi comes with ABSOLUTELY NO WARRANTY; for details run ./show w. This is free software, and you are welcome to redistribute it under certain conditions; run ./show c for details.

SunFounder, Inc., hereby disclaims all copyright interest in the program 'SunFounder Smart Video Car Kit for Raspberry Pi' (which makes passes at compilers).

Mike Huang, 21 August 2015

Mike Huang, Chief Executive Officer

Email: [email protected]


Contact us:

website: www.sunfounder.com

E-mail: [email protected]

sunfounder_picar-v's People

Contributors

cavonlee avatar hannesa2 avatar usergsz avatar xiemeiping avatar zhangzhiyong0410 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sunfounder_picar-v's Issues

Server running failed [picar]

With sudo ./start I run into

image

Ok, I do what they want and run python manage.py migrate

image

I've no clue what's going on. I found this Medium comment, but neither I know exactly what to copy to which destination, nor I know if this is smart to copy stuff

Remote Control - Import Errors for cam, fw and bw

I have run the ./install_dependencies shell script under the folder SunFounder_PiCar-V

pi@raspberrypi:~ $ ls -l SunFounder_PiCar-V/
total 56
drwxr-xr-x 2 pi pi  4096 Nov 13 16:01 ball_track
drwxr-xr-x 2 pi pi  4096 Nov 13 16:01 datasheet
drwxr-xr-x 2 pi pi  4096 Nov 13 16:01 docs
-rw-r--r-- 1 pi pi  3740 Nov 13 16:01 i2cHelper.py
-rw-r--r-- 1 pi pi     0 Nov 13 16:01 __init__.py
-rwxr-xr-x 1 pi pi  5219 Nov 13 17:48 install_dependencies
-rw-r--r-- 1 pi pi 15518 Nov 13 16:01 LICENSE
drwxr-xr-x 3 pi pi  4096 Nov 13 16:01 mjpg-streamer
-rw-r--r-- 1 pi pi  3536 Nov 13 16:01 README.md
drwxr-xr-x 4 pi pi  4096 Nov 17 17:34 remote_control
-rw-r--r-- 1 pi pi  1131 Nov 13 16:01 show

No errors were identified during the install script.

However when I navigate to /home/pi/SunFounder_PiCar-V/remote-control/ and run sudo ./start

I get the following tracebacks, the django UI is up and functioning but it seem the camera module isn't working and the wheels are not calibrating.

Internal Server Error: /run/
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/pi/SunFounder_PiCar-V/remote_control/remote_control/views.py", line 70, in run
    bw.ready()
NameError: name 'bw' is not defined
[17/Nov/2020 18:20:56] "GET /run/?action=bwready HTTP/1.1" 500 59969
Internal Server Error: /run/
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/pi/SunFounder_PiCar-V/remote_control/remote_control/views.py", line 87, in run
    fw.ready()
NameError: name 'fw' is not defined
[17/Nov/2020 18:20:57] "GET /run/?action=fwready HTTP/1.1" 500 59936
Internal Server Error: /run/
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/pi/SunFounder_PiCar-V/remote_control/remote_control/views.py", line 100, in run
    cam.ready()
NameError: name 'cam' is not defined

missing parts in kit, cad model ?

Hello,
I have bought a picar v with missing parts preventing me to assemble the front wheels. Missing parts are 6 bearing shields and 6 Hex front wheel fixing plate. I reached out to [email protected] but for now didn't get any reply. Since those are small basic parts I was wondering if someone could give me their specs so that I can use a 3d printer to make them ?

Thanks

remote_control ./start "You have 1 unapplied migration(s)." issue

When running the remote_control ./start on a new Raspberry Pi 3+ you get:

pi@raspberrypi:~/SunFounder_PiCar-V/remote_control $ sudo ./start
Server running
Performing system checks...

DEBUG "front_wheels.py": Set debug off
DEBUG "front_wheels.py": Set wheel debug off
DEBUG "Servo.py": Set debug off
DEBUG "back_wheels.py": Set debug off
DEBUG "TB6612.py": Set debug off
DEBUG "TB6612.py": Set debug off
DEBUG "PCA9685.py": Set debug off
DEBUG "camera.py": Set debug off
DEBUG "camera.py": Set pan servo and tilt servo debug off
DEBUG "Servo.py": Set debug off
DEBUG "Servo.py": Set debug off
mjpg_streamer -i "/usr/local/lib/input_uvc.so" -o "/usr/local/lib/output_http.so                    -w /usr/local/www" &
None
System check identified no issues (0 silenced).

You have 1 unapplied migration(s). Your project may not work properly until you                    apply the migrations for app(s): auth.
Run 'python manage.py migrate' to apply them.

The problem is the "Run 'python manage.py migrate' to apply them." output, as the latest Raspbian image comes with both python2 and python3 installed, with 'python' launching python2. As a result to fix the migration issue, you actually have to run python3 manage.py migrate.

control via web browser from android

Hello,
can't find the PiCarV V.2 from my android devices. It works fine with linux-laptop via server/client and also with ip in firefox seems to work. Same ip in firefox at android (tablet and mobile) does not work. I have no idea how to configure it.
Thank you for help.
Best Regards
Thomas

Server running failed [django]

With sudo ./start I run into

image

Ok, I do what they want and run python manage.py migrate

image

ImportError: cannot import name 'render_to_response' from 'django.shortcuts'

I've no clue what's going on. Does someone has a hint to get rid of it ?

./install_dependecies fail

I noticed that this is a know error, but I have one suggestion:

pi@raspberrypi:~/SunFounder_PiCar-V $ sudo ./install_dependencies 
./install_dependencies: line 16: is_installed_libjpeg8-dev=False: command not found
Hit:1 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Reading package lists... Done                      

Installing django 

Collecting django
  **Downloading Django-2.0.tar.gz (8.0MB)**
    100% |████████████████████████████████| 8.0MB 32kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-4XOHna/django/setup.py", line 32, in <module>
        version = __import__('django').get_version()
      File "django/__init__.py", line 1, in <module>
        from django.utils.version import get_version
      File "django/utils/version.py", line 61, in <module>
        @functools.lru_cache()
    AttributeError: 'module' object has no attribute 'lru_cache'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4XOHna/django/
    Failed to installed django.
    Do you want to skip this? (yes/no) 
pi@raspberrypi:~ $ python -V
Python 2.7.13
pi@raspberrypi:~ $ which python
/usr/bin/python
pi@raspberrypi:~ $ which pip
/usr/bin/pip

Searching on the Django documentation I noticed that the Django 2.0 is not compatible with python 2.7.13.
Django installation

I thinking that your script needs check the version of python and run the correct command.

In my case the version is 3.5.3 so I needed to use this command:
sudo pip3 install django

Ball track doesn't work

It would be nice, if delivered software would work out of the box

This python3 ball_track/ball_tracker.py runs into

[ WARN:0] global /tmp/pip-wheel-qd18ncao/opencv-python/opencv/modules/videoio/src/cap_v4l.cpp (893) open VIDEOIO(V4L2:/dev/video0): can't open camera by index
DEBUG "back_wheels.py": Set debug off
DEBUG "TB6612.py": Set debug off
DEBUG "TB6612.py": Set debug off
DEBUG "PCA9685.py": Set debug off
DEBUG "front_wheels.py": Set debug off
DEBUG "front_wheels.py": Set wheel debug off
DEBUG "Servo.py": Set debug off
Begin!
Traceback (most recent call last):
  File "ball_track/ball_tracker.py", line 257, in <module>
    main()
  File "ball_track/ball_tracker.py", line 97, in main
    (tmp_x, tmp_y), tmp_r = find_blob()
  File "ball_track/ball_tracker.py", line 202, in find_blob
    bgr_image = cv2.medianBlur(bgr_image, 3)
cv2.error: OpenCV(4.5.1) /tmp/pip-wheel-qd18ncao/opencv-python/opencv/modules/imgproc/src/median_blur.dispatch.cpp:283: error: (-215:Assertion failed) !_src0.empty() in function 'medianBlur'

pi car camera v2 - error: that port is already in use

Hi
need your help.

i had that "unapplied migration(s)" issue that with the python manage.py, so i did the "python3 manage.py migrate"
that someone suggested here.

then restarted and tried again, now i get an error "error: that port is already in use" and program aborts!

login as: pi
[email protected]'s password:
Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Sep 22 09:26:57 2020
pi@raspberrypi:~ $ ls
Desktop MagPi SunFounder_PiCar
Documents Music SunFounder_PiCar-V
Downloads Pictures Templates
dragit_installer.py Public Videos
line_graph-2019-09-16-10-51-29.py 'say hello.sb2'
pi@raspberrypi:~ $ cd /SunFounder_PiCar-V/remote_control
pi@raspberrypi:
/SunFounder_PiCar-V/remote_control $ sudo ./start
Server running
Performing system checks...

DEBUG "front_wheels.py": Set debug off
DEBUG "front_wheels.py": Set wheel debug off
DEBUG "Servo.py": Set debug off
DEBUG "back_wheels.py": Set debug off
DEBUG "TB6612.py": Set debug off
DEBUG "TB6612.py": Set debug off
DEBUG "PCA9685.py": Set debug off
DEBUG "camera.py": Set debug off
DEBUG "camera.py": Set pan servo and tilt servo debug off
DEBUG "Servo.py": Set debug off
DEBUG "Servo.py": Set debug off
mjpg_streamer -i "/usr/local/lib/input_uvc.so" -o "/usr/local/lib/output_http.so -w /usr/local/www" &
None
System check identified no issues (0 silenced).
September 22, 2020 - 06:33:13
Django version 2.0, using settings 'remote_control.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Error: That port is already in use.
pi@raspberrypi:/SunFounder_PiCar-V/remote_control $
pi@raspberrypi:
/SunFounder_PiCar-V/remote_control

any help will be great.
btw, i used to have 2 ip's (???) 10.0.0.18 & 10.0.0.19 but now suddenly the "19" dosent work, only the "18" works.

thanks!

Picar servo-install fail.

~/SunFounder_PiCar-V $ picar servo-install
Traceback (most recent call last):
File "/usr/local/bin/picar", line 11, in
load_entry_point('SunFounder-PiCar==1.0.1', 'console_scripts', 'picar')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2631, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2291, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2301, in resolve
raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'main'

TB6612 + johnny-five

Hey, I'm trying to code this car with johnny-five. I was able to make servos working, but got a problem with motors. Couuld any one tell me what phisical pins motor use? PWM, DIR, CDIR... have a problem to figured it out.

picar servo-install command fails

I have an issue with a picar servo-install command, here is a stack trace:

$ picar servo-install
Traceback (most recent call last):
  File "/usr/local/bin/picar", line 11, in <module>
    load_entry_point('SunFounder-PiCar==1.0.0', 'console_scripts', 'picar')()
  File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/__init__.py", line 43, in main
    setup()
  File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/__init__.py", line 80, in setup
    pwm=PCA9685.PWM(bus_number=1)
  File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/SunFounder_PCA9685/PCA9685.py", line 116, in __init__
    self.bus = smbus.SMBus(self.bus_number)
IOError: [Errno 2] No such file or directory

Please advise @sunfounder

Run the server automatically

Hello,

is there the possibility, that the server is run automatically when i start the raspi, so that i do not need to log into the Raspi remotely every time when i want to drive the car?

Client crashing on 'camready'

When I click the login button in the client the client crashes. In the console it shows the last command it tried running is 'action=camready'. I've tried running it several time and every time it crashes on 'camready'.

I'm unsure what to do. When I ran the command 'picar servo-install' the console just showed 'Servo now is set to 90 degree.' but nothing else showed up and it appeared as if something was still running. Maybe I not wait long enough during this step and something else is suppose to show up?

I realize that I look like an intruder

Dear Pi-Car Owners,
I admit that I do not own any kit but I am a new PYTHON learner and every time I search for a project this project pops up so I download it and I realize that there is the line codes:
from SunFounder_Line_Follower import Line_Follower
from picar import front_wheels
from picar import back_wheels
import time
import picar
so I realize that the key is picar.py so I am asking can I get a copy of the file? please!

BIG PROBLEM

Dear programmers,

we are working on a project about the sunfounder pi-car. Can someone send me a specific code. I only need the code, which ensures that your car goes forward and backwards.

I hope you can help me.

Servo install syntax error

I have a problem wwith servo installing. I followed the instructions by step by step. After I wrote the command "picar servo-install" it says SyntaxError : Missing parentheses in call to ''print''
pls help
57415233_2228016670861393_2221256136579874816_n

Car stops after a few commands

After I run a few commands, the car stops running and refuses to continue until I reboot the raspberry pi. The SSH window shows it is receiving and acknowledging the commands, but the motors and servos do not move.

Server Issue

I have tried alot of time to login through client.py.But after entering the ip address of pi & port 8000.Always login failed.Also tried http://IP of raspberry:8000/.Nothing happening.

Please guide on this issue.

thanking you.

calibration config lost on reboot

Hi:
I don't know if it a bug or a feature request, but on my install calibration changes are not saved and lost on reboot.
driver/config file is not changed, not even with 777 permissions, and remote_control/db.sqlite is recreated on Server start, but it seems doesn't change after callibrations.

Just checking wiring diagram - doesn't match physical wires in kit

The wiring diagram on pages 24 and 25, for the motor connections, clearly show the black wire on the left and red wire on the right, in both diagrams. However, in my kit the connectors have the red wire on the left and black wire on the right, for both motors. Please let me know if this will be a problem for me. Thanks.

Traceback (most recent call last):

When I try to run python client.py I get this:
Traceback (most recent call last):
File "client.py", line 15, in
from PyQt5 import QtCore, uic, QtWidgets
ImportError: No module named 'PyQt5'

Install openCV failed

During sudo ./install_dependencies
I run into

E: Unable to locate package python3-opencv
    Failed to installed python-opencv 

    Do you want to skip this? (yes/no

How do you guys got rid of it ?

picar servo-install hangs

It seems that the version of picar I have sits in an infinite loop.

File: /usr/local/lib/python3.5/dist-packages/SunFounder_PiCar-1.0.1-py3.5.egg/picar/__init__.py

def servo_install():
    import time
    delay = 1.0/180
    if len(sys.argv) >= 3:
        print("servo-install takes no value")
        usage()
    print("Servo now is set to 90 degree.")
    servo0 = Servo.Servo(0, bus_number=1)
    servo1 = Servo.Servo(1, bus_number=1)
    servo2 = Servo.Servo(2, bus_number=1)
    for i in range(90, -1, -1):
        servo0.write(i)
        servo1.write(i)
        servo2.write(i)
        time.sleep(delay)
    time.sleep(0.1)
    for i in range(0, 181, 1):
        servo0.write(i)
        servo1.write(i)
        servo2.write(i)
        time.sleep(delay)
    time.sleep(0.1)
    for i in range(180, 89, -1):
        servo0.write(i)
        servo1.write(i)
        servo2.write(i)
        time.sleep(delay)
    time.sleep(0.1)
    servo0.write(90)
    servo1.write(90)
    servo2.write(90)
    while True:
        time.sleep(1)

Notice the while True loop. Thus when I run the command picar servo-install it just sits there forever, I don't think I need to keep the python programming running after I've run the command successfully?

Thanks!

ball_tracker.py - no module named PiCar

I know in the readme, it states that we need cv2/opencv which is already installed on my Picar, but when I tried to run this python script with idle (similarly to running the client.py script for client connection to the Pi server via wifi) - this ball_tracker.py script is throwing an error about needing a PiCar module. I went online and found the PiCar repository but cant seem to figure out how to install the module manually in my python library. Any suggestions or am I missing something and need to run this from the car/raspberry pi/server or something else potentially? Thanks!

picar servo-install Traceback error

Hello,
I have an error on the fresh install of Rapbian :

pi@raspberrypi:~/SunFounder_PiCar $ picar servo-install
Traceback (most recent call last):
File "/usr/local/bin/picar", line 11, in
load_entry_point('SunFounder-PiCar==1.0.0', 'console_scripts', 'picar')()
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/init.py", line 15, in main
servo0 = Servo(0, bus_number=1)
TypeError: 'module' object is not callable

Another command of picar found :
pi@raspberrypi:~/SunFounder_PiCar $ picar front-wheel-test
DEBUG "front_wheels.py": Set debug off
DEBUG "front_wheels.py": Set wheel debug off
DEBUG "Servo.py": Set debug off
turn_left
turn_straight
...

picar rear-wheel-test
DEBUG "back_wheels.py": Set debug off
DEBUG "TB6612.py": Set debug off
DEBUG "TB6612.py": Set debug off
DEBUG "PCA9685.py": Set debug off
Forward, speed = 0
Forward, speed = 1
Forward, speed = 2
Forward, speed = 3
...

Can you help me please.

Thank you in advance,

PiCar-S - picar command promtin error

I was following the standard user manual.
when I try picar command I get following error.

pi@snartcar:~ $ picar
Traceback (most recent call last):
File "/usr/local/bin/picar", line 8, in
load_entry_point('SunFounder-PiCar==1.0.1', 'console_scripts', 'picar')()
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.1-py2.7.egg/picar/init.py", line 43, in main
setup()
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.1-py2.7.egg/picar/init.py", line 80, in setup
pwm=PCA9685.PWM(bus_number=1)
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.1-py2.7.egg/picar/SunFounder_PCA9685/PCA9685.py", line 47, in init
self.bus = smbus.SMBus(self.bus_number)
IOError: [Errno 2] No such file or directory

Front Wheels not moving. Back wheels work fine

Hi

I just assembled the PiCar S and installed the software. When i run " picar front-wheel-test" nothing happens. However, the back wheels are mving with the command "picar rear-wheel-test". Please help

Library for PHP Possible?

Looked through the python code and i want to recreate in PHP using something like https://github.com/WiringPi/WiringPi-PHP

I would like to know if its possible to access the servos/motors on the boards via the above library? (It can access I2C and GPIO)

I am just playing with the below:

php $handle = wiringPiI2CSetup(0x40); // The PCA9685 device

$testWrite = wiringPiI2CWriteReg16($handle, 0xFC, 1); // 1 or 0 on/off?

install_dependencies fail

Hi,
When I run an install_dependencies command in raspberry pi, I get an error that python set up has failed. Please see the attached screenshot. I am sorry for the image quality, as it was taken off my TV and not off a computer monitor. I am connected to the internet, and the files were downloaded completely.
error
What is going wrong?

No pip installed - required by install_dependencies

The script install_dependencies requires pip which it doesn't install by itself and fails when using it first with:

Installing django

sudo: pip: command not found
    Failed to installed django.
    Do you want to skip this? (yes/no) no

For everyone running into the same issue: the following line fixes it:

sudo apt-get install python-pip

client.py failure via remote ssh

When running client.py, I get the following error qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display. I've tried using xvfb to run it but it didn't work. Is there a way I can just route everything to django? I'm a fairly experienced django developer.

Please help me figure out what's going on and what I can do fix this. Also the wheels keep trying to turn further than they can at random times when the server is running ( sudo ./start )

Remote control connection hangs and freezes

When I connect to the PiCar via WiFi, the client periodically hangs, the video freezes, and the car will continue whatever command it received last. Often, this results in the PiCar crashing into an object.

The issue is the most common using the Python client on Windows.

Using the web interface instead of the Python client helps, but it still freezes from time to time.

I have tried using both the Raspberry Pi 3 B onboard wifi and the supplied Ralink adapter.

The issue occurs even if the WiFi link quality shows as 70/70 in ifconfig.

When it is frozen, the Pi itself is still working normally but the output of the server process does not show any new commands being received.

PICAR SERVO-INSTALL (no module named 'smbus')

i will install picar.
error: ImportError: No module named 'smbus'

i have install the module, than RPi.GPIO, install, then
error: ImportError: No module named 'commands'

i have reinstall raspian, last with date from the Introduction.

greets from germany, michael

Screenshot 2019-07-30 17 02 05

IOError: [Errno 2] No such file or directory

we tried to build the car, but when we ran the command "picar servo-install" it would give us an error.

Traceback (most recent call last):
File "/usr/local/bin/picar", line 11, in
load_entry_point('SunFounder-PiCar==1.0.0', 'console_scripts', 'picar')()
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/init.py", line 43, in main
setup()
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/init.py", line 80, in setup
pwm=PCA9685.PWM(bus_number=1)
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/SunFounder_PCA9685/PCA9685.py", line 116, in init
self.bus = smbus.SMBus(self.bus_number)
IOError: [Errno 2] No such file or directory

remote control

hi,
my problem is that when i run the client and try to control the car with my keybord, it won't work, if i press S it moves forwards and when i press W it moves backwards.
If i press A or D nothing happens, if i press the left or right arrow the front wheels move left and right and finally if i press the up and down arrow the camera moves left and right.
pls help me

"Connection refused"

Not sure what's wrong. I've followed the instructions exactly. Here's what I see when I have the server up and running and try to log into the client.

url: http://192.168.2.254:8000/run/?action=camready Traceback (most recent call last): File "client.py", line 288, in reflash_frame pixmap = self.transToPixmap() File "client.py", line 271, in transToPixmap data = self.queryImage.queryImage() File "client.py", line 689, in queryImage http_data.endheaders() File "/usr/lib/python3.7/http/client.py", line 1224, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1016, in _send_output self.send(msg) File "/usr/lib/python3.7/http/client.py", line 956, in send self.connect() File "/usr/lib/python3.7/http/client.py", line 928, in connect (self.host,self.port), self.timeout, self.source_address) File "/usr/lib/python3.7/socket.py", line 727, in create_connection raise err File "/usr/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused Aborted

Remote_control ./start

Hi,
When i try to launch the server, I get an error.

Please advise

pi@raspberrypi:~/SunFounder_PiCar-V/remote_control $ sudo ./start
Server running
Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x75a8c1f0>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 124, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/pi/SunFounder_PiCar-V/remote_control/remote_control/urls.py", line 18, in
import views, settings
File "/home/pi/SunFounder_PiCar-V/remote_control/remote_control/views.py", line 14, in
from driver import camera, stream
File "/home/pi/SunFounder_PiCar-V/remote_control/remote_control/driver/camera.py", line 14, in
from picar.SunFounder_PCA9685 import Servo
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/init.py", line 5, in
import PCF8591
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/PCF8591.py", line 21
RPI_REVISION_0 = ["900092"]
^
IndentationError: unindent does not match any outer indentation level

Sun Founder PiCar-V File "manage.py"

To save any unnecessary effort - - an hour after posting this I realised I'd forgot to install_dependencies .... and that included django.core.management

In the Raspberry Pi terminal:
cd ~/SunFounder_PiCar-V/remote_control/ (this is fine - no problem)

sudo ./start (this has stopped working and produces the following error message -

Server running
Traceback (most recent call last):
File "manage.py", line 8, in
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management

NB: I've tried starting again and installing everything again including:

Despite all of the above the error message continues to appear!?
.... I'm left wondering if SunFounder_PiCar-V is located in the right place. At the moment I've located it in the Python3.6.1 folder. Apart from this I'm bereft of ideas of how to proceed.

Does anyone have a/the solution?

rear wheels not working

Except of the rear wheels the remote control works fine.

If I run "sudo picar rear-wheel-test", the test ist performing but no wheels are spinning.

I checked the motors by connecting them directly to the batteries -> OK, both spinning.

The power led on the motor-driver-module does not light up even using driving commands trough remote control.

If I change the position of the power-and-motor-control-cables (red and black) connecting motor-driving-module and PCA9865-module at the PCA9865-module from position 4 (yellow/PWM) and 5 (yellow/PWM) to position 4 (red/VIN) and 5 (red/VIN) both wheels are spinning constantly forward and the power led of the motor-driving-module lights up.
So it seems that with wiring like in the manual no signal is transmitted to the motors probably due a failure in the code?

Has anyone an idea where the problem could be?

Compatibility with Nvidia Jetson Nano

Hello everyone!

I would like to learn how to use sunfounder picar V kit with jetson nano?

What I will need to do (in terms of installation of software and to code drivers) to make it work with jetson nano?

I just bought the kit and I do not have enough experience with embedded systems.

Any help will be appreciated.

Thanks.

client.py error

I was able to get the web server to work but the calibration was not working. So, now I am trying to use client.py. Whn I run the program the login window opens and I can type the ip address but there is no "enter" or "login" button. So I can not log in. The shell shows and error: see pic.
Annotation 2019-11-01 000409

Hi Guys

I am receiving this error when i am running the server. please advise

SunFounder_PiCar SunFounder_PiCar-V
pi@raspberrypi:~/git $ cd /git/SunFounder_PiCar-V/remote_control
pi@raspberrypi:
/git/SunFounder_PiCar-V/remote_control $ sudo ./start

Server running
Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x75f3f230>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 227, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 125, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/pi/git/SunFounder_PiCar-V/remote_control/remote_control/urls.py", line 18, in
import views, settings
File "/home/pi/git/SunFounder_PiCar-V/remote_control/remote_control/views.py", line 19, in
picar.setup()
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/init.py", line 49, in setup

File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/SunFounder_PCA9685/PCA9685.py", line 110, in init

IOError: [Errno 2] No such file or directory

Doesn't work

I installed v1 of the software and it works but v2 doesn't work on Raspberry pi 3

Client script not working

I have issues runnig the client on of the Robocar.

On windows I get following error

When I do python client.py I get the UI when I Log in

ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it.

On ubuntu there is problem with PyQt5. "QtCore.so: undefined symbol "

What should I do?

picar servo-install: IndentationError: unindent does not match any outer indentation level

I get the following error after running (picar servo-install):
IndentationError: unindent does not match any outer indentation level

Kindly advise.

Below is the full output:
pi@raspberrypi:~/SunFounder_PiCar-V $ picar servo-install
Traceback (most recent call last):
File "/usr/local/bin/picar", line 11, in
load_entry_point('SunFounder-PiCar==1.0.0', 'console_scripts', 'picar')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2631, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2291, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2297, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/init.py", line 5, in
import PCF8591
File "/usr/local/lib/python2.7/dist-packages/SunFounder_PiCar-1.0.0-py2.7.egg/picar/PCF8591.py", line 21
RPI_REVISION_0 = ["900092"]
^
IndentationError: unindent does not match any outer indentation level

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.