Thanks all this really helps, my toggle / select is a little messy but it turns my Shelly1 device on and off from PureData.
Thanks #N canvas 300 179 710 697 10; #X msg 241 261 disconnect; #X floatatom 303 622 0 0 0 0 - - -; #X obj 329 203 fudiformat; #X obj 331 255 t l l; #X obj 359 293 list length; #X obj 361 325 - 2; #X obj 327 360 list split; #X obj 327 465 list prepend send; #X obj 325 521 list trim; #X obj 325 567 netsend -b; #X obj 325 412 list append 13 10 13 10; #X obj 390 234 print; #X msg 95 330 connect 192.168.1.20 80; #X obj 525 398 print; #X obj 432 206 print; #X msg 343 159 GET /relay/0/?turn=\$1 HTTP/1.0; #X obj 441 24 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 347 100 symbol on; #X obj 424 101 symbol off; #X obj 433 60 select 1 0; #X obj 379 34 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X connect 0 0 9 0; #X connect 2 0 3 0; #X connect 2 0 11 0; #X connect 3 0 6 0; #X connect 3 1 4 0; #X connect 4 0 5 0; #X connect 5 0 6 1; #X connect 6 0 10 0; #X connect 6 0 13 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 9 0 1 0; #X connect 10 0 7 0; #X connect 12 0 9 0; #X connect 15 0 2 0; #X connect 15 0 14 0; #X connect 16 0 20 0; #X connect 16 0 19 0; #X connect 17 0 15 0; #X connect 18 0 15 0; #X connect 19 0 17 0; #X connect 19 1 18 0; #X connect 20 0 17 0; #X connect 20 0 18 0; #X connect 20 0 12 0; On Thu, Jan 24, 2019 at 3:11 PM Martin Peach <chakekat...@gmail.com> wrote: > On Thu, Jan 24, 2019 at 11:36 AM RT <ratull...@gmail.com> wrote: > >> >> 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 >> >> If you don't have to use vanilla Pd it's easier to use [httpreq] and > [tcpclient]. > > Martin > > -- -- |======================================================| |https://stillpointx.wordpress.com/research/modulated-plasma/ |======================================================| "Knowledge may be the Key" "But wisdom unlocks the door" "Absolute Power demands absolutely nothing" As the old maxim has it, you need find only one white crow to disprove the rule that all crows are black "The bourgeois today burns as heretics and hangs as criminals those to whom he erects monuments tomorrow" ('Steppenwolf') "There are two modes of being those in bliss and those seeking bliss, may each step you take and each thought you make be made in a mindful and blissful state." |======================================================|
_______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list