You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let commands = [];
commands.push({
append:
"Star Clothing Boutique\n" +
"123 Star Road\n" +
"City, State 12345\n" +
"\n"
});
commands.push({appendCutPaper: StarPRNT.CutPaperAction.PartialCutWithFeed});
try {
var printResult = await StarPRNT.print('StarPRNT', commands);
console.log(printResult); // Success!
} catch (e) {
console.error(e);
}
};`
however, it gives below error:
Printer Connected ExceptionsManager.js:82 Error: Invalid port name. at createErrorFromErrorData (NativeModules.js:155) at NativeModules.js:104 at MessageQueue.__invokeCallback (MessageQueue.js:414) at MessageQueue.js:127 at MessageQueue.__guard (MessageQueue.js:314) at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:126) at debuggerWorker.js:80
The text was updated successfully, but these errors were encountered:
Make sure that the port is exactly the port of the device, and you're connected to it.
Always try to connect dynamically, do not hardcode the port inside the connection script.
Option 1.5:
Use another emulation. If you're using mPop StarPRNT is fine but raster printers like the TSP100 and many others are using StarGraphics. (however bad emulation shouldnt throw this error, but it's worth a try)
Option 2:
I've encountered a strange bug a while ago. I don't know if it has been fixed or not, but when you use connect and print together, IOS does not ask for the port inside the print function however android did, even if it was connected. Solution:
If you want to get the status of the printer once in a while, just connect listen for hardware events, then disconnect. I used to get invalid port name myself sometimes, i solved it with try-catching and reconnecting, it usually works, and reporting back connection errors to my server but i did not get constant data.
I'm not able to print it says invalid port name check my code below:
`printInvoice = async () => {
try {
var connect = await StarPRNT.connect('BT:00:12:F3:3A:66:1B', 'StarPRNT', true);
console.log(connect); // Printer Connected!
} catch (e) {
console.error(e);
}
however, it gives below error:
Printer Connected ExceptionsManager.js:82 Error: Invalid port name. at createErrorFromErrorData (NativeModules.js:155) at NativeModules.js:104 at MessageQueue.__invokeCallback (MessageQueue.js:414) at MessageQueue.js:127 at MessageQueue.__guard (MessageQueue.js:314) at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:126) at debuggerWorker.js:80
The text was updated successfully, but these errors were encountered: