manage of two different socket - qt

I have a server program developed in Qt
A computer can connect to the server with a Qt Application
A mobile phone (android programmed in Java) that can also connect to the server Qt
The management of data reception and transmission differs.
I want to know how to recognize the socket of the computer and the phone.
Thank you

Related

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!

is Tcp-Modbus basically a Cleint-Server socket communication?

I'm building a TCP-Modbus application on PIC32MZ starter kit and My kit should act as Modbus-Slave device (read some data available on the ADC channels and send it to Modbus Master on every poll it will make), but I'm not sure, whether my device will be in TCP-Client (device will going to connect to a server) or TCP-Server (server will connect to my device) mode?
Regards,
Aatif Shaikh

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

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.

Can we use asp.net SignalR for controlling remote connected devices from some central server?

Can we use asp.net SignalR for controlling remote connected devices (not a computer or mobile just a different electronic device having its uniuque mac address) from control server? Server will decide when an alarm is supposed to ring from the device and if user not responded to the alarm then the device should send back some kind of signal or message to central server that alarm was not responded.
Yes , for this you will have to use a some sort signalr client
http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-net-client
http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-javascript-client
so what ever operating system you install on the device it should support .net or java

API to access GSM signal on computer

Hope this is the right place to ask - assuming so as it is related to programming.
I am looking for some hardware (say a dongle) that would open up an API for my computer to a SIM card. Does that exist anywhere?
The idea would be that I can then use my existing SIM card on its existing network/contract and with a bit of code, send/receive calls and texts. I figured that if a phone can be programmed to do it why can't a computer? I just need the hardware.
Any suggestions if this kind of thing is possible? Even by maybe integrating a phone?
You can use AT commands with any modem or phone, whose driver exposes a modem port when you connect it to a computer. Plug in the phone or modem, and go to Windows Device Manager, and look under "Modems" and see what you've got. From "properties" of the Modem, you can see which COM port it is on.
AT commands are an older method of communicating with a modem. There is a standard set of commands for GSM/GPRS/3G/4G devices available from 3GPP.org, here. Manufacturers add their own proprietary commands for more obscure functions. Many but not all of these are in the public domain.
Some newer plug-in modems may appear as a network adapter (you can see this in Windows), due to their drivers. In this case, you can use the following interfaces:
on Vista: NDIS, proprietary interfaces
on Windows 7 and 8.x Desktop apps: Windows Mobile Broadband API
on Windows 8.x, in the Metro/app area: Windows.Networking and MobileBroadband APIs.
on Windows 10, UWP, there are UWP APIs here. But they do not give as much functionality as the Desktop APIs.
On Windows 8.1 and Windows 10, if the appropriate drives are present it is possible to use the new MBIM interface via the desktop Mobile Broadband DeviceServices API. Mobile Broadband Interface Model spec available here.
On Linux, use AT commands via the serial port.
I'm a bit puzzled by your requirement to make (voice?) calls via a phone connected to a computer. Do you mean Skype? In this case, of course, you wouldn't need any interface for making calls, you would just open an IP connection over a data session - which can be done via any of the above interfaces.
(added this comment as an answer, as there was more information)
I use this GSM device: http://www.mikroe.com/click/gsm2/ connected to a basic UART like: https://www.sparkfun.com/products/718?gclid=CIj1xOzbur4CFUVbfgodCpQASQ
Then use AT COMMANDS.
I also use a piece of software called QNavigator to inspect the modem/gsm: http://www.soselectronic.com/?str=1329

Resources