-
cfry
Cool! [route Darwin] worked but I had to put back the [delay 100] from [logger2] in order to have the [set exec...( update before [t b b b b b] hits the rest.
I noticed that you can actually skip using [netsend] and just go straight into your [list prepend send] ---> [command] part. How would this do performance wise? Is [netsend] more effective than [command] or would it not matter?
-
cfry
@oid said:
Did you ever try using the full path to pdreceive as mentioned above,
Sweet, It works with the full path! I thought I tried it several times, hmm. And no error code. The right "error" outlet does send out
listening on 3000
but it works anyhow.I changed permissions:
chmod a+rwx pdreceive
but still didn't work without full path.then I did this and noticed the com.apple.quarantine flag:
jnl@nmbp bin % ls -@l pdreceive -rwxrwxrwx@ 1 jnl admin 174048 3 Jul 18:11 pdreceive com.apple.lastuseddate#PS 16 com.apple.quarantine 57 jnl@nmbp bin % xattr -d com.apple.quarantine pdreceive jnl@nmbp bin % ls -@l pdreceive -rwxrwxrwx@ 1 jnl admin 174048 3 Jul 18:11 pdreceive com.apple.lastuseddate#PS 16 jnl@nmbp bin %
The com.apple.quarantine flag is added on downloaded apps by osx, preventing them to run without confirmation.
Removed the flag but it still does not work. I have to read up a bit on osx security. Its close though.
@oid said:
But there could be an Applications directory in root for apps available to all users these days, once again my lack of knowledge regarding modern OSX.
that's how it is structured nowadays yes.
-
cfry
@whale-av said:
@cfry When you have the help file open you have a tcp receiver in [netreceive-help] that might be receiving your messages.
yes, when deleting the receiver in the help file the connection is refused. Using -u allows netsend to stay open. I was thinking that I should use udp in the end but it could be good if tcp also worked.
@oid
Testing logger2.pd:
send symbol through right inlet to make a new file - ok
use bang before exit - no need to force quit pd
send data through left inlet - not working, except if pdreceive is started from terminal, then it worksit seems that [exec pdreceive 3000(-[command] is never executed. I added print objects to the output of the [command] object and still all that is output is
exit pdreceive: 2
I tried to escape space with \ [exec pdreceive\ 3000(, but same issue.
what does the "2" exit code indicate?
should I use bash instead of zsh?
-
cfry
@oid these are the error messages. I never seen this dialogue before.
It happens when I try to quit Pd. I think we should break up this in parts, maybe not do it inside an abstraction. I need to automate creating new logg files in the end anyway so in that case using an abs for naming is not the best solution.
It may be that something has happened with my system: it seems like I can only use [netsend] when having the help window open. I'll look into this as soon as I can.
(A little Swedish dictionary: Fel = Error, Programfel = Program Error)
-
cfry
@oid with the new logger abs [netsend] does not work: pd log:
recv (tcp): Connection refused (61)
. I can not see the problem because it looks exactly the same as in the help file and there it works. If I keep the help page open it connects (but I still can not write to the text file). I would guess that command has some process still running and is blocking?
Starting pdreceive 3000 from terminal works too. (now globally, I fixed that).
I can create a new file, and I can also write to it by for example sending [exec pwd( to [command] inside logger.pd.
-
cfry
@seb-harmonik.ar yes I have done that now, pdreceive is in the PATH variable. I got the impression that this was taken care of upon installing pd.
But I have not gotten the logger abs working. Some process is started and I have to force quit pd. I understand that you have to treat |command] a bit different than other pd objects.
-
cfry
@oid thanks this is great stuff.
I managed to create a log file and write data to it through your logger.pd abstraction but I had to disable the part that starts pdreceive and start pdreceive from Terminal manually. Obviously pdreceive and many other commands on my system is not working global:
/Applications/Pd-0.53-2.app/Contents/Resources/bin/pdreceive 3000 >> mylogfile.txt
...and that is because something is up with my system/shell.
~ % pdreceive 3000 >> mynewlogfile.txt zsh: command not found: pdreceive
Working on this I use macOS Monterey 12.6.9 and by default zsh(z-shell) is used. I tried to change to using bash but it is the same problem still.
Before I dive into this and try to fix it I would like to ask you
- if your logger.pd abstraction did work on your system
- what os do you use?
- for advice on how to set up my computer in this senario:
I see many uses for me with this setup but the goal at the moment:
is to put this on a raspberry pi and record interaction sessions with an artwork during the day, and optionally process it during the night. It will be open for interaction for a month, not monitored.
But when coding I use my mac. So ideally I want to set up my mac as similar as possible to the raspberry pi having to make as few changes as possible when switching computer.
Any idea on how to fix this without messing up my mac? And where is a good starting point to get some better understanding of shell(s)? So I do not bloat this thread/forum with non-pd questions.
Thank you so much, I really appreciate it.
-
cfry
Thanks, would it be possible to control file naming when using
pdreceive
from terminal to create a text file? Maybe trigger it from Pd, send a command to terminal? Or have a size or time limit and then auto-create a new file?I was able to send text back to [qlist] using
cat
and have it play back again. I will rely on loading complete text files (into [qlist] or whatever), it is good enough. I will filter out repeated messages in the data stream before recording. This will make the files way lighter.I need to read up on using bash/terminal. This is so smooth.
If I would like to have it streamed back to Pd I think I should write a python script that mimics qlist. But this is not really needed for me at this point.
Just for the record, the raw serial data (not filtered) is formatted like this :
(timestamp milliseconds | device | type of data | multiple sensors data):10.024 a1 analog 565 565 565 565 565; 0.332 a1 analog 562 544 565 565 565; 6.606 a1 analog 565 565 565 565 565; 0.34 a1 analog 562 544 565 565 565; 12.482 a1 analog 565 565 565 565 565; 0.29 a1 analog 562 544 565 565 565;
-
cfry
@oid this is sweet! I managed to set this up and save a qlist readable file:
No cpu load, pd is stable after 1 hour recording, 18 mb file, all good. Using netsend seems great for recording a session in the background.In order to make the transition from my [qlist] recorder smooth I figure I should try to be able to use terminal/pdsend to load the text file to [qlist]. How do I use pdsend in Terminal to send the recording5_pd.txt back to pd [qlist]?
Doing this...
jnl@nmbp ~ % /Applications/Pd-0.54-0.app/Contents/Resources/bin/pdsend 3000 >> recording5_pd.txt connected to 127.0.0.1
...I did not seem to get anything out of [netreceive] in Pd.
Is there documentation to be found on this somewhere?
@alexandros I would like to have to option to be able record the raw data so I can redo filtering at a later stage, but in most cases it would be better to filter out repeated messages, yes.
I am experimenting with having Pd detect silence and no interaction and then do offline non-realtime stuff (like saving, or using your neural network lib) at that point. But using [netsend] to save the sensor data at least eliminates the [qlist] save instability issue.@seb-harmonik.ar [binfile] seems interesting, I may try that one down the line. Thanks!
-
cfry
Hi,
I have made some experiments with making data recording abstractions using [qlist].
Looks like this:
It works OK but I think there are better ways to do this.I use it for
- recording and looping on the fly,
- background recording of session and
- along with more advanced processing (neural network is the plan).
The data that I record is often sensor data over serial connection using [comport] with arduinos, but the idea is that you can take any data stream inside Pd and record it.
I use this in my live rig but I also want to include it in installations and have the data being automatically saved to disk, maybe also upload it to cloud on the fly.
One problem is that there is quite a lot of messages coming in when recording the serial data (I use a high baud rate) and when saving the text file the system can get unstable and PD crash at times. Usually the text file is intact though. The text file gets quite large also, I suspect that there could be more suitable file formats. When saving Pd gets locked up too so it is not a realtime solution as it is.
Maybe one should write the data to disk right away instead of having it in a buffer like [qlist]?
Would using [text sequence] be more stable?
So how would you do this?
Thankful for input!