ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

PRO
Canada
#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 GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
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.