Thumbnail

EZ-B Connection

How to add the EZ-B Connection robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Communication category tab.
  5. Press the EZ-B Connection icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the EZ-B Connection robot skill.

How to use the EZ-B Connection robot skill

Use the connection skill to connect from an EZ-B I/O controller to ARC. Connections to an EZ-B are specified as COM ports or IP addresses. There are five connections in this skill, but if your robot requires more, use the ezb connections skill. ARC supports connecting to many I/O controllers and robot products, and you can view a list of supported EZB hardware here.

Main Window



1. EZB Board Index
This column displays the index for each connection. Note that most skills are configured to work with connection 0 by default.

2. Connect Button
Once the COM port or IP address is entered for the desired EZ-B device, press these buttons to connect it (them) to ARC.

3. Device Address or Port Drop-down
These editable drop-downs are for entering or selecting the IP address or COM pot of the desired EZ-B device you want to connect to.

4. Port Refresh
Pressing this will refresh the list of ports in the list. This is useful when connecting/disconnecting USB EZB devices (i.e., Arduino or USB UART adapters, etc.)

5. I/O Scan Button
These icon buttons are used by some EZ-B I/O controllers that can broadcast their IP address if connected over the network. This is useful when using a client connection.

Settings - Scripts



1. Connection Established Scripts
These scripts are executed when a connection is established on the corresponding index connection. The most common use case for these scripts is to have the robot initialize when a connection is made to the EZB. For example, this is an excellent place code to initialize the servo positions into their default position. More about initializing servo positions here.

Settings - Battery Monitor



1. Battery Monitor Override Checkbox
ARC includes a battery monitor that is enabled by default. This is to protect batteries from draining rapidly below a specified voltage. Supporting I/O controllers will receive a command from ARC that turns off their I/O output to reduce power consumption when the specific minimum voltage level is reached. Enable the override checkbox if you have a robust solution that requires a different voltage level or doesn't need monitoring.

2. EZB Battery Monitor Enable Checkbox
These checkboxes turn on/off the battery monitor for each of the 5 EZ-B index connections. Enabled by default, the monitor uses the minimum voltage level specified on its right. When disabled, there is no battery level monitoring, USE AT YOUR OWN RISK. Rechargeable lithium batteries will be damaged if consumed below their minimum voltage threshold.

3. Minimum Voltage Field
These fields are customizable to include the voltage specified based on the power solution. (7V is used for 7.4V LiPo Batteries). The protect mode alarm will be enabled if the ezb drops below this voltage.

Settings - TCP Server

1. Enable TCP Shell Server Checkbox

These checkboxes enable an EZ-Script TCP Shell Server instance in ARC. This will allow a TCP Server that provides clients with a real-time EZ-Script interface. When checked, the server accepts remote TCP Telnet connections into the EZ-Shell. You can add the TCP Clients Skill in ARC to monitor who has connected to the ARC terminal interface. Many developers and third-party software use this TCP Server feature to integrate with ARC, such as RoboRealm. If you're a third-party developer, connecting to the ARC TCP Server is a powerful method to set variables, start/stop scripts, and even obtain the video frames by combining it with the HTTP Server.

Lastly, you can test the TCP Server by simply telneting to 127.0.0.1 port 6666 and typing ezscript commands with the keyboard. This will familiarize you with the syntax. All TCP Server commands are responded with a "True" or their console output. So moving a servo Servo(D0, 2) will result in a response of True. But, sending Print("Hello") will result in "Hello."

Here is an example Python program that connects to ARC TCP Server #0 on port 6666 on localhost and speaks out of the connected EZB speaker.


import socket

# ARC TCP Server IP
server_ip = '127.0.0.1'

# ARC TCP Server Port
server_port = 6666

# The EZScript command to send to ARC. This example will speak out of the connected EZB
command = "SayEZB(\"I am connected\")\n"

# Create a socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

try:
    # Connect to the server
    sock.connect((server_ip, server_port))

    # Receive the version and print the response
     # When first connecting to the ARC TCP Server, it will print the version information before a command can be sent
    version = b''
    while True:
        data = sock.recv(1024)
        if not data:
            break
        version += data
        if b'\n' in data:
            break
    print("Version:", version.decode())


    # Send the command to ARC
    sock.sendall(command.encode())

    # Receive and print the response
    response = b''
    while True:
        data = sock.recv(1024)
        if not data:
            break
        response += data
        if b'\n' in data:
            break
    print("Received response:", response.decode())

finally:
    # Close the socket
    sock.close()

2. TCP Port Adjustment
Use this adjustment to select a unique TCP port between 1025 and 65535.

3. EZ-B Connection Server Checkbox
This checkbox enables ARC to listen for connections on index 0 as a server. If the ezb is configured to connect to ARC, this must be checked.

Settings - COM/USB Connection



1. COM Port Connection Baud Rate Drop-downs
These drop-downs are used to select the communication speed of the selected COM port on each of the 5 EZ-B connections. Note that when connected to an EZ-B via a COM port, it will disable the ability to connect to an EZ-B camera; a USB camera will need to be used instead.

2 & 3. DTR & RTS Checkboxes
These checkboxes are for enabling serial flow control. Some EZ-B devices may need one or both of these checkboxes enabled. The Arduino Leonardo and Arduino Pro Micro require DTR and RTS checked.

Settings - IO Timing



1. I2C Speed Field
These fields are used to set the I2C communication speed for each EZ-B. The default speed is 100000 (100kbps), and the maximum speed is 400000 (400kbps). These values are only applicable to EZBs that support this feature.

2. UART Timing Delay
These fields adjust the baud rate timing delay values for SendSerial commands. Note that advanced users should only change these values. These values are only applicable to EZBs that support this feature.

Related Tutorials

Related Robots

Related Questions


ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.