Thursday, October 23, 2014

Tah - Lego block for Internet of Things


TAH Main Board
In this blog post I am going to introduce the Tah platform and talk about some of the applications using it.

Tah is a hardware as well as a software platform.  The hardware has following characteristics
  1. An Arduino with Bluetooth Low Energy (BLE)
  2. Onboard USB (HID device) - emulating a keyboard and a mouse
  3. Great building block (like a LEGO) for your home automation systems using Arduino.

USB HID-Compatible
ATmega32u4 — the microcontroller at the heart of Tah — has onboard USB 2.0 support, that is used to directly program the Tah without having to use a USB-to-Serial converter. Tah can also act as a USB human interface device (HID), which enables you to create your own keyboard, mouse, joystick, or other input devices, all without the need for installing special software on the host computer. If you want to create a new smarter custom keyboard that communicates with your smartphone, you need not look beyond the Tah. It already has sample applications that allow you to control your PC, Mac, Linux, PlayStation and Xbox without ever needing to write any code for those platforms — all you need to do is program your Tah board and make a smartphone app, for which we’ve also provided open source examples for both iOS and Android to get you started.

Bluetooth Beacon

Each Tah board can serve as a Bluetooth beacon which tells your smartphone where exactly it is located based on the beacon’s unique identifier. This is amazing for indoor navigation, contextual notifications, and microlocalization.



Here are some of the interesting applications that can be built using the Tah and its shields.

Infrared Control (IR Transceiver Shield)

IR has been used for near range wireless communication for a long time. We have TVs, music systems, air conditioners and so many other things that have their own remote control  
We have created an IR shield which has a transmitter as well as a receiver on board. With this connected to your Tah, you have a universal remote that can be controlled from your smartphone. Forget keeping a bunch of remotes to control everything in your living room. You could do all of that from a single app on your phone. 

Relays (Relays + Sensors Shield)

Electronics is usually associated with low voltage DC appliances but so much of what we use everyday runs on 110V/220V AC. All our light bulbs, fans and everything else.  
To control these there is a Relay shield that translates signals between DC and AC so to speak. One can use the GPIO pins 2 and 3 from the Tah to control 2 relays. 
Bridge the gap between electronics and electrical with this relay plus sensor shield. It comes with its own app which you can use with some standard sensors such as the depth and temperature sensors among others.
  • Input working voltage: 7V to 12V DC
  • Two Relays rated 5V DC.
  • Load Capacity: 10A/120VAC, 10A/24VDC, 7A/250VAC
  • Relays are connected to Pin number 2 and 3 of Tah
  • Digital Pin Numbers 4 to 13 & Analog Pin Numbers A0 to A5 all are connected to 3 pin standard Grove connector

Arduino

That's why we have the Shield Shield which consists of the Arduino UNO R3 layout which let's you use the already available shields in their projects. This shield makes Tah compatible with all existing Arduino Shields, It means all your Arduino-compatible shields are also compatible with the Tah. (Input working voltage: 7V to 12V DC)

---
By no means is the above list comprehensive. There are many more amazing things that can be built using the Tah.  


Examples on the website. A forum to discuss more about this.

If you would like this device, you can grab them here.

(This is a product of Reavealing Hour Creations who run this blog and the IOT Community)


Thursday, July 31, 2014

Stellaris_ert

For someone who has loved C since he first started coding and still does, watching everyone else type away in his favorite language while his sorry ass has to deal with Matlab is a bit too much, call me sick but i am more attached to this primitive high level language than my own mother tounge.

For a year it went on, Matlab never failed to amaze me, but it never appealed to me as a choice of tool that i prefer, being a OpenSource hippie has its own disadvantages. I have worked on Matlab before, but those were sad days, when the night was dark and full of terrors, I myself prefered the staying away from something that wont reveal its true self, but now i had to work with it.

