Saturday, June 13, 2009

How to access Axis IP Camera using Java

What is an IP Camera?

An IP Camera is a stand-alone device which allows you to view live, full motion video from anywhere in the world. IP Cameras can be used for surveillance of both homes and businesses. With the ability to record live video to a remote location, IP Cameras allow you to make sure your recorded video is safe by storing it at a location that only you can access.



This was indeed a challenge for me at the first time. But with mere investigation i could find that before accessing the IP camera we need to obtain authentication as it is working as a video server. I would list out what i did to capture a video stream from IP camera

Step1 : obtaining the IP address of the camera (it will get assigned an available ip address from the network as it is configured upon DHCP by default) . You can use the utility software provided by the camera provider in case of finding the ip.

Step2 : You may need to configure the axis camera giving a password for the default "root" user. If you want you may add many users as you wish using their utility software.

Step3 : Then you can go to the URL of the camera and make sure the JPG or MJPG streams are there.

Step4 : Next challenge was to obain authentication from the video server of the camera using Java code snippet. In that case i used java.net.Authenticator. Authenticator would consist of the URL , username and password which we are providing for the server.Then setDefault(Authenticator a) Sets the authenticator that will be used by the networking code when a proxy or an HTTP server asks for authentication.

Step5 : Now you are successfully connected to the Camera. :)

Step6 : Then you can use the video stream from the IP camera for whatever application you use.







Tuesday, May 19, 2009

How to configure a Star Printer (TSP 800)

This POS printer provides a solution to a number of applications where no POS printer was able to before. From compact web printing to mobile transportation printing as well as producing wide high-quality POS receipts with professional and crisp graphics, the TSP800 is the solution!

The TSP800 is the only printer on the market that provides printing on 3” to 4.4” wide paper at an amazing speed. It is the perfect printer for applications that need to print a large amount of information on a receipt



1) First identify the interface of the printer, my one is having Eathernet Interface.

2) Accordingly you may guess how you would connect your printer. e.g : If it is having an USB interface it may be directly connected to the computer. If Eathernet interface it would be connected to a Network add as a Network printer (TCP/IP).

Below i asssume the printer as TSP800 Star Printer having Eathernet Interface.

3) Before adding your printer as a network printer you have to find out the IP address of the printer. Most of the printers at the first time are configured upon DHCP , so it may assign an IP for itself dynamically. For proper and ease of use you have to assign a static IP for the printer.

4) In case of finding the dynamically assigned IP address of the printer , the only way you have to follow is printing the self test page which would contain each and every information of the printer statistics. (Note: when you take a self test page just press the feed button once just as you turn on the printer, do not press consequently as it may lead to some problems. While printing it may suspend in the middle, do not think it as a problem, it is because of the time taken to identify information of the network card in built to the printer)

5) Now you can go to the printer interface (web page) using the IP found in the test page. (http://ip of the printer) . This will led to access the system access interface of the printer in case of assigning a static IP

6) Use defauld username and password as in your test page. otherwise (root , public). This would carry you to the system access interface. There you can assign a static IP to the printer.

7) You are almost done : Now add the printer as a TCP/IP printer.How to add your printer as a TCP/IP printer is listed here http://www.tamu-commerce.edu/ctis/help/tcpipprinter/default.htm. Note: use the ip address you assigned in step 8. Port would be assigned automatically.

8) Print a test page to test your printer. You are done :)