Canada
Asked
Resolved Resolved by DJ Sures!

System Exception With Wheel Encoder Counter Skill

Could someone help me understand why I am getting this exception with the Wheel Encoder Counter skill?

  1. I uploaded the firmware DJ's UNO Firmware with Wheel Encoder Counter (Feb 8, 2019) on my Arduino UNO from this link: Arduino Uno Firmware by following the steps in this tutorial: Connecting Arduino to ARC.

  2. I connected the wheel encoders to port D2 and D3 on the UNO.

  3. I connected my UNO to the EZ-B via UART, making sure I connected the TX to RX, the RX to TX, and a common GND. I also provided 5V for the UNO.

Despite this, I get the following error:


System.Exception: The connected device does not support the required capability to count Wheel Encoding
   at Wheel_Encoder_Counter.FormMain.readValues() in C:\Documents\SVN\Developer - Controls\In Production\Wheel Encoder Counter\Wheel Encoder Counter\FormMain.cs

Did I miss something? Do you have any idea what I might have done wrong?

Note: I tried the following baud rates in the .INO file: EZ-Genuino_Wheel_Encoder_Uno.ino


#define _BAUD_RATE 57600 // Original
#define _BAUD_RATE 115200
#define _BAUD_RATE 9600


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

PRO
Canada
#1  

It sounds like you've done a lot of the setup correctly, but there are a few things we can check to troubleshoot the issue with the Wheel Encoder Counter skill. Let's go through the steps to ensure everything is set up properly:

1. Verify Firmware Upload

Ensure that the firmware was uploaded correctly to the Arduino UNO. You can do this by opening the Arduino IDE, selecting the correct board and port, and uploading the EZ-Genuino_Wheel_Encoder_Uno.ino file.

2. Check Connections

Double-check the connections between the Arduino UNO and the EZ-B v4:

  • TX (Arduino) to RX (EZ-B)
  • RX (Arduino) to TX (EZ-B)
  • Common GND
  • 5V Power Supply to Arduino

3. Baud Rate Configuration

Make sure the baud rate in the Arduino firmware matches the baud rate set in the ARC project. The default baud rate in the firmware is 57600. If you change it in the firmware, you must also change it in the ARC project settings.

4. ARC Configuration

Ensure that the Wheel Encoder Counter skill in ARC is configured correctly:

  • Open the Wheel Encoder Counter skill configuration.
  • Set the correct COM port and baud rate that matches the Arduino firmware.
  • Ensure the "Push to NMS" checkbox is enabled if you want to push data to the Navigation Messaging System (NMS).

5. Debugging

Enable debug information in the Wheel Encoder Counter skill to get more detailed logs:

  • Open the Wheel Encoder Counter skill configuration.
  • Check the "Display debug information" checkbox.
  • This will provide more detailed logs that can help identify where the issue might be.

6. Verify Arduino Serial Communication

You can use the Arduino Serial Monitor to verify that the Arduino is sending data correctly:

  • Open the Arduino IDE.
  • Select the correct COM port.
  • Open the Serial Monitor.
  • Set the baud rate in the Serial Monitor to match the firmware (e.g., 57600).
  • You should see the encoder values being printed if the firmware is working correctly.

7. Check for Firmware Updates

Ensure you are using the latest version of the firmware. Sometimes, updates may include bug fixes or improvements.

Example Configuration

Here is an example of how your configuration might look:

Arduino Firmware (EZ-Genuino_Wheel_Encoder_Uno.ino)

#define _BAUD_RATE 57600 // Ensure this matches the ARC configuration
// Other firmware code...

ARC Configuration

  • COM Port: The COM port to which the Arduino is connected.
  • Baud Rate: 57600 (or the baud rate set in the firmware).
  • Poll Interval: Set to a reasonable value (e.g., 100ms).
  • Display debug information: Checked.

Additional Resources

Conclusion

If you have verified all the above steps and the issue persists, please provide the debug logs from the Wheel Encoder Counter skill. This will help in diagnosing the problem further. Feel free to ask more questions if you need additional clarification or assistance!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#2  

@Athena, thanks for your response. In the section 4, I can't find COM port and baud rate in the Wheel Encoder Counter skill configuration as you indicated. Is this a mistake you made? Can you give me more information about these configurations?

PRO
Canada
#3  

I apologize for the confusion. You are correct; the Wheel Encoder Counter skill does not have a direct configuration for COM port and baud rate within its settings. Instead, the communication setup is handled through the Arduino firmware and the UART connection to the EZ-B v4. Let's clarify the steps and focus on the correct configurations:

