How to find out how to communicate with a network device - sockets

i have a question to a network specialist.
So I have a network device, its a Sky Q receiver.
I found a nodejs plugin which sends Buffers to the device to communicate with it.
To be clear I am able to send remote commands just like using the remote control.
For example he sends a Buffer containing:
var commandBytes = [4,1,0,0,0,0,Math.floor(224 + button / 16),button % 16]
where button is a command for example 0 is power.
So my question is, this guy found out how to communicate with this receiver.
Is there a general way how to find out how you can communicate and send commands to a network device?
I tried sniffing everything I can with Wireshark when i start a socket connection to the device I receive a buffer.
Probably my question can't be answered that easy but I wanted to give it a try.
The main point, why im asking stack overflow-community about this is, I have do not a starting point how to ask google this question.
Thank you very much,

Related

Siemens S7-1200 PLC LED DI/DO History

Is there a way to review the Digital Input/Digital Output LED light history of a Siemens S7-1200 PLC?
If so, is it through the web portal or through Simatic and can someone point me in the direction of where to find such information?
Thanks - will save me a site visit if possible in any way.
There is no built in DI/DQ history for the S7-1200.
However, if you have some form of TCP/IP connection, this can be done quite easily.
When you call outputs in your main program, use a tag based calling system. Reference that tag, and have the tag's output be:
The required DQ
A TCP/IP message saying that this tag has risen or fallen.
For inputs, just send a message on the rise and fall of each input
It is likely easiest to hold this DI/DQ history on the server that is hosting this TCP/IP connection rather than the PLC itself.

How to connect to NAO robot using sockets?

I'm playing with Aldebaran's NAO humanoid robot Simulator and choregraph.
I have a software in java that I would like to use to control the robot by activating its behaviors, and I believe sockets would do the trick.
My question is: is there a way to open a socket connection from within choregraph+naoSim, so I can get sensor readings and send commands to the robot?
Or any other way to connect to choregraph+naoSim to achieve the same effect?
thanks in advance!
K
I'm planning to use python websocket package to accomplish this. As far as I see the server can be written on anything. The client part - NAO - should initiate connection to the server send something, possibly wait for a reply and then carry on. So the sending functionality can be implemented using Python and coded in one of the NAO action boxes. You could even create a separate box that will take a request as a parameter and output a reply from the server. A small neat box that talk to the server.

Windows Phone 7 Connection with a wifi-enabled micro controller

How can i connect a windows phone 7 device with a WiFi-enabled micro controller. Should i use socket programming?? If yes then how?? I actually want to send a text file or a text message to the micro controller using WI-FI??
Your question is a bit vague. Are you trying to write a app that enables you to send a text file/message?
or are you trying to accomplish this by connecting to the microcontroller with the default connection your phone provides.
If you want to write your own app, you can do this by using a windows socket function. Have you looked into the standard code examples windows provides? They provide good examples about the basis of windows phone wifi connectivity
in example:
Example 1
Example 2
Edit:
You should take a look at this example.
Example
In this microsoft example, they make the game tic tac too between two windows phones. For your cause, you can read the data form file. Temporarly store it in an array. And send it over wifi. if you customize the example to fit your needs, so in steps:
Declare a socket (with the right ip adresses, ports etc)
Read file
Store in array
Send array by the wifi (using your previously declared socket)
And then on the microcontroller, you need some way to filter your data out of the incomming wifi buffer. I looked into one of my older projects where i did something like this. But i couldn't find it anymore. So i must have deleted it at some point "sorry :( " i you can work this out using the example

Unable to connect iPhone & laptop using TCP/IP

We're attempting to network between an iphone and a computer (windows 7) using TCP/IP over Wifi. We are having a lot of difficulty setting up this basic network and we were hoping to get some guidance.
Server side:
Currently, we are trying to use MATLAB's tcpip protocol to set up the connection on the computer. We have determined the IP addresses of the phone and the computer and we picked a port number (501), that we are trying to read and write from. We allowed that port number in windows firewall.
In simulink we set up a TCP/IP send block to send out a constant, by double-clicking on that block and selecting the "verify address and port connectivity" button we get the error message:
"The remote address '140.180.....' has been found. However, we are unable to connect to the server at the specified port.
Specify a different port or wait for the current port to become available"
We have tried other port numbers, but gotten the same message.
We have tried using an ad hoc connection between the computer and the iphone to the same effect.
We have also tried other MATLAB scripts to set up the connection (e.g. http://www.mathworks.com/matlabcentral/fileexchange/24524) but we always get and error in the connection
Finally, we tried sending and receiving info over TCP/IP with the same computer using two MATLAB instances running in parallel, but we generally get the same error message.
We even tried UDP...no dice.
Client side (iphone)
We're using NSStream exactly as per this tutorial: http://www.devx.com/wireless/Article/43551/1954
The stream is opened upon a toggle action, and we immediately send a string to the server. We also tried sending a continuous sequence of data with the run loop. One strange bit of behavior is that, after the stream is open for a little while (~1 min), the handleEvent method does seem to get triggered (implying something is received from the server??) because we get a log message corresponding to case NSStreamEventErrorOccurred.
We think the issue lies on the server side, but really don't know enough to be sure or to debug properly. Any help would be very much appreciated.
A long overdue answer to this one: don't network with Windows. We eventually thought to switch over to a mac and lo and behold everything worked properly.

Where would I learn more about interpreting network packets?

I'm working on a personal project. It's to recreate server software for the game "Chu Chu Rocket" for the Sega Dreamcast. Its' servers went down in 2004 I believe. My approach is to use dnsmasq to change the originl hostname that the game originally connected to, to my own system. With a DC-PC server set up, I have done just that, now instead of it looking up a non-existent dns record, it connects to my computer which will eventually run the server software. I've used tshark (cli wireshark) to capture what's going on between the client (dreamcast) and the server (my computer). The problem is, I'm getting data, but I'm not sure how to interpret it, I don't know what it's saying, but I'm sure it can be done because private PSO servers were created, those are far more complex.
Very simply, where would I go about learning how to interpret data packets, and possibly creating packets that will respond to such queries from the client?
Thanks,
Dragos240
If you can get the source code for the server software on your PC, then that is the best place to look.
Otherwise, all you can do is look at the protocol, compare runs, and make notes of similarities and differences. With any luck, the protocol won't be encrypted.