Using Java to control Hardware

Looking for ways to use Java programming language to control hardware stuffs? Looking for ways to control electronic devices, interface to system or monitoring sensor status?

Most people think that Java being a high level language would not be able to control low level hardware stuffs.

Can Java programmers control hardware automation lighting, door access, motor motion and main power switch On/Off?

Can you use Java to monitor hardware sensors, check temperature/humidity, detect poisonous gas, or check noise level?

The answer is of course yes!!! Why not?

 

Java is by concept forbidden to have direct access to hardware for the reason of security. Most hardware control is via the operating system like WinOS, Linux or Macintosh. While Java has restricted access to hardware, communication via data stream is available. The means of communication opened up the gateway for Java to control hardware.

Network communication is one popular and well known communication means which Java is very good in. It is possible to use network communication to control other electronic hardware. TCP/IP or UDP is two of the most common low level network communication via the Ethernet or WiFi. You can send low level data to directly communicate with the hardware, to control devices and to read sensor status. Data stream can be interpreted as bytes and be processed just like low level processing.

The next most popular communication means in the hardware world is the serial communication (serial com). Examples of these are RS232, RS485 or RS422. It is a low level hardware communicate still commonly used today in most electronic hardware design. The serial communication itself is a low level hardware access. The standard Java SDK do not includes the means to allow access to serial com, but there are libraries available written through JNI (Java Native Interface) which allows Java programmer to write communication data stream for serial com. You can communicate directly with electronic hardware that uses RS232, or virtual com port (virtual port create from USB port). However the use of JNI can means that your Java code will not be easily portable.

With the advancement in technology and communication methods, more and more support will be available from Java.

  • Bluetooth
  • NFC (Near Field Communication)
  • Zigbee/Xbee (Peer to Peer communication)

Check out the following I/O Controller products which enables Java programmers the power to control electronic hardware.

I/O Controllers for Java

I/O Controllers from IOanyThing allows control directly from a Java program. Source code examples, API library in Java and other languages are available to help programmer to have a quick start in their development work.

For network base hardware I/O controller, the Ethernet IOaT-E series will be the controller for your Java network programming.

For self powering, small scale, short distance devices, check out our USB I/O controller IOaT-U series.

The models available from IOanyThing,

Ethernet I/O Controller series

USB I/O Controller Series

IOanyThing Products

IOanyThing design hardware interface product, empowering you to control any electronic gadgets or system using any programming languages that you enjoy programming. Check out our website for further details in customising a controller specially for your application use.
We can help you to connect any electronic hardware stuffs.

Enable Telnet on Windows 7 OS

Telnet is an application layer protocol, which allows data communication over the TCP/IP layer.

The following is a simple guide to help you enable your telnet from your Windows OS.

Check if Telnet is available

Before you start, check if the telnet program is already enable in your system.

  1. Launch command prompt.
    Go to Start -> Run. Key in “cmd”, and press enter.
  2. Execute the Telnet program.
    Key in “telnet”, and press enter.
  3. There is no Telnet program installed if the following error message appeared,
    ‘telnet’ is not recognized as an internal or external command,
    operable program or batch file.

    telnet program is not installed
    Proceed to the next section to install the telnet program.
  4. If telnet program is installed, your should see the following message,
    Welcome to Microsoft Telnet Client

    telnet program is already installed
    Press “Ctrl+]” then type in “quit”, and press enter to exit the telnet program.

Install Telnet

Telnet program is available on the Windows OS. You just need to enable it. The following is the instruction to enable the telnet on your system.

  1. Go to Start -> Control Panel -> Programs and Features.
  2. Click on the left side bar menu, “Turn Windows features on or off“.
  3. Scroll down the program list and click to put a tick to “Telnet Client” and “Telnet Server” as shown.Install telnet program from the Windows OS, Programs and Features

You Telnet program is now installed.