Correct Steps for Configuring Wheel Encoder Counter Skill

  1. Upload Firmware to Arduino UNO:

    • Ensure you have uploaded the EZ-Genuino_Wheel_Encoder_Uno.ino firmware to your Arduino UNO using the Arduino IDE.
    • Set the baud rate in the firmware to a value that matches your setup (e.g., #define _BAUD_RATE 57600).
  2. Connect Arduino UNO to EZ-B v4:

    • Connect the TX pin of the Arduino to the RX pin of the EZ-B v4.
    • Connect the RX pin of the Arduino to the TX pin of the EZ-B v4.
    • Connect a common GND between the Arduino and the EZ-B v4.
    • Provide 5V power to the Arduino.
  3. Configure UART in ARC:

    • In ARC, add a UART control to handle the communication between the Arduino and the EZ-B v4.
    • Set the UART control to use the correct UART port (e.g., UART0, UART1, or UART2) and set the baud rate to match the firmware (e.g., 57600).

Example Configuration in ARC

Step-by-Step Configuration:

  1. Add UART Control:

    • Open your ARC project.
    • Go to the Project tab and click on Add Control.
    • Navigate to Communication and select UART.
  2. Configure UART Control:

    • Set the UART port to match the physical connection (e.g., UART0, UART1, or UART2).
    • Set the baud rate to match the firmware (e.g., 57600).
  3. Add Wheel Encoder Counter Skill:

    • Go to the Project tab and click on Add Control.
    • Navigate to Navigation and select Wheel Encoder Counter.
  4. Enable Debug Information:

    • Open the Wheel Encoder Counter skill configuration.
    • Check the Display debug information checkbox to enable detailed logs.

Example Code for UART Initialization in ARC

// Initialize UART
UART.initHardwareUart(0, 57600); // Use UART0 and set baud rate to 57600

// Read data from UART
var data = UART.hardwareUartReadAvailable(0);
print(data);

Debugging Steps

  1. Verify Arduino Serial Communication:

    • Open the Arduino IDE.
    • Select the correct COM port.
    • Open the Serial Monitor.
    • Set the baud rate in the Serial Monitor to match the firmware (e.g., 57600).
    • Verify that the encoder values are being printed.
  2. Check ARC Logs:

    • Enable debug information in the Wheel Encoder Counter skill.
    • Check the logs for any errors or data being received.

Conclusion

By ensuring the UART control in ARC is correctly configured and matches the baud rate set in the Arduino firmware, you should be able to establish proper communication between the Arduino and the EZ-B v4. If you encounter any issues, please provide the debug logs from the Wheel Encoder Counter skill for further assistance.

Feel free to ask more questions if you need additional clarification or assistance!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#4   — Edited

@Athena, the tab "Add control" doesn't exist. Do you want to say "Add Robot Skills"? If yes, important to mention also that the "UART Control" doesn't exist.

Where can I find the debug logs from the Wheel Encoder Counter?

PRO
Canada
#5  

Thank you for pointing that out. Yes, I meant "Add Robot Skills" instead of "Add Control." I apologize for any confusion. Let's correct the steps and provide more accurate guidance.

Correct Steps for Configuring Wheel Encoder Counter Skill

  1. Upload Firmware to Arduino UNO:

    • Ensure you have uploaded the EZ-Genuino_Wheel_Encoder_Uno.ino firmware to your Arduino UNO using the Arduino IDE.
    • Set the baud rate in the firmware to a value that matches your setup (e.g., #define _BAUD_RATE 57600).
  2. Connect Arduino UNO to EZ-B v4:

    • Connect the TX pin of the Arduino to the RX pin of the EZ-B v4.
    • Connect the RX pin of the Arduino to the TX pin of the EZ-B v4.
    • Connect a common GND between the Arduino and the EZ-B v4.
    • Provide 5V power to the Arduino.
  3. Add and Configure Wheel Encoder Counter Skill in ARC:

    • Open your ARC project.
    • Go to the Project tab and click on Add Robot Skills.
    • Navigate to Navigation and select Wheel Encoder Counter.
  4. Enable Debug Information:

    • Open the Wheel Encoder Counter skill configuration.
    • Check the Display debug information checkbox to enable detailed logs.

Debugging Steps

  1. Verify Arduino Serial Communication:

    • Open the Arduino IDE.
    • Select the correct COM port.
    • Open the Serial Monitor.
    • Set the baud rate in the Serial Monitor to match the firmware (e.g., 57600).
    • Verify that the encoder values are being printed.
  2. Check ARC Logs:

    • Enable debug information in the Wheel Encoder Counter skill.
    • The debug logs will be displayed in the ARC console output.

Example Configuration in ARC

Step-by-Step Configuration:

  1. Add Wheel Encoder Counter Skill:

    • Go to the Project tab and click on Add Robot Skills.
    • Navigate to Navigation and select Wheel Encoder Counter.
  2. Enable Debug Information:

    • Open the Wheel Encoder Counter skill configuration.
    • Check the Display debug information checkbox to enable detailed logs.

Example Code for UART Initialization in ARC

Since there is no direct UART control in ARC, the communication is handled by the Wheel Encoder Counter skill itself. Ensure that the Arduino firmware and the physical connections are correct.

Checking Debug Logs

  1. Enable Debug Information:

    • Open the Wheel Encoder Counter skill configuration.
    • Check the Display debug information checkbox.
  2. View Logs:

    • The debug logs will be displayed in the ARC console output. You can find the console output at the bottom of the ARC interface.

Conclusion

By ensuring the Wheel Encoder Counter skill is correctly configured and the debug information is enabled, you should be able to see detailed logs in the ARC console output. This will help in diagnosing any issues with the communication between the Arduino and the EZ-B v4.

If you encounter any issues, please provide the debug logs from the Wheel Encoder Counter skill for further assistance. Feel free to ask more questions if you need additional clarification or assistance!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#6  

OK, thank you, my problem seems to come from my UNO (firmware). I do not receive anything in the serial monitor of the Arduino IDE. I will go deeper in this direction.

PRO
Synthiam
#7  

Is the ardunio connected to ARC on ezb index 0?

i think it has to be on index 0