react-native-esc-pos-printer icon indicating copy to clipboard operation
react-native-esc-pos-printer copied to clipboard

UNKNOWN printer status

Open sindiAsx opened this issue 1 year ago • 3 comments

I'm using startMonitorPrinter and addPrinterStatusListener to get the current status of the printer (more precisely I need paperFeed information)

This is the response I get: {"adapter": "UNKNOWN", "autoRecoverErr": "UNKNOWN", "batteryLevel": "UNKNOWN", "connection": "DISCONNECT", "coverOpen": "UNKNOWN", "drawer": "UNKNOWN", "errorStatus": "UNKNOWN", "online": "OFFLINE", "panelSwitch": "UNKNOWN", "paper": "UNKNOWN", "paperFeed": "UNKNOWN"}

I'm using the latest version of the library on Android

Sample:

       { 
           ....
           await EscPosPrinter.init({
            target,
            seriesName,
            language,
          });

          const status = await EscPosPrinter.startMonitorPrinter();
          console.log(status); // this is ok, start monitoring is success
        }

        ....
        .....

        useEffect(() => {
            const sub = EscPosPrinter.addPrinterStatusListener((status) => {
            console.log('current printer status:', status); // here I get the object stated above
         });

         return () => {
           sub();
         };
        }, [])

sindiAsx avatar Oct 18 '23 17:10 sindiAsx

I'm facing the same issue also somehow when refreshing the app I've got an actual status for connection and online. I hope the status might help when the printer refuses to print even though you try to safely connect / disconnect again

YasinAkimura avatar Oct 20 '23 11:10 YasinAkimura

I'm using with Epson Printer TM-P80II Please if anybody experienced the same issue let me know

sindiAsx avatar Oct 20 '23 16:10 sindiAsx

I'm currently trying to solve this by converting this library to an expo sdk 49 compatible custom module while I'm at it I will check if this is an issue which appears because something along the lines changed in react native version 0.72.6 after that I will look inside the code if there is something which prevents communication with the printer. I hope it gets fixed by solving the current errors if thats the case I will publish the results also I'm updating the epsonSDK to the latest version.

YasinAkimura avatar Oct 22 '23 17:10 YasinAkimura