Fwd: stuff and stuff..

18 views
Skip to first unread message

Mark Grealish

unread,
Feb 7, 2012, 7:40:18 AM2/7/12
to 091labs...@googlegroups.com
Anyone good at this Arduino stuff?

---------- Forwarded message ----------
From: sinead mc donald <sinead.w...@gmail.com>
Date: Mon, Feb 6, 2012 at 2:09 PM
Subject: stuff and stuff..
To: Mark Grealish <bha...@gmail.com>


http://processing.org/download/ to get the latest processing environment

What I'm trying to do is control a USB printer with Processing, which will be triggered by a switch on an arduino board.  I'll have the images printed already, so all I really want the printer to do is feed the paper out.  I figure the best way to do this is to get the printer to print a single dot.  I'm utterly stuck as to how to do it though. Apparently processing works really wel with arduinos.  I've found this:  http://processing.org/discourse/yabb2/YaBB.pl?num=1209803483  which old code, but I'm hoping there's so little of it that it won't matter..  I dunno though - seems to easy to be true.  It might just control serial port printers, which is not an option for me (*has* to be a modern USB inkjet).  Other than that, I found this too:  https://forum.processing.org/topic/please-help-with-interfacing-to-arduino-to-print  a lot more complicated than I need it to be, but a starting point.

I dunno if you have a printer handy you can test?  Or if you'd even need one?  I'd be *eternally* grateful if you could have a look though - I'm fit to cry at this stage - this was supposed to be the easy bit!


Domhnall Walsh

unread,
Feb 7, 2012, 9:01:06 AM2/7/12
to 091labs...@googlegroups.com
Hmm. Well, serial port printers haven't existed since the days of dot matrix and daisy wheels. Parallel port printers, yes, absolutely, but if there's inbuilt printing support it'll use the print spooler built into your OS (as any other approach would be too complex, short of something that only dumps pure Postscript, which is a rarity these days) and as such should be agnostic of the physical connector.

I can have a go at throwing something together later if I have time, and remember to bring an Arduino back to the house with me later. Shouldn't be wildly difficult, I think?

Domhnall.

Antóin Óg Ó Cuinneagáin

unread,
Feb 7, 2012, 9:29:34 AM2/7/12
to 091labs...@googlegroups.com
Does she want the arduino to control the printer, or the arduino to tell the pc to print when an arduino button is pressed?
Do you know what printer?  do some of them have wifi/ir/ capable printing?

This looks like a question from her too:

found this also:

Antóin Óg Ó Cuinneagáin

unread,
Feb 7, 2012, 9:36:26 AM2/7/12
to 091labs...@googlegroups.com
Actually the link she had in her email would probably work...if she just printed a white image would it feed the pages through...as they are preprinted she said.  The code might be 'old' but its just calling a batch script
http://processing.org/discourse/yabb2/YaBB.pl?num=1209803483 

2012/2/7 Antóin Óg Ó Cuinneagáin <anthony.c...@gmail.com>

Antóin Óg Ó Cuinneagáin

unread,
Feb 7, 2012, 9:41:18 AM2/7/12
to 091labs...@googlegroups.com
Somebody uses java printing from processing....I better get back to my job :-)
http://processing.org/discourse/yabb2/YaBB.pl?num=1160674179 

Domhnall Walsh

unread,
Feb 7, 2012, 9:42:58 AM2/7/12
to 091labs...@googlegroups.com
My understanding is that she wants to get the printer to push out a page (while not actually printing anything) whenever a button connected to the Arduino is pushed. This would involve the Arduino pushing some sort of message back up the virtual serial port created when the USB cable was plugged in, and then having some sort of script, or whatever, on the other end listening out for that message that should then make the printer go. The script could be in Processing, or could be a simple script such as the IRC controlled LED example Fergal demonstrated in our Arduino classes last year.

(Direct drive of most modern printers (particularly most cheap modern printers) is virtually impossible with something as low-powered as an Arduino as most of the "brains" behind rendering pages have been farmed out to the host computer rather than having onboard support for PCL, Postscript or any of the other printer command languages as that adds cost)

If you were to go this way about it, you could get the listening script to print a blank page. Alternatively, if you don't value the printer, most have a form feed button (labelled in all sorts of different ways depending on the printer involved) that pushes through a blank page, which could be directly hijacked and routed to a switch, perhaps?

Duncan Thomas

unread,
Feb 7, 2012, 10:28:57 AM2/7/12
to 091labs...@googlegroups.com
On 7 February 2012 14:01, Domhnall Walsh <domhna...@gmail.com> wrote:
> Hmm. Well, serial port printers haven't existed since the days of dot matrix
> and daisy wheels. Parallel port printers, yes, absolutely, but if there's
> inbuilt printing support it'll use the print spooler built into your OS (as
> any other approach would be too complex, short of something that only dumps
> pure Postscript, which is a rarity these days) and as such should be
> agnostic of the physical connector.

Serial printers are absolutely still widely used in the embedded
space... many thermal role printers (till receipt printers) are
serial.


--
Duncan Thomas

Fergal O Grady

unread,
Feb 7, 2012, 12:25:55 PM2/7/12
to 091labs...@googlegroups.com
The IRC bot was controlled by a python script  running on the computer that was acting as a middle man between the IRC channel and the Arduino. Code was here:  http://blog.datasingularity.com/?p=148 . It's pretty easy to see which libraries and calls are doing the serial communication between python and the Arduino. There is also Arduino code on that page so you can see how it was talking to the python script. 

A quick search suggests that there are third party libraries for printing with python (at least for linux) so it may be a better option than Processing. 

Good luck either way!

Domhnall Walsh

unread,
Feb 7, 2012, 1:49:03 PM2/7/12
to 091labs...@googlegroups.com
I know that. I meant in the consumer space.
Reply all
Reply to author
Forward
0 new messages