One fine morning in march 2014 i happened to search some gibberish on Google and happened to strike against this project by "Kyak" on github. I do not even know his real name or his gender, but the work he did did impress me..

I loved working with the hardware, but thrown into this abstract mess of interfaces that changed with every release cycle to the Customer meant, i can never really expect some surety in my software and bugs were bound to be present.

enough gibberish.. now, This project here deals with embedded coder and simulink coder, for those who do not know what this is...

It is a tool that converts graphical models to professional grade C code. sounds too good? yes it is.. considering the huge license fee.. its totally worth it for huge organization and there are so many of them.

This guy has made some set of scripts that create the blocksets needed to communicate with the Stellaris Launchpad from Texas Instruments, and all this can be done inside matalb, so stop worrying about the hardware issues, code away your idea, the rest will fall into its place.

Will come up with more things on this project after providing my contributuion to the same.

Do check this project out...

https://github.com/kyak/stellaris_ert

Thursday, July 3, 2014

Turning On and OFF syntax highlighting in VI

we all have our own preferred  way of writing code, most of the developers prefer an IDE while there are some who still love the classic terminal based editor like emacs or vi/vim.
I am of the latter kind and prefer vi over emacs (a personal choice btw.)
so how do you turn on and off the syntax highlighting in vi editor?
simple, go into the command mode by pressing esc and type the following


:syntax on
to turn on the syntax highlighting


:syntax off
to turn off syntax highlighting

Saturday, June 28, 2014

Changing Timeout in GRUB

This post specifically deals with configuring GRUB after a kernel has been built and installed on the UBUNTU 14.04.
The kernel images and System.map files are present in the /boot directory,  and the grub bootloader configuration loads the kernel image from there  only. The configuration settings of the grub bootloader are stored in the file /etc/default/grub

first of all you would notice that the
Selection_003

The configuration parameter GRUB_HIDDEN_TIMEOUT is set to 0, this somehow forces the bootloader to NOT show its selection menu.  we need to change that. just replace the zero with any value you want and then run the command
sudo update-grub
 
that's it... Reboot now and you will see the menu.

Wednesday, June 25, 2014

Hello Kernel

In this post we shall be writing a kernel module, which would cause the kernel to print our messages to the kernel log buffer. we shall not be looking deeper into the kernel buffer or the particular commands as that would be stretching this post too long. this is just a jump-start.

The kernel log is available through this command.
sudo dmesg
 
If you look at the messages already printed, they will be more often than not by the drivers , insert and remove a pen drive and run the command again, you will see some messages being printed. I would now advise to clear the kernel log buffer by running the following command.
sudo dmesg -c
 
now if you run the “dmesg” command again, you will see nothing or very minimal data s the old entries have been cleared and fresh entries are being put up.
let’s make the module now, do this task inside a directory you create, I named mine as “test” and the file as test.c. The contents of the file are as follows.

#include <linux/init.h>
#include <linux/module.h>

static int my_init(void){
printk("Hello world");
return 0;
}

static void my_exit(void){
printk("bye-bye");
}

module_init(my_init);
module_exit(my_exit);
 
now in the same directory make a file called Makefile and the contents of the makefile should be these.
obj-m := test.o
 
That’s it… now we run the command to compile our module. The command is as follows
make -C <linux-source-dir>  M=$PWD modules
 
if the compilation is succesful you will have a file named test.ko in the directory. we need to load it by using the insmod command.
sudo insmod test.ko
 
now see the kernel log by
dmesg
 
you would see the two messages “hello world” and “bye-bye”. It is finally done now, you have made the kernel print out a custom message for you.
There would have been many questions on the way but no worries all would be clear with some efforts. The strange make command, the new commands like “insmod” “dmesg” are real simple and can be understood with a simple google search. for the serious minds do read “Linux device drivers by greg kroah hartman” and “Linux kernel development by Robert love” the two very good books that i have always referred to. any more questions? do comment.. more than happy to help.