B4J Question Question on use of astreams

HARRY

Active Member
Licensed User
Longtime User
Hi,

An Arduino compter sends data to a Raspberry computer via USB; every 10 seconds a message with a length of 32 bytes. On the Raspberry I would like to use astreams in prefix mode.

Therefore I make on the Arduino a message preceded with a 4 byte word (long) which contains as value the length of the message itself, so 32. Then 36 bytes are written.

The Raspberry however does not recognize the length of the received message to be correct. It ends after several minutes with the error message that the message size is too large.

Should this work or do I simplify too much?

Harry
 

HARRY

Active Member
Licensed User
Longtime User
Hi,

Problem solved. It was a matter of BigEndian, which should be false, but was set to true.

Harry
 
Upvote 0
Top