How to pyboard achieve the usb print function
How to micropython achieve usb print function
Hello,everyone !How to micropython achieve the usb print function (USB printer)?
How to pyboard achieve the usb print function
Hello,everyone !How to pyboard connect the usb printer and achieve the usb print function.TKS!
Re: How to micropython achieve usb print function
I think the problem is that the Micropython boards don't have USB controllers, either host or device. This will cause a problem trying to talk USB.
The USB port on the board goes directly into a usb-serial chip attached to the uart, so it's not a USB port which can be controlled by the gadget. There's also probably no USB software stack.
I think probably your best bet is to get a combination of controller / printer which have a common interface. E.g. Raspberry Pi have USB ports, or on a wifi network a device with wifi might be able to print (e.g. esp8266 could do it, if the printing protocol is nice and simple).
Simpler printers intended for embedded use, for example, thermal printers used in point-of-sale systems, usually have rs232 or similar serial interfaces whcih could be wired (possibly with level converters as necessary) to the uart of a Micropython board.
The trick of avoiding trying to get a square peg into a round hole, is to change the shape of the peg or hole. Not a bigger hammer.
Mark
The USB port on the board goes directly into a usb-serial chip attached to the uart, so it's not a USB port which can be controlled by the gadget. There's also probably no USB software stack.
I think probably your best bet is to get a combination of controller / printer which have a common interface. E.g. Raspberry Pi have USB ports, or on a wifi network a device with wifi might be able to print (e.g. esp8266 could do it, if the printing protocol is nice and simple).
Simpler printers intended for embedded use, for example, thermal printers used in point-of-sale systems, usually have rs232 or similar serial interfaces whcih could be wired (possibly with level converters as necessary) to the uart of a Micropython board.
The trick of avoiding trying to get a square peg into a round hole, is to change the shape of the peg or hole. Not a bigger hammer.
Mark
Re: How to micropython achieve usb print function
@ markxr,Thanks!Pyboard have USB controller intergrated.I was a novice for printers , how to achieve printing protocol via network , whether you information in this regard , it was very grateful !
Re: How to pyboard achieve the usb print function
In short, you can't. PyBoard can only work as a USB device (something you connect to the computer) and not as USB host (something you can connect devices to). A printer is also only an USB device, and thus requires a USB host (such as your computer).
There *may* be some special printers that can act as USB host, for instance to print from an USB flash drive that you connect to them. If you own such a printer, the PyBoard should be visible as a flash drive to them too, and you can select and print the files from it normally.
There *may* be some special printers that can act as USB host, for instance to print from an USB flash drive that you connect to them. If you own such a printer, the PyBoard should be visible as a flash drive to them too, and you can select and print the files from it normally.
Last edited by deshipu on Wed Jun 08, 2016 4:05 pm, edited 1 time in total.
Re: How to pyboard achieve the usb print function
In theory its possible, since the pyboard can as as a host for a keyboard and mouse, but it would require writing a bunch of C code. I'm not familiar with what protocols USB printers use, so you'd need to figure that out and integrate with MicroPython.
I think that this would be a fairly large undetaking.
I think that this would be a fairly large undetaking.
Re: How to pyboard achieve the usb print function
Topics merged. Please don't crosspost :)