This question has been flagged
2 Replies
1230 Views

Hi everyone,

Due to a system crash, I reinstalled Odoo on my systems. I left the old v11 for the new v16. I'm running a POS with an Epson m30 ticket printer. Since PosBox has been abandoned and only a solution for paying versions saw daylight. I'm hoping to figure out ePos. But it doesn't work as expected ... I read a ton about SSL accepting, ... But notting works. My printer is on the same network connected an ping's perfect. The IP has been filled in the POS settings ... But nodding. I tried so many things ... But notting works.

Can someone point me out in the right direction? I'm getting nuts ...

Regards

Avatar
Discard
Best Answer

So after hitting my head in the wall on this issue also on and off for quite some time and i finally by accident figured out that even though my pos printer support https it does not in fact support it for printing, only the web interface for management for some strange reason... so i made a small proxy script to downgrade https to http...

make a directory of your choice then...

Commands:

-npm install express http-proxy-middleware https

-openssl req -nodes -new -x509 -keyout server.key -out server.cert

-nano proxyServer.js (and copy/paste and edit from below)

const fs = require('fs');

const https = require('https');

const express = require('express');

const { createProxyMiddleware, responseInterceptor } = require('http-proxy-middleware');


const app = express();


// Configuration variable for the target host

const TARGET_HOST = 'http:xxx'; // Replace with your target host


// Proxy middleware options with response handling

const options = {

  target: TARGET_HOST,

  changeOrigin: true,

  selfHandleResponse: true, // The proxy will manage the response

  onProxyRes: responseInterceptor(async (responseBuffer, proxyRes, req, res) => {

    // Modify or translate the response from the printer here

    // For example, you can change headers, status code, or the response body

    const response = responseBuffer.toString('utf8'); // Assuming the response is a string

    // Perform necessary modifications to the response

    return response;

  })

};


// Use the proxy middleware

app.use('/', createProxyMiddleware(options));


// HTTPS server with self-signed certificate

https.createServer({

  key: fs.readFileSync('server.key'),

  cert: fs.readFileSync('server.cert')

}, app).listen(443, () => {

  console.log('Listening on port 443 (HTTPS)');

});



then run: 

node proxyServer.js



works on my TM-T88V with UB-R04 wifi interface board...


Avatar
Discard
Best Answer

Open the developer mode in the pos screen and click on the network tab. Then click on the printer icon or make a payment and check the responses of the network calls.This will lead to some clues

Avatar
Discard