nativescript-star-printer
nativescript-star-printer copied to clipboard
Trouble with ethernet printer
I'm having trouble getting this demo app to work for an ethernet-connected star micronics printer. In the demo app when I click search printers, it correctly finds my printer port: TCP:192.168.1.47 and when I hit connect/reconnect it console logs Connected: true. However, when I click the print option nothing happens. I added a .then() and a .catch() to the print command and the .then() is being triggered and is just returning undefined so I'm not sure what's going wrong. I see in the ReadMe that it references bluetooth - does this plugin only work for bluetooth connections? I just figured it would work for ethernet since it's finding the printer and returning connected: true.
On another note, I know this printer works because I've been able to print from it using the star micronics TSP100III Utility app.
Which platform(s) does your issue occur on?
iOS
Please, provide the following version numbers that your issue occurs with:
CLI: 3.1.3 Cross-platform modules: 2.5.3 Runtime(s): 3.0.1 Plugin(s): "dependencies": { "nativescript-star-printer": "file:../src", "nativescript-theme-core": "^1.0.2", "nativescript-unit-test-runner": "^0.3.4", "tns-core-modules": "^2.5.1" }, "devDependencies": { "babel-traverse": "6.12.0", "babel-types": "6.11.1", "babylon": "6.8.4", "filewalker": "0.1.2", "jasmine-core": "^2.5.2", "karma": "^1.3.0", "karma-jasmine": "^1.0.2", "karma-nativescript-launcher": "^0.4.0", "lazy": "1.0.11", "nativescript-dev-typescript": "^0.3.7", "typescript": "^2.1.0" } Please, tell us how to recreate the issue in as much detail as possible.
Running the sample demo on an iPad while attempting to print to a star micronics ethernet printer.
Is there any code involved?
I'm running the sample demo
I have no idea whether or not it's supposed to work with Ethernet printers, as I only have a Bluetooth one (which works just fine).
I was able to use this plugin to open a connected cash drawer - so it looks like this plugin does work for ethernet printers, though the print command still does not seem to be working. I'm thinking the problem is just that the commands are wrong (maybe for my specific type of star printer?) In the plugin source code, I'm seeing commands like [0x1b, 0x64, 0x03] for cutPaper and [0x1b, 0x1d, 0x61, 0x01] for align center - though I'm not sure where these are coming from from the manual's that I've looked at. Do you remember where you got these commands from? Any useful tips for debugging this would also be helpful (so far I've just been trying variations of these commands and only the [0x07] for opening the cash drawer seems to do anything)
@fhackenb Thanks for digging a bit deeper 👍
It makes sense that those commands may depend on the printer type as I've only been able to test with the "TSP650II". At the time I found those commands by downloading the iOS and Android libs at http://www.starmicronics.com/support/SDKDocumentation.aspx.
@fhackenb By any chance are you using the TSP100/TSP100III?
Yea I'm using the TSP100III. When I reached out to the star micronics team they told me that that was the only printer they had that these text commands wouldn't work for. Apparently it's a raster printer so it only takes in an image. I spent some time trying to adapt the nativescript plugin for this kind of printer but ended up shelving it for now
I have gotten this plugin to work for a different model star micronics ethernet printer, though
@fhackenb I happen to work for Star Micronics, I just wanted to put you on the right track. Whoever you spoke to at Star is correct about the TSP100III.
@gare-bear Thanks! Are you guys planning to develop a nativescript plugin for these type printers?
@fhackenb No plans for the moment but it would be an excellent idea!
@gare-bear If you were to ever do that make it work with the TSP143IIIU. Thats the dream!