Obtain data from COM port (rs485/rs232), and broadcast the information through raspberry pi - serial-port

I am working in a factory. There is a HMI (Human Machine Interface) tablet which control all the switches and logics of a manucfacturing machine.
For example, I can limit the speed of manufacturing or change the number of production plan easily, through the HMI.
Here is the images of the back panel of the tablet (KINSTON tablet, not KINGSTON tablet). Consist of usb port, com port, rs-232 port, rs-485 port.
What I am trying to do is to obtain the data of the manufacturing machine, and show the real-time production details to the back office of the factory. (At the mean time, I have totally no idea what the operating system the tablet is using). Or maybe using a website to control it. Or even using mobile app to monitor the condition of the machine.
Is there any easy way to obtain data from these port to a raspberry pi and make a real time reflection of the data. To be more specific, which port should I use to obtain the data?
How should I kickstart this project? I am total newbie of COM port, I have googled around but can't find a concrete example of connection to a computer.

Related

Simulate com port on pc to be recognised by other pc

Currently I have a server, that communicates with a projector through a RS232. The server opens a com port when the projector is connected. The same happens to any PC when a certain type of device is connected through the USB (lets say an Arduino for example). What I want to do it basically replace the projector with a PC/Arduino/Raspberry without the server noticing anything. That would mean the server will recognise the connected PC and open a COM port for it. What do I need to do on the PC so that it automatically opens a com port on the server? I guess there is something very basic that any printer, Arduino, projector etc does, that computers recognise it as a "com port device".
P.S. Doesn't matter the OS on the PC, I just need to make it work and then implement w/e I need to do with the established communication over the port.
P.S.2 I've searched a lot about it, but probabl I am doing it wrong, because I didn't find my type of question anywhere.
COM ports are basically hardware that is detected by the system. Let's say, if an Arduino is connected to a PC, it has its onboard USB to TTL converter which can be found in the device manager(if using windows). Similar USB to TTL converters are there in the market like CP2102, PL2303 which acts like a COM port even if no device is connected further to it. it may be possible that the program you are using(as you referred server) may be sending some data over the serial port and verifying the hardware.
What you need to do to replace it is, first of all, find the baud rate at which the communication is going on, then, listen over the serial lines which machine is sending which message in the sequence(there must be a handshake as I mentioned earlier), if a complicated algorithm is not used by the device, you can simply mimic the device by sending same messages over serial.

Serial to Ethernet converter connected directly to router/switch

I have a digital scale for trucks that is currently connected to a Windows XP computer that is unusable because of all the bloatware and viruses installed in it and the fact that the pc is 15 years old and it can't be formatted because the software and drivers for weighing the vehicles would be lost.
I'd like to develop a web application and configure a pc with Ubuntu Server running LAMP, and upgrade the whole thing so I can get rid of the old XP computer and work everything from a web browser.
I can connect and process the serial data using either NodeJs or Python, but I did that by connecting to the scale directly with my laptop.
What I need is to be able to connect to the serial port from another office where the PC with Ubuntu Server will be.
Is it possible to attach the digital scale to an ethernet adapter that doesn't require a host computer ???
My main problem is that I need the server to not be in the same room where the scale is and ethernet is my only option since there is an ethernet cable that runs undeground to where the scale is and is connected to a small switch which the people that weigh the trucks use.
I guess one option would be to use a Raspberry Pi maybe (since it's small enough) to connect the to the LAN and to the scale, and transmit the data whenever the server requests it, but I don't know if maybe just by using a converter only, the server could connect to the scale and get the data without the use of a host...
Any help would be greatly appreciated!

Can i communicate between two PC using PCIe for high transfer speed, if possible how can i communicate?

I have a raspberry pi 4 and a pc, I have to transfer files at very high speed than Ethernet and WIFI
if any possible methods are there Please tell me?
I'm not too sure if you're saying you want to transfer files over something other than wifi or Ethernet? If so, USB A to USB A should work for you. PCIe are downstream slots which you would be unable to connect to another system using that method. If you are able to plug up to each of the systems using ethernet, that's probably your easiest choice. As long as you bridge the connections and allow file printing and sharing, you should be able to see the system in your file explorer.

How can multiple smartphones connect to a mcu at the same time?

I'm having the hardest time to get the solution of the following problem.
Main issue:
Several smartphones(up to 30) must communicate with a MCU at the same time.
System overview:
There are many rooms(each room is a cabinet that 30 people can go into), and every cabinet will have one MCU for the smartphone users.
MCU will control some device of the cabinet.
The scenario of this system is as follows:
1. The users go into the cabinet.
2. Smartphone app will recognize the MCU(or MCU will recognize the smartphone) and the MCU will send some data to the smartphone and this data will be noticed to the user.
3. User inputs some data at the smartphone app and this data will be sent to the MCU to control the cabinet device.
4. Up to 30 people can go into the cabinet at the same time and the system should handle all the users simultaneously.
I'm going to develop smartphone application and MCU firmware for this system.
My thought:
I'm thinking to use Arduino/RFduino/Raspberry Pi as MCU and I'm thinking to use Bluetooth LE/Wifi/3G as communication material.
I've tried the following solutions
1. Using bluetooth low energy on Arduino/RFduino/Raspberry Pi.
MCU will be BLE peripheral and my smartphone app will be BLE central.
But I found that a BLE peripheral can only be connected to a BLE central at the same time so I can't use this method.
2. Using wifi on Raspberry Pi
I think that Raspberry Pi can run web service and my smartphone app can communicate with the server through http.
But every time the smartphone user go into the Raspberry Pi based wifi-zone, the user should select the wifi-hotspot at the network setting if he registered this wifi already, and the user should register the wifi-hotspot if this is the first time at the wifi-zone(cabinet).
This is very inconvenient for the users so can't be used for me.
3. Using 3G network on Raspberry Pi
Unfortunately, there's no 3G signal in the cabinet so I can't use this method.
I'm looking forward your kind answer.
Any hints or comments will be welcome.
Thanks for your attention.
Thanks for your answer in advance.
Toltori Kim
Well... I'd go with wifi. And QR codes.
I'd make either a single wifi network for all the cabinets (so only one set of credentials, or even an open one - without security) and then the app can connect to the raspberries using a sort of authentication (where the credentials are written in a QR code inside the cabinet) or a wifi network for each cabinet and its credentials are written in a QR code.
I'd use the first one, maybe without security. So the user has just to go in the cabinet, connect to the common wifi, make a photo at the qr code and then can use the RPi

App that analyses COM1 activity

There's a old piece of software we run in our company that manages RFID cards tapping in/out to open doors.
We want to create an app who identifies who just touched in on a specific place (we have the id for that) and grab their 1st name, to say "Hi [NAME]" on a screen.
As I mentioned, the software is quite old and there are no APIs. It communicates with the RFID hardware via a serial port (COM1).
I was wondering if the best way to get the data I need is to somehow intercept the COM1 traffic and extract/look for the data I want.
Does this sound like the best way to go about it? Would it work, or would it be impossible to get names and numbers from the data being transferred?
Cheers,
Andre
Can you configure the software to use a port other than COM1, or configure the hardware so it's physical serial port is assigned to a different COM port?
If so, take a look at com0com. It's a Windows driver that creates two COM ports on your PC with a virtual NULL modem between them. Data going in on one side comes out on the other.
Here's how you'll set things up:
RFID Reader connected to physical COM port (COMx)
your program bridging COMx to COMy and sniffing the traffic
com0com linking COMy (for your program) to virtual COM1 (for the legacy software)
legacy software
You'll need to write a program to pass data between COMx and COMy while monitoring it for the information you're looking for. Make it simple yet robust, since if it goes down you're reader will stop working.
A Simpler Solution
If you only need to monitor one side of the communications, create a cable that connects the GND and RX pin of COM1 to another COM port. Now your program can monitor that side of the conversation, without interfering with the legacy software.
Well, generally, you can look at RS232 signals, if that's the way you want to do it. It's tricky because you need to "sniff" the signals, which means buying or making a rig that allows the original signals to go through, and then gives you a way to attach to them as well. And, you need to send the transmit and the receive signals to TWO serial ports (on the RX lines). Then you'll probably want to get some "sniffing" software that allows you to look at what you're getting in time sequence (ideally, with time-stamps). Some cutesy protocols also will use modem lines, so you may need to monitor those as well.
Or, try searching for "free serial port monitor" or "serial sniffer".
Good luck!

Resources