Udp problem sending byte (-127)


#1

Hello,
I am trying to send visca commands over udp.
To send a command to camera 1 you have to send byte (0x81).
Unfortunately udp.send sends the value 63!
I discovered this by sending from processing 3 on windows and I am receiving with processing on a raspberry pi with processing 3

byte[] mist = {byte(80),byte(0x81), byte(0x82), byte(0x83), byte(0x84), byte(0x85), byte(0xFF)};
String massage=new String(mist);
udp.send(massage, ip, port);

results on the receiver side to
-128, 63, -126,-125 etc…

In whatever way I am building the bytes, the result is always the same -127 results on the receiver side to 63.

Is there anywhere a guru who can tell me where i can patch the library?

Thanks a lot.
Horst


#2

Can’t you simply send() the byte[] array instead of a String? :thinking:
udp.send(mist, ip, port);

UBAA.net/shared/processing/udp/udp_method_send.htm


[SOLVED] serial port write with no delay between bytes when sending hex values
#3

I did as you told me.

I am sending this from another raspberry1 to raspberry2

It works !!!

byte[] mist = {byte(0x80),byte(0x81), byte(0x82), byte(0x83), byte(0x84), byte(0x85), byte(0xFF)};
udp.send(mist, ip, port);

receive: “�������” from 192.168.200.186 on port 45759
[0] -128
[1] -127
[2] -126
[3] -125
[4] -124
[5] -123
[6] -1

Thank you very much.
My cam is positioning.