I'm running Ubuntu, and I'm wondering if I can use echo and/or cat with
piping to send commands directly to the device (which is currently
/dev/sde, mounted as /media/OPENPCR).
The end goal would be to translate this totally manual approach into a
python script, perhaps with a GUI to match eventually, as a way to
replace the Adobe Air interface. Although I got the Air interface
working with Tito and Josh's help, really the problem isn't going away;
shortly before release of the OpenPCR, Adobe cut support for Air in Linux.
Would be nice to have an Open Source language working for my Open Source
PCR machine. :)
--
www.indiebiotech.com
twitter.com/onetruecathal
joindiaspora.com/u/cathalgarvey
PGP Public Key: http://bit.ly/CathalGKey
strace -e trace=write ../path/to/openPCRapplication
If that doesn't show the actual data being written, it might be
another strace option
> --
> You received this message because you are subscribed to the Google Groups "DIYbio" group.
> To post to this group, send email to diy...@googlegroups.com.
> To unsubscribe from this group, send email to diybio+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/diybio?hl=en.
>
--
Nathan McCorkle
Rochester Institute of Technology
College of Science, Biotechnology/Bioinformatics
I'm running Ubuntu, and I'm wondering if I can use echo and/or cat with
piping to send commands directly to the device (which is currently
/dev/sde, mounted as /media/OPENPCR).
Bryan: If it didn't make an entry in /dev/, how would you interact with
it? Honest n00b question here; I thought everything connected to Linux
made a /dev/ entry to represent the device as a file?
--
Ah, so you send the bytes to a file on the "OPENPCR" storage device,
rather than directly to OpenPCR? Treat the file as if it's the OpenPCR
device?
Bryan: If it didn't make an entry in /dev/, how would you interact with
it? Honest n00b question here; I thought everything connected to Linux
made a /dev/ entry to represent the device as a file?
Thanks for that detail Bryan.
So, I take it that if I format a program correctly, I should echo
'<program' > /media/OPENPCR/some_file to upload it? I recall from
private conversations with Tito & Josh that there's a particular
formatting thing in the program that says "start immediately", and
another program syntax for "stop", so the above syntax (if correct)
would allow most routine operations.
As to getting info back out, I gather that the ncc program (standing for
"No Cache Cat") can be used like "cat" to get a feed of information from
another output file on /media/OPENPCR/. But for now, I just want a quick
way to program it without Adobe Air: I'd settle for having no output
initially.
Its likely that what's written doesn't get 'saved' such that you can
later cat or open it... that said, once OpenPCR replies the reply is
probably only readable until the next command is sent from the Air
program
--
Glancing at the man-files for strace suggests that it actually
calls/executes the program you specify, which probably isn't compatible
with an Air app.
How would one hax strace to monitor an existing process? It opens a
process named "OpenPCR", you can get the process ID with "pidof OpenPCR".
The results looked like this (comments with hashes are mine, original
file is attached):
===============================================
### Lots of SIGCHLD crap
--- SIGCHLD (Child exited) @ 0 (0) ---
write(19, "B", 1) = 1
write(123, "s=ACGTC&c=start&t=50&d=22479&l=9"..., 157) = 157 # Here I
sent a program to the machine and it started. The complete program isn't
shown in this output data sadly.
--- SIGCHLD (Child exited) @ 0 (0) ---
write(19, "B", 1) = 1
###(more SIGCHLD crap)
--- SIGCHLD (Child exited) @ 0 (0) ---
write(19, "B", 1) = 1
write(11, "s=ACGTC&c=stop&t=50&d=22480", 27) = 27 # Here I clicked
"stop" in the OpenPCR app.
--- SIGCHLD (Child exited) @ 0 (0) ---
write(19, "B", 1) = 1
###(more SIGCHLD crap)
===============================================
On 22/03/12 15:46, Nathan McCorkle wrote:
--- SIGCHLD (Child exited) @ 0 (0) ---write(19, "B", 1) = 1
write(11, "s=ACGTC&c=stop&t=50&d=22480", 27) = 27 # Here I clicked
"stop" in the OpenPCR app.
--- SIGCHLD (Child exited) @ 0 (0) ---write(19, "B", 1) = 1
It's probable that last time I tried this and failed (ruling it out as a
possibility thereby), it failed merely because I was using the wrong
quotation mark: " only ignores spaces, but special characters like
slashes etc. still screw it up, whereas ' sends the literal enclosed
string without interference.
So, here's what I sent and had success with:
To start:
paragon@Tranquillity:~ echo -n
's=ACGTC&c=start&t=50&d=55709&l=96&n=IndieBB MCS
Check&p=(1[75|95|Initial
Step])(40[20|95|Step][10|60|Step][32|70|Step])(1[120|70|Final
Step][0|4|Final Hold])' > /media/OPENPCR/CONTROL.TXT
To stop:
paragon@Tranquillity:~ echo -n 's=ACGTC&c=stop&t=50&d=55710' >
/media/OPENPCR/CONTROL.TXT
The program syntax can be deciphered from the first command.
All commands start with 's=ACGTC'.
The '&c=start' part says to start with the ensuing program.
Not sure what '&t=50' or '&d=55709' mean.
'&l=96' means set lid to 96C.
'&n=IndieBB MCS Check' means set the displayed name to "IndieBB MCS Check".
'&p=(<Initial>)(<Cycle>)(<End>)' is the program itself.
This is a great thread, I have a similar interest in understanding and using a "standard" API for PCR machines, the OpenPCR approach seems like it has the basis of some good first practices, like articulating thermocycling programs in yaml etc.
Mac
231.313.9062 // @100ideas // sent from my rotary phone
Not sure what '&t=50' or '&d=55709' mean.
I'm pretty sure, from the talks I had with Josh and Tito, that a fake
file on a 'disk drive' was chosen to read/write from to get around
having to install serial port drivers on different platforms. Not
really sure why, since FTDI has royalty-free drivers for most/all
platforms.
d is just a usage statistic then? what does 'contrast' do (ramp
rate?), or PID controller stuff?
>
> When you read STATUS.TXT, the OS will cache it by default (making subsequent
> checks useless). If you want to avoid this, there is a program "ncc" bundled
> with the air app. ncc = no cache cat, and works like cat. You can use this
> to read the STATUS.TXT w/o caching.
>
> -Josh
>
> --
> You received this message because you are subscribed to the Google Groups
> "DIYbio" group.
> To post to this group, send email to diy...@googlegroups.com.
> To unsubscribe from this group, send email to
> diybio+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/diybio?hl=en.
--
Nathan McCorkle <nmz...@gmail.com> wrote:
--
Sent from K-9 Mail on Android
I ask because Python seems to support streaming in/out, but doesn't seem
to have a builtin system for just "dumping" a value on a file in one-go
like echo does.
Of course, echo might be a stream-based system too; anyone to weigh in
on this? If I use a stream object from within python to write a program
to CONTROL.TXT, will that work? It looks like I could use the
"io.FileIO" object detailed here:
http://docs.python.org/dev/library/io.html - in write mode, I think it
overwrites the file every time?
Cool!
I spent the last few hours looking into easy GUI options, and this
looks like the easiest way, but hard to get data in and out of the
GUI-land:
http://pysnippet.blogspot.com/2010/01/calling-python-from-javascript-in-pyqts.html
P.S. that code should work with out-of-the-box Ubuntu
I spent the last few hours looking into easy GUI options, and this
looks like the easiest way, but hard to get data in and out of the
GUI-land:
http://pysnippet.blogspot.com/2010/01/calling-python-from-javascript-in-pyqts.html
1) I cd'd to /media/OPENPCR
2) I opened python3 from terminal
3) I typed the following code, which worked nicely:
controlfile = open("CONTROL.TXT", "wt")
controlfile.write("s=ACGTC&c=start&t=50&d=55709&l=96&n=IndieBB MCS
Check&p=(1[75|95|Initial
Step])(40[20|95|Step][10|60|Step][32|70|Step])(1[120|70|Final
Step][0|4|Final Hold])")
controlfile.close()
The OpenPCR started running my program right away. :)
So, now I just need to hack up a set of scripts for sending the program
to the OpenPCR, and for making the program using friendly user input.
Can later bake a GUI on top of that stuff.
On 22/03/12 13:10, Cathal Garvey wrote:
This thread is all about me being picky. OpenPCR is awesome and very user friendly. Well worth paying and waiting for! :)
Petfixer71 <afris...@hotmail.com> wrote:
><http://joindiaspora.com/u/cathalgarvey>
>> PGP Public Key: http://bit.ly/CathalGKey
>>
>>
>
>--
>You received this message because you are subscribed to the Google
>Groups "DIYbio" group.
>To view this discussion on the web visit
>https://groups.google.com/d/msg/diybio/-/3yBmlI_hUyIJ.
>To post to this group, send email to diy...@googlegroups.com.
>To unsubscribe from this group, send email to
>diybio+un...@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/diybio?hl=en.
--
Will you be able to easily fold your changes into the docs for OpenPCR?
Sounds great to me -- I use debian and ubuntu linux at my desk and on
the lab bench.
John
--
You received this message because you are subscribed to the Google Groups "DIYbio" group.