Monster Borg cant start script on start

i have been able to use the run once command. This allows the robot to drive forwards and back but cant swap back and forth with tank mode.
i followed the instructions to start the scri-p on start-up but nothing happens and i get no errors. any ideas?

piborg's picture

The tank mode controls are a little unusual and work like this:

  1. Hold down the tank mode button (default R2) to use tank mode.
    When released MonsterBorg will resume normal mode.
  2. Set the direction you want to turn using the right stick.
    Fully left / right will be spinning on the spot.
    Smaller amounts will still have some forward / backward motion.
  3. Use the left stick up / down to set the movement speed.
    Pushing down reverses the direction, so generally you want to push up.

So to spin right (clockwise) on the spot you:

  1. Hold tank mode
  2. Push the right stick fully right
  3. Move the left stick up to start spinning and control speed

Debugging the startup can be tricky. The first thing to do is check that the command will work as intended.

  1. Open a terminal
  2. Change to the root directory: cd /
  3. Try running the startup command: /home/pi/monsterborg/runMonsterJoy.sh

If this works then the problem is likely with how it is being started. If it fails to run then the problem is with the script itself.

Still cant get the script to run on start up could you send instructions.
And I get a Failed reading the driver fault state for motor #1
Failed reading the driver fault state for motor #2
This happens after a while. I am using a PS3 Controller

piborg's picture

So the script ran successfully using these commands:

cd /
/home/pi/monsterborg/runMonsterJoy.sh

If so then either the script is not being started at all, or possibly is starting too early.

The first thing to check is that you added the line before the exit 0 line, otherwise it will not be run. For example:

#!/bin/sh -e
#/etc/rc.local
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

/home/pi/monsterborg/runMonsterJoy.sh &

exit 0

If it still does not work then remove it from rc.local and try using crontab instead: https://www.circuitbasics.com/starting-programs-automatically-using-cron...

The line you will need this time is:

@reboot /home/pi/monsterborg/runMonsterJoy.sh
Subscribe to Comments for "Monster Borg cant start script on start"