0

Using a Raspi/Debian - I have a script that parses the results from an iwlist scan and sends them via UDP to a Pure Data patch. This runs fine in gui mode, but now I'm trying to automate the whole process in another script with the following:

pd-extended -nogui /home/pi/patch.pd & /home/pi/libOSC/scan.sh && fg

But when I run this new script, the UDP appears to only send the info to Pure Data once, and then the scanning continues but Pd does not receive the packet. Any help with this would be appreciated.

2 Answers2

0

What happens when you run /home/pi/libOSC/scan.sh? It sends the results only once? Then maybe you need to do it differently, like calling that script from within pd using the 'shell' or 'popen' objects for instance. Or you implement a polling command via UDP that will return the values.

Max N
  • 1,134
  • 11
  • 23
  • Hi, many thanks for your response. I've not tried using [shell] in Pd before, so I'll give that a whirl - my first attempt just now crashed the system though, so that's a fun start! – youcloudsofdoom Aug 09 '14 at 19:43
0

how does your scan.sh script look like?

you probably want to make it something like:

pdhost=localhost
pdport=9999

do_scan() {
  ## some code here that does the scan and print's the result to stdout
}

doscan | while read line
do
   echo "${line};" | pdsend ${pdhost} ${pdport}
done

rather than the following:

doscan | pdsend ${pdhost} ${pdport}
umläute
  • 28,885
  • 9
  • 68
  • 122