JMF and RTP Protocol - java

I am doing a project which consists of a video-conference system in Java and using the RTP protocol. The problem is that I can not pass the stream to the clients, that I capture in my webcam. I already turned off my firewall, but still it does not work.
Someone can give me a hand?

Try to look at the network traffic, e.g. with Wireshark.

Related

How to get data from RS-485 connected by USB

I need to read data from some Data Aggregator Device over RS-485 interface by USB port (USB-to-RS-485 converter used) for the Desktop App on JavaFX, so I have stacked on checking connection and getting proper values.
Data Aggregator Device collects information about produced current, power etc. from PV-module (Solar Energy). This device has the only RS-485 port. As I read from a documentation, it uses Modbus RTU protocol (with settings: 9600-8N1).
To be honest, It's my first experience with working on COM-ports and Devices. That is why I don't know even am I correctly connect pins. I read a lot of things related with RS-485, Modbus. But, still, I am on the first steps.
So, I use simple UTP cable to connect. And what I have done:
This is how I connect USB-to-RS485 converter
And this is
about Data Aggregator Device
Windows found virtual "COM3" port, after connecting USB to PC. Then I try to check connection with Terminal 1.9 by Bray. I try to send something. And as receiving messages it sent me some data also. However, it doesn't mean that everything connected well. Also terminal shows me some FRAME ERROR.
I know, that Modbus protocol based on "master-slave" scheme. Therefore, PC as a client is "Master" and device as a server is "Slave". I have to send some request to the slave to get some expected response. But, how?!
Please, check my connections! I don't know what to do next.
RS-485 is differential and requires just two wires, you can safely remove the ground wire (GND). Then, connect the wires to R+ and R- on your USB-to-RS485 converter
Done that, may I ask you how you tried to send something? Modbus requires a final byte, the CRC which is hard to determine by hand. Did you create a valid modbus packet?
A valid modbus packet requires a receiver address, the payload length, the data itself and the final CRC
I don't know about java, but if you do have specification of devices protocol, you can surely use terminal program to send message to modbus and read messages back. That way you will have protocol tested and it shouldn't be to hard to make custom software later. But until you can send message and get back meaningful message using terminal software I recommend you to stick to it.
This youtube video will give basic knowledge needed about modbus RTU packet format: https://www.youtube.com/watch?v=OvRD2UvrHjE
The most difficult part is calculating CRC every time. But luckily you can download Docklight terminal. It actually has an option to calculate CRC automatically for modbus and add it at last positions of the packet.
You can download free version at their homepage.
docklight.de
It is very simple to use. Same as Bray terminal you used.. And here is example of how to set up modbus CRC calculation for every package.
https://docklight.de/manual/sendingmodbuscommandswithc.htm
I know they also have great support.
Once you successfully send message to device and get answer, things will get much easier because you will understand how protocol actually works. Modbus RTU is very mature protocol, but it is still used because many existing systems use it and it is very simple to add it to some device. All device needs is Serial port (UART) to connect to modbus. So it is not that hard to understand it and use it. Just check out explanation video and terminal specifically adopted for modbus that I gave links in this message.

Getting information from a cisco / juniper router with java

What method could I use to login to a Cisco or Juniper routers? I know I can use telnet to make a connection to the router itself but I am not aware of an API or anything that allows me to login non-interactively. So how could I do this?
Are there any libraries I can use to achieve this?
I have seen people use scripts that implement things like expect to know when to send the username and the password. But that is for shell scripting. How can I do this in java? I would prefer to keep strictly in java too.
The goal of this is allow a java program login into a router so I can query the router for interface states and execute commands on the router.
Any ideas?
You need to use some Java library for doing the same. http://www.pitman.co.za/projects/jssh/ is a good Java SSH client. http://commons.apache.org/proper/commons-net/ has a good telnet implementation
As far as extracting information, you should be able to do it by using SNMP to query the router. Pretty much everything is available over SNMP. Now, as far as command execution, there are SNMP set commands used to "write" information to a router, but you will need to look into that more carefully as I doubt the full command set can be replaced with SNMP set commands.
For Cisco, find out what the IOS image filename is for your device, then you can get the MIB file here: http://tools.cisco.com/Support/SNMP/do/MIBSupport.do?local=en&step=3. Review the MIB file and you will see what is available via SNMP for that device.
You should be able to do something similar for Juniper on their site.
Now, I don't know much about Java, but I do know that there are SNMP libraries available for it (like http://www.snmp4j.org/ ).
With that you will not need to worry about logging into the router, or about any interactive stuff.
Note that, in the case of Cisco, it's common to connect using a serial port on a PC directly into the service port on the router. This connection uses a programming protocol called IOS.
The easiest way to utilize this is with a programming language called expect. This name describes the language in that you expect to get a prompt from the port and then you respond. Sending that message (your response), you expect to get another response, to which you respond, ad completum - my term ;)
Note that this cable is proprietary to Cisco, I'm sure there are pin-outs available though.
Finally, it would be possible to emulate this program on java, via a serial port library.

networking in java for client server communication

I need to make a troubleshooting tool in java
From the java code, I need to communicate with tethereal (linux commands) to help me generate a .pkt file. The .pkt file will contain all the contents of the communication that took place between the client and the server- i.e. all the packet communication between the client and server.
how should I do that?
Do you know WireShark? That is a cross-platform Network Packet Capturing application.
The idea is that it captures all packets (TCP and UDP) that passes one network device (eg: WiFi card) and you apply a filter on the port that your application uses, and eventually an IP address. Very useful tool.
If you really need to do it in java you can use http://jnetpcap.com/ which is a wrapper for libpcap which works similar to tethereal.

Getting an RTMP stream from Java

I feel pretty stupid asking this, but I just couldn't find anything on the web that helped me.
Is there a way to connect to an RTMP stream from within a Java application?
I just need to connect and read a few bytes. I even don't need to play a video or anything. It's only for monitoring the connection.
I tried using java.net.URL and even red5's rtmpclient and rtmpconnection, but couldn't figure out how it could help me.
i found JUV RTMP Client that allows connecting to a RTMP Server.
it has the following highlights:
1.RTMP/RTMPT/RTMPS/RTMPE/RTMPTE protocols support (both AMF0 and AMF3 encodings)
2.Remote method invocation
3.Remote shared object management
4.Play and publish audio/video streams (supported by the server) (!audio/video codec implementations are not included!)

rtsp server forwarding

So I am trying to stream a webcam feed from my computer to my android phone. I am using a simple forwarding server to connect the two so that I don't have to worry about home network IP firewalls ect. I am using FMJ to capture the video feed and was thinking rtsp protocol would be best because android supports reading it. My problem is I dont know how to forward the information via the server, is it as simple as forwarding UDP packets? all programs involved are implemented in java btw.
Use Netty. It is very easy to create an RTSP server with this library. For hints see the sources here.
Or you can port my library which is written in C#
http://net7mma.codeplex.com/
CodeProject article # http://www.codeproject.com/Articles/507218/Managed-Media-Aggregation-using-Rtsp-and-Rtp

Categories

Resources