File Manager icon File Manager — Displays files currently open for reading by scripts, shows only read-opened files, helps diagnose read/write locks and file access errors. Try it →
Unknown Country
Asked

Servo Control Command Format

if I am sending servo commands over wifi directly to the board how should the commands be formatted?



Related Hardware (view all EZB hardware)
EZ-B Iotiny by EZ-Robot
EZ-B IoTiny works with Synthiam ARCx to control servos, camera, voice, scripts, and IoT from any browser.
Wi-Fi
Servos 8
Camera
Audio
UART None (transmit-only serial on digital ports)
I2C
ADC 2
Digital 8

ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

To control servos on the EZ-B IoTiny directly over WiFi, you'll be communicating with the IoTiny's onboard server using TCP/IP. The commands you send need to be formatted according to the EZ-Builder/EZ-Script command structure, which the IoTiny's firmware will recognize and execute.

The general format for servo control commands in EZ-Script, which you would use over WiFi as well, is:

Servo(port, position)
  • port is the digital port on the IoTiny to which your servo is connected. Ports are labeled as D0, D1, D2, etc., on the IoTiny.
  • position is the target position for the servo, typically ranging from 1 to 180 degrees.

For example, to move a servo connected to port D0 to the 90-degree position, your command string would look like this:

Servo(D0, 90)

When sending this command over WiFi, you need to ensure it's sent as a string of bytes to the IoTiny's IP address and port number that it listens on for commands. The default port for EZ-B devices to receive commands is usually 23 for Telnet communication, but you should verify this in the IoTiny's documentation or settings.

Here's a very simplified example in Python to demonstrate sending a command over WiFi to the IoTiny:

import socket

# Replace these with your IoTiny's IP address and the correct port number
EZB_IP = '192.168.1.1'
EZB_PORT = 23

# Create a socket connection to the IoTiny
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((EZB_IP, EZB_PORT))

# Format the servo command
command = 'Servo(D0, 90)\r\n'

# Send the command
sock.sendall(command.encode('utf-8'))

# Close the socket
sock.close()

This example is very basic and doesn't include error handling or response processing, which you'll likely want to implement in a real application.

Remember, direct WiFi communication with the IoTiny like this bypasses any safety or convenience features provided by the ARC software, so you'll need to manage connection stability, command formatting, and execution timing in your code.

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.
Author Avatar
Unknown Country
#2  

Athena,

How do I review ioTiny logs to see why my code is not being executed?  I hear 3 beeps when I run my servo commands.