OHMC2020 Troubleshooting guide

From Open Hardware Miniconf
Jump to: navigation, search

Check the I2C components are working

   $ i2cdetect -y 1
        0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
   00:          -- -- -- -- -- -- -- -- -- -- -- -- --
   10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
   20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
   30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
   40: 40 -- -- -- -- -- -- -- -- -- -- -- -- 4d -- --
   50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
   60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
   70: 70 -- -- -- -- -- 76 --
     GY-91 10DOF MPU-9250 & BMP280
     0x3C  - OLED Display (SSD1306_128_64)
     0x40  - PCA9685PW: Normal use (PWM / servo)
     0x4D  - MPC3021 (battery volt ADC) 1001101X
     0x68* - MPU9250 (gyroscope/accelerometer sensors)
     0x70  - PCA9685PW: All call address (PWM / servo)
     0x70  - PCA9685PW (PWM / servo)
     0x76* - BMP280 (pressure)

If the output doesn't look like this, something isn't being detected properly and your car may not be working as expected.

rPi reboots and Auto-starting donkeycar without logging in

If your rPi reboots when you're driving, check the following things:

  1. did you swap the servo wires between steering and power. Turn the ESC off, unplug one servo wire, turn the ESC back on (little toggle switch), and test steering. Make sure that steering does not activate the wheel motors.
  2. is your battery low? are you accelerating too quickly?

Because the battery has a high internal resistance, if you demand a lot of power too quickly, the voltage on the battery drops enough that the rPi gets below its critical voltage (when you add the voltage drop from the voltage converter), and the rPi reboots.

To restart donkey server automatically, do the following on your car:

  • Add this to /etc/rc.local:

su - pi -c 'cd ~/ohmc_car; python manage.py drive &>/tmp/out' &

  • move 'source ~/env/bin/activate' from ~/.bashrc to ~/.profile

Steering and throttle calibration

To save time at the workshop, you won't need to calibrate your car's steering and/or throttle. However, you may get better results and can perform calibration when you have time.

DonkeyCar instructions on calibration

Camera troubles?

You can check if the camera is working at all (the ribbon cables can be delicate) by running

  • vcgencmd get_camera which should return supported=1 detected=1
  • raspistill -o filename.jpg. You'll need to copy the file to somewhere you can view the file. (scp it to your laptop).

If the camera isn't detected, then there's probably a connection problem between the board and the camera - check the ribbon cable. If the camera is detected but it can't take a photo, there's possibly a software problem.