I am trying to connect to an EPSON ePOS t88V printer from my .NET UWP application, using the drivers and SDK found here: https://download.epson-biz.com/modules/pos/index.php?page=prod&pcat=3&pid=36
I have deployed the official UWP sample app (https://download.epson-biz.com/modules/pos/index.php?page=single_soft&cid=5592&pcat=3&pid=36) to the POS, but the application wasn't able to discover the printer.
Then, I tried to build a minimal app, following the code snippets from the user manual:
using System;
...
using Epson.Epos.Epos2;
using Epson.Epos.Epos2.Printer;
namespace PrinterTest1
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
Printer printer = null;
PrinterStatusInfo status = null;
public MainPage()
{
InitializeComponent();
}
private async void Button_Click(object sender, RoutedEventArgs e)
{
try
{
printer = new Printer(Series.TM_T88, ModelLang.Ank);
printer.Received += Printer_Received;
printer.AddText("Deeeeerp.");
await printer.ConnectAsync("TCP:10.10.10.133", Printer.PARAM_DEFAULT); //this line throws an exception
await printer.BeginTransactionAsync();
await printer.SendDataAsync(Printer.PARAM_DEFAULT);
}
catch (Exception ex)
{
}
}
private void Printer_Received(Printer sender, ReceivedEventArgs args)
{
DoStuff();
}
private async void DoStuff()
{
try
{
status = printer.GetStatusAsync().GetResults();
if (status.Connection == Connection.True && status.Online == Online.True)
{
await printer.SendDataAsync(Printer.PARAM_DEFAULT);
}
}
catch (Exception ex)
{
}
}
}
}
but I am still not being able to connect to the printer. I am getting this exception:
{System.Exception: Exception from HRESULT: 0xA0048201 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at PrinterTest1.MainPage.d__3.MoveNext()}
TCP:10.10.10.133
isn't valid. You're missing//
– user47589