Go Down

Topic: Arduino Easy VR Module Upload Errors (Read 821 times) previous topic - next topic

Whitecat106

Hello, recently I have encountered numerous problems with the VeeaR EasyVR Shield, after downloading all necessary software, I recorded various commands into the VR shield, this went smoothly however I am finding issues when uploading the programming to go with the Easy Vr Shield, I have received the same issues when uploading onto either of my Mega 2560 boards or my Arduino Uno, I am running the Arduino 1.5.2 software and the correct drivers for each board.
This is my code I am attempting to upload:
Code: [Select]

#include "Arduino.h"
#include "SoftwareSerial.h"
SoftwareSerial port(12,13);
#include "EasyVR.h"
EasyVR easyvr(port);

//Groups and Commands
enum Groups
{
  GROUP_0  = 0,
  GROUP_1  = 1,
  GROUP_3  = 3,
};

enum Group0
{
  G0_ROBOT= 0,
};

enum Group1
{
  G1_MOVE = 0,
  G1_TIME = 1,
  G1_DATE = 2,
  G1_LOCATION = 3,
  G1_TEMPERATURE = 4,
  G1_COLOUR = 5,
  G1_HUMIDITY = 6,
  G1_MOTION = 7,
  G1_DISTANCE = 8,
  G1_BEARING = 9,
  G1_POWER = 10,
  G1_AIR = 11,
  G1_DISPLAY = 12,
  G1_QUESTION = 13,
  G1_MANUAL = 14,
  G1_AUTO = 15,
  G1_RUN = 16,
  G1_POWERDOWN = 17,
  G1_WAKEUP = 18,
};

enum Group3
{
  G3_LEFT = 0,
  G3_RIGHT = 1,
  G3_FORWARD = 2,
  G3_BACKWARD = 3,
  G3_FOLLOW = 4,
  G3_STOP = 5,
  G3_GRAB = 6,
};




EasyVRBridge bridge;

int8_t group, idx;

void setup()
{
  // bridge mode?
  if (bridge.check())
  {
    cli();
    bridge.loop(0, 1, 12, 13);
  }
  // run normally
  Serial.begin(9600);
  port.begin(9600);
  Serial.println("setup good");

  if (!easyvr.detect())
  {
    Serial.println("EasyVR not detected!");
    for (;;);
  }

  easyvr.setPinOutput(EasyVR::IO1, LOW);
  Serial.println("EasyVR detected!");
  easyvr.setTimeout(5);
  easyvr.setLanguage(0);

  group = EasyVR::TRIGGER; //<-- start group (customize)
}

void action();

void loop()
{
  easyvr.setPinOutput(EasyVR::IO1, HIGH); // LED on (listening)

  Serial.print("Say a command in Group ");
  Serial.println(group);
  easyvr.recognizeCommand(group);

  do
  {
    // can do some processing while waiting for a spoken command
  }
  while (!easyvr.hasFinished());
 
  easyvr.setPinOutput(EasyVR::IO1, LOW); // LED off

  idx = easyvr.getWord();
  if (idx >= 0)
  {
    // built-in trigger (ROBOT)
    // group = GROUP_X; <-- jump to another group X
    return;
  }
  idx = easyvr.getCommand();
  if (idx >= 0)
  {
    // print debug message
    uint8_t train = 0;
    char name[32];
    Serial.print("Command: ");
    Serial.print(idx);
    if (easyvr.dumpCommand(group, idx, name, train))
    {
      Serial.print(" = ");
      Serial.println(name);
    }
    else
      Serial.println();
    easyvr.playSound(0, EasyVR::VOL_FULL);
    // perform some action
    action();
  }
  else // errors or timeout
  {
    if (easyvr.isTimeout())
      Serial.println("Timed out, try again...");
    int16_t err = easyvr.getError();
    if (err >= 0)
    {
      Serial.print("Error ");
      Serial.println(err, HEX);
    }
  }
}

void action()
{
    switch (group)
    {
    case GROUP_0:
      switch (idx)
      {
      case G0_ROBOT:
        // write your action code here
        digitalWrite(8,HIGH); // LED to tell me if this is working
        Serial.println("IT WORKS");
        group = GROUP_1;
        delay(10);
        digitalWrite(8,LOW);
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    case GROUP_1:
      switch (idx)
      {
      case G1_MOVE:
        // write your action code here
        digitalWrite(7, HIGH); // LED to tell me if this is working
        delay(1000);
        digitalWrite(7, LOW);
        Serial.println("YES");
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_TIME:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_DATE:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_LOCATION:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_TEMPERATURE:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_COLOUR:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_HUMIDITY:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_MOTION:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_DISTANCE:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_BEARING:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_POWER:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_AIR:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_DISPLAY:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_QUESTION:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_MANUAL:
        // write your action code here
          digitalWrite(6, HIGH); // LED's to tell me this is working
        delay(1000);
        digitalWrite(6, LOW);
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_AUTO:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_RUN:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_POWERDOWN:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G1_WAKEUP:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
    case GROUP_3:
      switch (idx)
      {
      case G3_LEFT:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_RIGHT:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_FORWARD:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_BACKWARD:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_FOLLOW:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_STOP:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      case G3_GRAB:
        // write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        break;
      }
      break;
   
      break;
    }
}




After uploading this I receive the following error messages:

Quote

avrdude: stk500v2_RecieveMessage(): timeout
avrdude: stk500v2_RecieveMessage(): timeout
avrdude: stk500v2_RecieveMessage(): timeout
avrdude: stk500v2_RecieveMessage(): timeout
avrdude: stk500v2_RecieveMessage(): timeout
avrdude: stk500v2_RecieveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer


More recently I have begun to only receive the 'famous' -
avrdude: stk500v2_getsync(): resp=0x00
- error upon uploading, however I am unsure how related these two error messages are.

I am a competent programmer however I may simply be making a rookie error here or most likely there is an issue with my EasyVR Shield, considering that the example code from the library also results in the same upload errors I think this is most likely the case, however any advice would be greatly appreciated here  :)

codlink

Does it upload to the Arduino without the VR Shield attached?

Have you checked that the correct board is selected under "Tools>Board?"

I have some experience with the EasyVR shield and willing to help.
//LiNK

Whitecat106

Thank you very much, yes the correct port has been selected and yes the program will upload to the board without the Vr Shield attached, I tried uploading the program to the mega/uno and then attaching the shield however when I connect the power I only receive a solitary ' w ' through the serial display I am unsure if this is a fault message or just a start up bug of the Vr, other than that I have no success with the Vr shield apart from the LED telling me it is on.  :~

codlink

What are the jumpers set to on the shield?
//LiNK

Whitecat106

Do you mean the UP, PC, HW and SW double male headers to the right of the logo on the shield? If so then there is a connector between the first and second rows of the PC pin, sorry if this is not what you mean...

codlink

Move that jumper to SW and try it again.
//LiNK

Whitecat106

Thank you very much it works perfectly now, uploads and reads commands correctly, very much appreciated and thanks for the quick feedback!!!  :D

Go Up