Hi Rebble,
     I do not use opaque proxy before...
     However, in my view, the warning message
 skipping subscription to unknown device
opaque:0
indicates that your declaration is  not valid.  The example format should be like this
driver
(
  name "opaquedriver"
  plugin "libopaquedriver"
  provides ["opaque:0"]
)

I do not think the name "relay" is a valid one since that the driver name should be one in the list of the libplayerdrivers:
http://playerstage.sourceforge.net/doc/Player-2.1.0/player/group__drivers.html
{for example, if your robot is iRobot Create Vacuum robot, you can use opaque under the "create" driver:
driver
(
  name "create"
  provides ["position2d:0" "power:0" "bumper:0" "ir:0" "opaque:0"]
  port "/dev/ttyS2"
)
}

Moreover, if you are using stage, the opaque interface is not in the list of supported plugins:
http://playerstage.sourceforge.net/doc/stage-3.0.1/group__player.html
Maybe it is the reason that player can not recognize the Opaque proxy with stage.

Regards
            yang

Rebble :
Dear yang;
  I have correct the mistake youi pointed out and i also checked it again
and again carefully ,but there are still the error. And in the player side,
there is warning :warning : skipping subscription to unknown device
opaque:0.  But i have declared opaque as following :
driver  (     
 name "relay" 
 provides ["6665:opaque:0"] 
) 
   Have anyone ever used the Opaque proxy for data communication? It seems
that nobody in the forum exactly solved the issue. Does anyone have some
example and correct codes to illustrate the method of communication using
Opaque proxy ? I believe this will help many people.
   Thanks Very much for sharing.
                                                 Rebble

Hello Rebble,
          I have noticed several error in your codes except the data 
struct of Opaque:
(1). The ports of two robots should be different:
  
PlayerClient r1("localhost",6665);// 
Position2dProxy pp1(&r1); 
LaserProxy lp1(&r1); 
OpaqueProxy op1(&r1); 
player_opaque_data_t op1Data,op2Data; 
uint8_t op1GetData[1024]; 

PlayerClient r2("localhost",6665);
    
and also should be different in the .cfg file.      
I think this is the most likely reason to get error like this:
  
playerc error   : got NACK from request 
playerc error   : failed to get response 
terminate called after throwing an instance of 'PlayerCc::PlayerError' 
    

(2).
  
 pp1.SetSpeed(0.5,dtor(30)); 
 pp1.SetSpeed(0.5,dtor(30)); 
    
It may be a typo...

Regards
       yang