I don't know if it's actually possible but I need to get the weight from a digital scale for trucks either with JavaScript or PHP.
Currently the scale is connected to a PC that is extremely slow and runs Windows XP along with a custom software developed by the company that made the scale to keep a registry of the different vehicles that get weighed each day.
Unfortunately the PC can't be upgraded since I would lose all the drivers and the software doesn't work on a newer version of Windows.
I was thinking that if I can communicate with the serial device and get the data, either through Javascript or PHP, and get the weight same as the custom software does, then I could make a small webpage with PHP and a MYSQL backend that does the same thing that the custom software does but with all the functionality that I'm actually missing and upgrade the PC.
I bought a serial to USB adapter and connected the device to my Windows 10 laptop and it appears that it's transmitting data correctly as you can see in this picture
I've searched for ways to communicate with a serial device with Javascript and I think that with NodeJS you can do it but I don't know if I can implement that to a webpage. Also I haven't written anything in C or C++ or C# so I don't know how I would do it from any of those languages (a lot of the answers I saw were to do it using one of those).
I also saw that there is a chrome app called chrome.serial but I haven't found any working examples that would indicate me on how to proceed.
Any help would be greatly appreciated!!! :)
One way is to set up an Node.js Environment and then try out serial.io
https://serialport.io/
I have fiund this, maybe this is the way to go.
For Real-Time applications, Node.js is the way to go along with socket.io, for real-time updates on your website
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With