Skip to main content
10 events
when toggle format what by license comment
Nov 7, 2020 at 16:13 comment added K Mmmm This didn't work for me, nor this guy: 3dprinting.stackexchange.com/questions/10612/… The tail command doesn't output anything The printer seems to thing "ok" is an unknown command, which is its response, right? So why is it receiving its own response as a command?
Jul 16, 2019 at 17:12 comment added cmm @gipi The "<> /dev/ttyUSB0" argument defines stdin and stdout for the script. When the script operates on stdin, it is operation on /dev/ttyUSB0.
Jul 13, 2017 at 18:25 comment added Mtl Dev My understanding is the baudrate is simply the first argument to the script, (i.e sys.argv[1]). If you were to modify the script and hardcode a baudrate, and/or open device using the python equiv. of open(filename, O_RDWR|O_CREAT), then I, too, would be surprised if that didn't work.
Jul 13, 2017 at 15:42 comment added gipi I know what <> does, but I don't understand why this works for the baudrate: you are setting the baudrate of the file descriptor 0, i.e. stdin not for the serial port.
Jul 13, 2017 at 13:59 comment added Mtl Dev For example, cat < foo.txt it will print the contents of foo.txt, or fail if foo.txt doesn't exist. Whereas cat <> foo.txt,will also print the contents if it exists, but will create the file if it doesn't already exist.
Jul 13, 2017 at 13:56 comment added Mtl Dev <> on unix opens a file read+write mode, without truncation, and creates the file if it doesn't already exist. i.e system call: open(filename, O_RDWR|O_CREAT)
Jul 13, 2017 at 13:15 comment added gipi Can I ask you how is possible that this script works? I don't understand why you use <>, at first I thought was a typo, but modifying the script and opening the serial directly doesn't modify its baudrate.
Dec 20, 2016 at 15:06 vote accept Mtl Dev
Dec 1, 2016 at 20:24 history edited Mtl Dev CC BY-SA 3.0
added 4 characters in body
Dec 1, 2016 at 18:30 history answered Mtl Dev CC BY-SA 3.0