[PD] Using netsend to send url / text to turn a device on and off

RT ratulloch at gmail.com
Thu Jan 24 17:33:27 CET 2019


I'm trying to turn on and off a device using Pd by sending a URL. At the
moment to turn the device on I just type in a url in the browser and to
turn it off I type in another one url .
To turn the device on I send http://192.168.1.123/relay/0/?turn=on
To turn the device off I send http://192.168.1.123/relay/0/?turn=off

I can connect to the device using *connect* and *netsend* but I couldn't
find an example / correct syntax / format on how to send the required url
out of Pd.

This is what I'm using below

#N canvas 162 516 623 513 10;
#X msg 535 750 \; pd dsp 1;
#X obj 536 724 loadbang;
#X obj 248 207 netsend;
#X msg 272 110 disconnect;
#X floatatom 218 272 0 0 0 0 - - -;
#X obj 280 275 print;
#X msg 403 171 send /relay/0/?turn=off;
#X msg 404 136 send /relay/0/?turn=on;
#X msg 184 67 connect 192.168.1.123 80;
#X connect 1 0 0 0;
#X connect 2 0 4 0;
#X connect 2 0 5 0;
#X connect 2 1 5 0;
#X connect 3 0 2 0;
#X connect 6 0 2 0;
#X connect 7 0 2 0;
#X connect 8 0 2 0;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20190124/06ee8368/attachment.html>


More information about the Pd-list mailing list