Need to send ASCII string from website to PC via UDP - javascript

I'm looking for some ideas on how to approach this challenege.
I have a tablet that I'm using as a remote control to trigger software on a PC.
The trigger is an ASCII string that has to be sent via UDP.
The network is closed, no protection or security enabled. The server has a static IP.
I've built the website and created all the functions but haven't found a great way to actually send the text from the website to the PC.
I'm thinking that node.js -- which I have no experience with -- is the only way to do this but I'd appreciate some other thoughts.
Thanks.
Dave

Related

Modbus TCP communication from HTML/Javascript Webpage

I have a device that uses Modbus TCP. I want to read data from it and display it on a webpage (Without an in between server).
I have found a project that does almost this exact same thing as a Chrome extension:
https://github.com/Cloud-Automation/chrome-modbus
It uses this in the javascript code: chrome.sockets.tcp
I was hoping that I could do the same thing on my webpage using WebSockets.
It seems that websockets would work on my webpage (acting as the client), sending and receiving information from the device (acting as the server). It doesn't seem that websockets is affected by cors.
Does anybody have pointers on where I could start on this? (Or a javascript library would be great)
Is this possible?
Without an in between server will not be possible, unless your plc supports other protocol different than modbus (e.g. post/get).
If your plc is "completely closed" and you only have this port/protocol open, then you need an in between server that makes the conversion of modbus tcp to html. Using node-red as well as the dashboard and modbus flows, you can achieve it.
If you solved it other way, I would like to know how you did it.
I did get this solved without a server in between. I did it using Chrome Sockets link I also made it work using a cordova app for smart phones. Firefox has a sockets api as well, but did not attempt to figure it out for that browser.
I solve this using the PLC Connect in vb, i used vb to pass data in database and get the data through javascript.

Getting basic information of devices that is connected to network

Base of my question: I am trying to create a simple code that can list basic information of a device that is connected to a network. For example, I have a wireless router, and there is a device(Mobile Phone) connected via wireless connection, and a device(Laptop/Desktop) that is connected via LAN. Now I want to find out what kind of device it is, also: the IP address, MAC address, processor, RAM, HDD/Internal Storage, Flash Drive(if connected) and let's say hardware manufacturer (If possible) etc..
Now I already have searched for these, and I found that this can be done by .NET, but I am thinking that this would be better if I can access this via web so even I'm at the office/work I can check the devices that are connected to our network. So I decided to do this using PHP, but don't know how to begin because I only have little knowledge of PHP, anyone can give me a sample of what I am tryng to achieve? Or any better reference on getting information of connected device on network via PHP?
PHP is a server side scripting language.
It will not allow you to enumerate connected devices due to security reasons.
Take a look at PHP with NMAP:
https://nmap.org/
Some examples to look at:
How to use Nmap in PHP exec
PHP trim nmap MAC address

Detect local devices using HTML5 websocket

I'm working on a project which uses HTML5 WebSockets to connect with an iOS App. I need to display a list of near by (within the same local WiFi network) iPhones/iPads inside the webpage.
Is it possible to use any discovery mechanism like Bonjour to achieve this?
Is there any way to detect the local IP address from the website (using Javascript or from server side script) so that I can scan the local IP range?
If you're only looking to match devices on the same network, you could just check the public IP, since everyone connected to the same router will likely share one. That said, while a native iOS app should be able to detect a local IP address, I don't know of any way to do so using Javascript.
The one exception is if you have a server running inside the local network (or a custom binary running on their machine). It doesn't sound from your description like this is an option for you, but in case it is, a server within the user's LAN will see their local IP rather than their public IP. It could then relay that to a public server if needed.
I'd love to be proven wrong though, because I could think of some really cool things to do if it were possible.

getting client PC computer name or mac address

i need to get computer Name or Mac address from client side who browse my website
i mad a research from 1 month ago until now i couldn't find the correct code , is it hard to do or possible ! in JavaScript or PHP ?
This post explains that this is not possible on the server side and the explanation is also given.
how to get a client's MAC address from HttpServlet?
Client side software may be able to do it but only by tricks. From pure JS this is surely not possible.
Getting MAC address on a web page using a Java applet
No, it's not possible and you need some knowledge in Computer networks to understand why.
To be able to track the MAC address of every client, you need to interact with it at the Link Layer (or OSI Layer 2). This is the case when you are the router that the client uses as a Point of access to the Internet. Not when you are just the server hosting the website the client is connecting to.
However, your server interacts with the Application Layer. At this layer, you can track your clients' UA (User Agent) but this won't identify them in a unique way.
Moreover, people can change their Wifi MAC address => on a MAC OSX, run the command "sudo ifconfig en0 lladdr 00:01:02:03:04:05"
For a good introduction to Computer Networking: https://class.stanford.edu/courses/Engineering/Networking/Winter2014/about

Help with android to chrome communication

I have been working on creating an application that sends a string from an android phone to a server and from there sending it to a Chrome extension. I am sitting with a few options to continue, I can convert everything to websockets, I can use normal sockets for android to computer and websockets for extension to server, or I can do some HTTPRequest stuff.
I am looking for suggestions on the best way to pull off this communication. I have a php server an android application and a chrome extension that need to be connected. If there is a way to connect the android application to the chrome extension without the server I would be happy to hear that too.
I need something secure and something that can be organized based on the correct person asking or sending information. So when someone sends a string from the android application the server stores it (probably using their gmail) and when the extension asks for it the server sends it along.
Also could the server just push the string to the extension without the extension calling it? This would occur after the initial websocket connection. I guess it would just store the IP address or something like that.
Any suggestions or comments would be appreciated I am just trying to make the most efficient and secure system I can come up with. I have done a significant amount of research about every aspect so I'm more suffering from information overload then anything.
Thanks in advance :]
Look into Windows Communication Foundation Services (WCF). That's what I have been using for my android applications working with a database - the .NET framework is great, and the services seem to be fairly dynamic.
http://msdn.microsoft.com/en-us/netframework/aa663324

Categories

Resources