Appearance
Y121 Audible and Visual Alarm Technical Manual (RS485 Modbus RTU)
This manual is intended for software development, commissioning, and maintenance of the Y121 RS485 version. For product specifications, see the Y121 Audible and Visual Alarm Specification.
Contents
- System Overview
- Communication Protocol and Frame Format
- Command Map and Parameter Definition
- Control Command Examples (
0x06) - Query Command Examples (
0x03) - Status Response Parsing
- Audio File and Configuration Management
- Wiring and Commissioning Procedure
- Troubleshooting
1. System Overview
| Item | Description |
|---|---|
| Control targets | Voice playback and tri-color beacon, red, yellow, and green |
| Interface | RS485 half-duplex |
| Protocol | Modbus RTU |
| Default address | 0x01 |
| Super address | 0xFF, used for wildcard control on the bus |
| Default serial settings | 9600, 8N1 |
| Default volume | 30 decimal |
Notes:
- Function code
0x06is used for control commands, meaning a write single register operation. - Function code
0x03is used for status queries, following read holding register semantics. - After a control command is received successfully, the device normally echoes the same frame as the response.
2. Communication Protocol and Frame Format
2.1 Basic Control Frame Format
[Addr][Fun][RegHi][RegLo][DataHi][DataLo][CRCL][CRCH]
| Field | Bytes | Description |
|---|---|---|
| Addr | 1 | Device address, 0x01 to 0xFE, with 0xFF available as the super address |
| Fun | 1 | 0x06 for control, 0x03 for query |
| RegHi + RegLo | 2 | Command register address |
| DataHi + DataLo | 2 | Command parameter |
| CRC | 2 | Modbus CRC16, low byte first |
2.2 Addressing and Function Codes
| Function Code | Meaning | Typical Use |
|---|---|---|
0x06 | Write single register | Playback, pause, volume, address, baud rate, and beacon control |
0x03 | Read register | Query online storage, playback status, volume, file count, and audio/light status |
2.3 Beacon Linkage Code XY
In high-byte linkage control, XY represents the light effect and beacon color:
X: light effect, where1 = steady on,2 = slow flash,3 = strobe flash,6 = offY: color, where1 = red,2 = yellow,3 = green,0 = off
| XY Example | Meaning |
|---|---|
0x11 | Red steady on |
0x22 | Yellow slow flash |
0x33 | Green strobe flash |
0x60 | Beacon off |
3. Command Map and Parameter Definition
3.1 Control Commands (0x06)
CMD (RegLo) | Name | DataHi / DataLo Definition |
|---|---|---|
0x01 | Next track | 0000 |
0x02 | Previous track | 0000 |
0x03 | Play specified track by physical order | DH DL = track number, 1 to 3000 |
0x04 | Volume up | 0000 |
0x05 | Volume down | 0000 |
0x06 | Set volume | 00 DL, typically 0 to 30 |
0x08 | Loop specified single track | DH DL = track number |
0x09 | Select playback device | 0001 = USB drive, 0004 = FLASH |
0x0B | Set baud rate | 00 DL, see Section 3.3 |
0x0C | Chip reset | 0000 |
0x0D | Play | 0000 |
0x0E | Pause | 0000 |
0x0F | Play specified folder and file | DH = folder 01 to 99, DL = track 001 to 255 |
0x10 | Loop specified folder and file | Same format as 0x0F |
0x11 | All-track loop enable | 0001 = on, 0000 = off |
0x16 | Stop playback | 0001 |
0x17 | Loop specified folder | 00 DL, with DL = 01 to 63 |
0x18 | Random playback | 0000 |
0x19 | Current-track loop enable | 0000 = on, 0001 = off |
0xC0 | Set device address | 00 DL, with 0x01 to 0xFE |
0xC2 | Independent beacon control | 00 XY, see Section 2.3 |
3.2 Query Commands (0x03)
CMD (RegLo) | Query Item | Key Response Meaning |
|---|---|---|
0x3F | Online device status | Storage medium online status |
0x42 | Playback status | DL = 00 stop, 01 play, 02 pause |
0x43 | Current volume | DL is the volume value |
0x49 | Total FLASH file count | DH DL is the total file count |
0x4D | Current track | DH DL is the current track number |
0x70 | Current audio and light status | DH = audio status, DL = light status |
0xFE | Software version | Version-related response |
3.3 Baud Rate Parameter Table (CMD = 0x0B)
DL Value | Baud Rate |
|---|---|
0x01 | 9600 |
0x02 | 19200 |
0x03 | 38400 |
0x04 | 57600 |
0x05 | 115200 |
0x06 | 256000 |
0x07 | 35250 |
0x09 | 4800 |
4. Control Command Examples (0x06)
The examples below use target address
01by default, and the CRC has already been included.
4.1 Playback and Volume
| Function | Request Frame (Hex) | Description |
|---|---|---|
| Play track 1 in the root directory | 01 06 00 03 00 01 B8 0A | Track order follows physical file copy order |
Play specified folder and file, 02/001 | 01 06 00 0F 02 01 79 69 | Plays file 001 in folder 02 |
Set volume to 30 | 01 06 00 06 00 1E E9 C3 | Typical volume range is 0 to 30 |
| Stop playback | 01 06 00 16 00 01 A9 CE | Stops the current audio playback |
4.2 Communication Parameters
| Function | Request Frame (Hex) | Notes |
|---|---|---|
Change baud rate to 19200 | 01 06 00 0B 00 02 79 C9 | Wait about 1 second, then reset or power-cycle the device |
Set device address to 2 | 01 06 00 C0 00 02 08 37 | The new address takes effect immediately and is retained after power loss |
| Chip reset | 01 06 00 0C 00 00 49 C9 | Commonly used to apply parameter changes |
4.3 Audio-Light Linkage and Independent Control
| Function | Request Frame (Hex) | Description |
|---|---|---|
Play 01/001 with beacon off, audio alarm only | 01 06 60 0F 01 01 67 99 | RegHi = 0x60 means the beacon stays off during this playback |
| Turn on red beacon, steady on | 01 06 00 C2 00 11 E8 3A | Does not change the current audio playback state |
| Turn on green beacon, slow flash | 01 06 00 C2 00 23 69 EF | Independent light control |
| Turn beacon off independently | 01 06 00 C2 00 60 28 1E | Does not affect the current audio playback |
4.4 Loop Playback
| Function | Request Frame (Hex) | Description |
|---|---|---|
Loop folder 01 | 01 06 00 17 00 01 F8 0E | Enters folder loop mode |
Loop specified file 02/001 | 01 06 00 10 02 01 48 AF | Locks playback to a single file |
| Enable current-track loop | 01 06 00 19 00 00 58 0D | Loops the current track |
| Disable current-track loop | 01 06 00 19 00 01 99 CD | Turns off current-track loop |
5. Query Command Examples (0x03)
Query frames usually use the
FFsuper address. The response frame address field returns the actual device address.
| Query Item | Request Frame (Hex) | Example Response |
|---|---|---|
| Online device status | FF 03 00 3F 00 00 60 18 | 01 03 02 60 08 91 82 |
| Playback status | FF 03 00 42 00 00 F0 00 | 01 03 02 04 01 7B 44 |
| Current volume | FF 03 00 43 00 00 A1 C0 | 01 03 02 A1 1E 41 DC |
| Total FLASH file count | FF 03 00 49 00 00 81 C2 | 01 03 02 00 08 B9 82 |
| Current track | FF 03 00 4D 00 00 C0 03 | 01 03 02 00 02 39 85 |
| Audio and light status | FF 03 00 70 00 00 51 CF | 01 03 02 00 12 38 49 |
6. Status Response Parsing
6.1 Playback Status (CMD = 0x42)
DL Value | Status |
|---|---|
0x00 | Stopped |
0x01 | Playing |
0x02 | Paused |
6.2 Audio and Light Status (CMD = 0x70)
| Field | Meaning |
|---|---|
| Response frame address | Current device address |
DH | Audio status. 0x00 means no playback. 0x01 to 0xFF indicates the playing or last played track number. |
DL | Light status, encoded as effect plus color |
Common DL mappings:
DL Value | Light Status |
|---|---|
0x11 | Red steady on |
0x12 | Yellow steady on |
0x13 | Green steady on |
0x21 | Red slow flash |
0x22 | Yellow slow flash |
0x23 | Green slow flash |
0x31 | Red strobe flash |
0x32 | Yellow strobe flash |
0x33 | Green strobe flash |
0x10 / 0x20 / 0x30 / 0x60 | Beacon off |
7. Audio File and Configuration Management
7.1 Audio File Update
| Item | Rule |
|---|---|
| Connection method | Connect to a PC through Micro USB after powering off |
| Supported format | MP3, recommended bit rate <= 192 kbps |
| Sampling rate | 8 to 48 kHz, see the specification for details |
| Update order | Playback order follows file copy time, not file name sorting |
| Recommended process | Format the storage first, then copy files one by one in playback order |
7.2 Folder Naming Rules for 0x0F and 0x10
| Item | Rule |
|---|---|
| Folder names | 01 to 99 |
| File names | 001 to 255, for example 001xxx.mp3 |
| Maximum capacity | Up to 255 tracks per folder |
7.3 Configuration File (TXT)
| Item | Description |
|---|---|
| File type | .txt |
| File quantity | Up to 1 file per device |
| Location | Root directory |
| Configurable items | Key mode, volume, address, beacon mode |
| Applicability | The RS485 version normally uses serial commands first, with the configuration file as a supplementary method |
8. Wiring and Commissioning Procedure
8.1 Wiring Requirements (RS485)
| Item | Requirement |
|---|---|
| Power supply | DC 9 to 30 V, with 12 to 24 V recommended and current >= 1 A |
| Bus wiring | Wire A+ and B- correctly |
| Grounding | A common ground between the host and device is recommended |
| Polarity | Do not reverse the power supply polarity |
8.2 Quick Commissioning Steps
| Step | Action |
|---|---|
| 1 | Connect power and RS485 wiring, then confirm the indicator status |
| 2 | Set the host tool to 9600 8N1 |
| 3 | Send 01 06 00 03 00 01 B8 0A to test playback |
| 4 | After the same frame is echoed back, test beacon control with 0xC2 |
| 5 | If the address or baud rate must be changed, reset the device and switch the host settings after the change |
9. Troubleshooting
| Symptom | Possible Cause | Recommended Action |
|---|---|---|
| No response to commands | Address or baud rate mismatch, or A/B reversed | Return to the default settings 01 / 9600 / 8N1 and check A/B polarity |
| Echo received but no sound | Missing files or unsupported audio format | Check MP3 bit rate and sampling rate, then copy the files again |
| Playback cuts out at high volume | Supply voltage or current is insufficient | Upgrade the power supply to 12 to 24 V with at least 1 A |
| Device appears offline after address change | Host is still using the old address | Use the new address, or query with FF if needed |
| Beacon status does not match expectations | XY not set correctly or previous beacon state inherited | Send an explicit 0xC2 command or include the desired beacon state in RegHi of the playback command |
| Wrong track plays | Actual file copy order does not match the intended order | Format the storage and copy the files again in the target sequence |
- Manufacturer: Hunan YenGear Tech Co., Ltd.
- Email: [email protected]
- Website: www.yengear.com
