Accessing the X-10 MP3 Remote from
Visual Basic
by Aaron P. Segal
Parts:
- MR26A receiver
- UR51A "MP3 Remote" handheld remote control
Physical
descriptions:
- MR26A receiver
- small black plastic box with red LED in front indicating power
- thin antenna wire approx 6" long protrudes from rear
- 5' cable with DB-9 jack for connection to P.C. serial port
- UR51A remote control
- dual function infrared/RF remote control
- programmable for accessing nearly any manufacturer's TV, CD, DVD, Satellite
products through infra red
- send X-10 control data to an X-10 transceiver to toggle lamp, appliance,
or other X-10 modules
Communications:
- The MR26A receiver occupies a DB9 serial port with an RS-232 interface
- 9600 baud, no parity, 1 stop bit
- Device is silent on serial line until UR51A sends a keypress command
- In order for UR51A remote to communicate with MR26A receiver, the "PC"
button must be pressed, indicating that the PC is the current control device.
- Keypress data causes a 10-byte sequence to be sent along the serial line
- Sequence follows this format:
- D5 AA EE xx AD D5 AA EE xx
AD
- "xx" refers to the specific key-press and should be equal
in both 5-byte chunks
- If "xx" is not equal, it is probably safe to discard both
chunks and wait for a repeat
- "xx" codes are as follows
| Bytes
4/8 |
Keypress |
|
Bytes
(4/8) |
Keypress |
| 82 |
1
(MP3) |
|
40 |
Ch
up / Skip >| |
| 42 |
2
(DVD) |
|
C0 |
Ch
dn / |< Skip |
| C2 |
3
(CD) |
|
60 |
Vol up
|
| 22 |
4 |
|
E0 |
Vol
dn |
| A2 |
5 |
|
A0 |
Mute |
| 62 |
6 |
|
B0 |
Play |
| E2 |
7 |
|
70 |
Stop |
| 12 |
8 |
|
72 |
Pause |
| 92 |
9 |
|
38 |
RW |
| 02 |
0 |
|
B8 |
FF |
| BA |
A-B |
|
FF |
Record |
| 52 |
ENT |
|
D1 |
RIGHT
cursor |
| 3A |
Disp |
|
D2 |
LEFT
cursor |
| D4 |
Subtitle |
|
D3 |
DOWN
cursor |
| D8 |
Return |
|
D5 |
UP
cursor |
| C9 |
Exit |
|
52 |
OK |
| F0 |
Power |
|
B6 |
Menu |
| F2 |
Recall |
|
|
|
- Notes:
- The Channel Up/Down buttons use the same event code as the |<<Seek
/ Seek>>| buttons. These have similar functions, so just be aware
when coding.
- Pressing the PC button seems to send a D4 code (just like Subtitle).
The Boom software from X10 is able to differentiate these two events.
I do not know what separates them.
Handling in Visual Basic
- This is quite simple.
- Create a MSComm control (for serial port access)
- Configure to the appropriate COM port at 9600,n,1
- Create a Timer control
- Set to a 500ms interval
- Read the serial port
- If there are 10-bytes in the buffer then
- If the bytes begin with "0xD5 AA EE" and end with "0xAD"
then
- Compare bytes 4 and 8. If equal reference to the table above
and process user command as desired.
- Sample code (full source on request)
- Private Sub Form_Load()
MSComm1.PortOpen = True
End Sub
- Private Sub Timer1_Timer()
'This is the brain of the program.
'Every 500ms, the serial port is polled and if
'data is received from the MR26A, then the
'corresponding command is executed
MSComm1.InputLen = 0
buffer$ = MSComm1.Input
'This is a very simple check... Not as much error
'checking as would be ideal
If Len(buffer$) > 5 And (Len(buffer$) Mod 5 = 0) Then
keypr = Mid$(buffer$, 4, 1) 'extract the 4th byte
Select Case Hex$(Asc(keypr))
Case "40"
'put your Channel Up code here
Case "C0"
'put your Channel Down code here
Case "B0"
'put your Play code here
'etc...
End Select
End If
End Sub
Sample application:
- My sample application uses the Media Player control to play most media files
(avi, mpg, mp3, wav, etc...)
- The user can configure 9 separate directories and then use the numbered
pad on the UR51A to switch between them. (perhaps an MP3 folder, a movie folder,
etc..)
- Cursor keys allow selection of particular media files. OK selects currently
marked track.
- User can skip tracks, or jog inside a track in either direction.
- Pause, stop, play, mute are functional
- Display key toggles full screen playback of video files
- Still need to add:
- Save folder preferences in .INI or registry
- Permit screen-saver to be enabled for playback of audio files
- Randomize/Shuffle feature
- File list for playback of media in multiple directories
Executable file can be downloaded here
VB6 source code available on
request (sorry no longer available)
For information on the X-10 Firecracker see Jared Hoylman's excellent article
at http://www.rentron.com/FireCracker.htm
(c)2000, 2007 Aaron P. Segal
X-10, UR51A, MR26A are registered products of X-10, Inc.
I am not affiliated in any way with X-10, Inc.
Return to Home Page