write
Send raw bytes or text to a serial device without waiting for a reply. Use for one-way commands to Arduinos, ESP32s, or RS-232 instruments, with optional hex encoding and custom newline.
Instructions
Send raw bytes without waiting for a reply (use query for request/response).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Text to send, or a hex string when as_hex=true. | |
| port | Yes | Port device from list_ports (e.g. /dev/cu.usbserial-0001, /dev/ttyUSB0, COM3), or a pyserial URL such as socket://host:port, rfc2217://host:port or loop://. | |
| as_hex | No | Treat `data` as hex bytes ('01 A0 FF'); newline is not appended. | |
| newline | No | Appended after text data. Use '\r\n' for CRLF devices, '' for none. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bytes_written | Yes |