Pyserial library

Hi community

I hope every one ok
If someone already done working with pyserial library so communicate with a weightbridge or balance via browser need help please
Regards

I worked with pyserial, but not via the browser, but it shoudln’t be a problem, since you can freely invoke Python functions via a client-side JS API call.

What exactly is your question?

Thnk u @igrekus
I would like to communicate with a weight materiel so when user receive marchandise get weight auto from the balance.
Regards

Sorry, I’m not sure I understand your use case correctly without more detail, but in general it should work like this:

  1. Collect user inpunt on the frontend.
  2. Send an client-side API call via frappe.call()
  3. Receive and process the API call on the server-side.
  4. Based on the received parameters, make a call to the serial device via serial.write() and serial.read()
  5. Process serial device answer and return this processed answer in the Python function.
  6. Handle the server response in the callback, you supplied to the frappe.call(), by modifying respective docs.

But the com cable connected to the machine in local computer

You will need to setup some sort of communication setup between the server hosting ERPNext and the machine the COM-device is connected to.