LockDown PC based on availability of Bluetooth Device

programming

This article describes a method of locking the PC when the user is not around.Actually it detects the user mobile phone’s bluetooth (And yes it has to be turned on all the time.) and if the application can’t find the phone it sends a command to lock down the workstation.The codes are written in  JAVA and it uses the Bluecove library ,which is a open source one. The app uses the bluetooth MAC address instead of the name so as to provide security. So first we need to find out…

Read More

CRC16 using JAVA

CRC16 using JAVA

CRC codes are numerously used for error checking purposes. So many times working around Embedded Devices you will find CRC used in different communication protocols for error detection. This piece of code will help you to generate CRC16 using provided packets in JAVA. While working on devices like Raspberry Pi which supports JAVA and industrial protocols like MODBUS which uses CRC16, this code can be used.  

Read More

Get Windows PC Uptime using JAVA

programming

This code snippest is about getting the system uptime using JAVA. The way it works is we invoke net stats srv from java using, JAVA Runtime. The command returns the time that the PC has been up for, A sample command in a windows system looks like, Microsoft Windows [Version 10.0.10240] (c) 2015 Microsoft Corporation. All rights reserved. C:\Users\user>net stats srv Server Statistics for \\DESKTOP-****** Statistics since 3/31/2020 8:49:26 PM Sessions accepted 0 Sessions timed-out 0 Sessions errored-out 0 Kilobytes sent 60 Kilobytes received 53 Mean response time (msec) 0…

Read More

Install Zulu JDK on Ubuntu

ZULU JDK on Ubuntu

Recently I moved my server to Ubuntu from windows. I went with Ubuntu 16.04 server edition as it is lightweight as compared to the desktop edition and comes preloaded with some server tools. As I am running OpenHAB for my home automation system I wanted to install it on the server but the server edition doesn’t come with JAVA/JDK pre-installed. As per OpenHAB, Zulu JDK is the recommended JAVA platform and performs better as compared to OpenJDK. Though Oracle JDK can be installed, I thought of trying ZULU. So let’s…

Read More

Access Watchdog Timer of Raspberry Pi using JAVA

This tutorial is all about using the watchdog timer of Raspberry Pi by using JAVA. For this, we are going to use Pi4J library. Watchdog Timer: “A watchdog timer (sometimes called a computer operating properly or COP timer, or simply a watchdog) is an electronic timer that is used to detect and recover from computer malfunctions. During normal operation, the computer regularly resets the watchdog timer to prevent it from elapsing, or “timing out”. If due to a hardware fault or program error, the computer fails to reset the watchdog, the timer will elapse and generate a timeout signal.…

Read More

Firmata protocol with Raspberry Pi and Arduino

Firmata with Arduino and Raspberry Pi

Firmata is a protocol that is used to communicate with microcontrollers from any tablet/pc over the serial interface. There are implementations of this for other platforms too along with Arduino. You can find support for this if you are using any Arduino IDE released after 2008.Use of this protocol lets you access GPIO of Arduino from any host device natively without uploading the sketch each time you change the sketch. You can use Arduino as ADC for your Pi as it doesn’t have native ADC pins, you can also interface…

Read More

DHT12 Interfacing with Raspberry Pi using Pi4J

DHT12

This video around raspberry pi showing how to interface DHT12 humidity and temperature sensor with raspberry pi by using JAVA nad Pi4j. DHT12 its a temperature sensor with a 1-Wire and I2C interface to connect with external controllers and having 1-Wire interface makes it compatible with the older DHT11 sensor but with a higher accuracy. For this tutorial, we are going to use the I2C interface of the sensor and to interact with it, we will be using JAVA. One issue with the DHT12 I2C interface is that the device…

Read More

Run JAVA Applications on NanoPi S2

JAVA nano Pi

The NanoPi S2(S2) is designed and developed by FriendlyElec for professionals, enterprise users, makers, and hobbyists. It is a small board with WiFi, Bluetooth, and eMMC. It uses the Samsung Quad Core Cortex-A9 S5P4418 SoC with dynamic frequency scaling up to 1.4GHz. It has 1G DDR3 RAM, 802.11 b/g/n WiFi & Bluetooth 4.0 module. Its inbuilt power management unit uses the AXP228 chip which supports software shutdown. It takes power over the MicroUSB port. It has video input/output interface, 3.5mm audio jack, USB port, and MicroSD card slot, serial debug…

Read More

Measure Distance using Ultrasonic Sensor HC – SR04 | Pi4J | JAVA | Raspberry Pi

uLTRASONI pI

This is a simple tutorial showing how to interface HC – SR04  ultrasonic ranging module with Raspberry Pi to measure distance using JAVA. Ultrasonic ranging module HC – SR04 provides 2cm – 400cm non-contact measurement function, the ranging accuracy can reach to 3mm. The modules include ultrasonic transmitters, receiver and control circuit. The basic principle of work: (1) Using IO trigger for at least 10us high-level signal, (2) The Module automatically sends eight 40 kHz and detect whether there is a pulse signal back. (3) IF the signal back, through…

Read More