The Arduino Service Interface Protocol is a protocol developed at Middlesex University to control Arduino boards from other devices, such as a laptops, Raspberry Pi boards, etc. More details about the protocol are available at https://github.com/michaelmargolis/asip.
A Java client (with examples) is available at https://github.com/fraimondi/myrtle/tree/master/raspberry/Java/JMirto/src/uk/ac/mdx/cs/asip
A Racket client (with examples) is available at https://github.com/fraimondi/racket-asip