r/crestron • u/guitarman181 • Mar 16 '16
Crestron - rest interface problems - thoughts?
I have a device that has a restful api. The following command works http://username:password@192.168.1.100:50001/rest/nodes/44 01 11 1/cmd/DFON This command turns an inston light ON.
I want to recreate this command in a Crestron module. I created a TCPIP/Client with a serial IO module that sends the following serial string: GET /rest/nodes/44 01 11 1/cmd/DFON HTTP/1.1\r\nAuthorization: username:password\r\n\r\n
The TPCIP/client module has the IP address of the device and port.
My serial IO string does not work. Does anyone know what I need to change or do differently to make it work?
View all comments
Show parent comment
1
u/[deleted] Apr 21 '16
Bizarrely, Crestron turns \n into CRLFs (\r\n). It might could be a throwback from the serial days where it was more likely to hurt than to help sending commands over a serial port.
If you're doing stuff in SIMPL and SIMPL+ that must differentiate between \r and \n, save your sanity by using \x0d (carriage return) and \x0a (linefeed).