Closed Mapashito1 closed 7 months ago
I need to know your device. Maybe it doesn't have the method implemented
I need to know your device. Maybe it doesn't have the method implemented
It's a sunmi V2 model
I've tried to debug code and I inspected status after _woyouService.updatePrinterState() and it returns 0 (it's not a exception)
In native android (not flutter), when I call to updatePrinterState(), the result is OK
hey, i got the same problem too. if you can implement it , that would really help me with my work. Thx.
This is the method The exception will return 0 i can change this implementation to send -1 but i will need to check
public int updatePrinter() {
try {
final int status = _woyouService.updatePrinterState();
return status;
} catch (RemoteException e) {
return 0; // error
} catch (NullPointerException e) {
return 0;
}
}```
I've added a print....
public int updatePrinter() {
try {
final int status = _woyouService.updatePrinterState();
print(status);
return status;
} catch (RemoteException e) {
return 0; // error
} catch (NullPointerException e) {
return 0;
}
}
And it prints 0. Then it's not a exception, I don't why but _woyouService.updatePrinterState() always return 0
the _woyouService is not made by me, i just use the AIDL , maybe the v2 model can't find the print. the _woyouService is just a stub from AIDL .
Em ter., 4 de out. de 2022 às 14:02, Mapashito1 @.***> escreveu:
I've added a print....
public int updatePrinter() { try { final int status = _woyouService.updatePrinterState(); print(status); return status; } catch (RemoteException e) { return 0; // error } catch (NullPointerException e) { return 0; } }
And it prints 0. Then it's not a exception, I don't why but _woyouService.updatePrinterState() always return 0
— Reply to this email directly, view it on GitHub https://github.com/brasizza/sunmi_printer/issues/45#issuecomment-1267299080, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGV4NUKL6WOSKOSKZDEJLLWBRPJXANCNFSM6AAAAAAQZVX6P4 . You are receiving this because you commented.Message ID: @.***>
-- Marcus Vinicius Brasizza
Raspibr Brasil
Hello, I had the same issues with the Sunmi V2 model where SunmiPrinter.getPrinterStatus() always give me ERROR. I had use this package https://pub.dev/packages/sunmi_printer , and the PrinterStatus give me a NORMAL instead.
Thanks i will check it out!
Hello, I had the same issues with the Sunmi V2 model where SunmiPrinter.getPrinterStatus() always give me ERROR. I had use this package https://pub.dev/packages/sunmi_printer , and the PrinterStatus give me a NORMAL instead.
it worked ! and i found a way to get that to be working in sunmi_printer_plus too
i replaced all aidlservice from sunmi_printer source file and
then edit some function in sunmiPrinterMethod.java,sunmiPrinterPlugin.java
that doesn't appear in replaced iWoyuService.aidl (such as cutpaper(),lcddisplay stuff function)
then i re-build my project with it and it worked !
although it still give me only 2 status : NORMAL and PREPARING whenever i try to open the printer lid or remove the paper from printer , it still show the same PREPARING status i think there maybe some status that doesn't get properly from iWoyuService.aidl (i used Sunmi V2 btw )
Hello, I had the same issues with the Sunmi V2 model where SunmiPrinter.getPrinterStatus() always give me ERROR. I had use this package https://pub.dev/packages/sunmi_printer , and the PrinterStatus give me a NORMAL instead.
it worked ! and i found a way to get that to be working in sunmi_printer_plus too
i replaced all aidlservice from sunmi_printer source file and
then edit some function in sunmiPrinterMethod.java,sunmiPrinterPlugin.java
that doesn't appear in replaced iWoyuService.aidl (such as cutpaper(),lcddisplay stuff function)
then i re-build my project with it and it worked !
although it still give me only 2 status : NORMAL and PREPARING
whenever i try to open the printer lid or remove the paper from printer , it still show the same PREPARING status
i think there maybe some status that doesn't get properly from iWoyuService.aidl
(i used Sunmi V2 btw
)
Hi, i would love a PR for that! Can you manage it?
Sure, just give me a couple day to finish up my work and i ll open it
Any updates? I'm using latest version of sunmi_printer_plus and still always getting ERROR from getPrinterStatus() ... and I need this in order to avoid printing if printer is not ready!
Any updates? I'm using latest version of sunmi_printer_plus and still always getting ERROR from getPrinterStatus() ... and I need this in order to avoid printing if printer is not ready!
can you send me what error please?
I mean I always get an ERROR status when I call getPrinterStatus(), no matter if printer is open, out of paper, normal or whatever ...
Here is the code I use:
Future<String> getEstadoImpresora() async {
await SunmiPrinter.bindingPrinter();
//await SunmiPrinter.initPrinter();
PrinterStatus ps = await SunmiPrinter.getPrinterStatus();
return ps.toString();
}
Here is the code I use:
Future<String> getEstadoImpresora() async { await SunmiPrinter.bindingPrinter(); //await SunmiPrinter.initPrinter(); PrinterStatus ps = await SunmiPrinter.getPrinterStatus(); return ps.toString(); }
Didnt reply yet because i dont have the equipment. what device are you using ?
It's a Sunmi V2s
I dont have this equipment, just k2 and k2 mini. I will check if i can find about this method in v2
When I write...
PrinterStatus result = await SunmiPrinter.getPrinterStatus() print(result)
...always result == PrinterStatus.ERROR . It's a sunmi v2
Why? I can print OK but I never can get status.