Posts

Adding cheap LCD display and bluetooth shields to a Netduino

Image
I purchased a cheap LCD keypad shield from DX  that makes it simple to add a 16x2 LCD display to an Arduino. The board also includes a set of buttons that are connected to a single analog pin through a resistor ladder network.  It's a pretty slick way of minimizing the pin count.  The board is designed for 5V.  The Netduino is a 3.3v system. The buttons resistor network is wired to the 5V supply so most of the buttons  analog values  are out of bounds for the 3.3V input.  Others have modified the board to use the 3.3v rail or dropped 5V to 3.3V through a resistor. I didn't do any of this because I don't need the buttons. The LCD uses digital pins D4-D9 and can operate with 3.3V signals.  The Netduino MF libraries support the on-board devices but not external chips or interfaces.  The LCD Controller is a standard HD44780 which is supported by nice netmftoolbox supplemental library. I downloaded the netmftoolbox library from codeplex and un...

Using a Cheap Bluetooth Shield on the Netduino

Image
I found this $19 Bluetooth Shield on DX.com from  Elec Freaks .  They claim it is Arduino compatible but the Wiki and spec sheet both say 3.3v only, in bold,  which means it doesn't work with a standard 5V Arduino.  Netduino  boards use Arduino shields and have 3.3V signal levels. The shield comes with an HC-05 Bluetooth module which can act as either master or slave. You can set the mode by sending it AT  style commands after configuring the two switches to set it to command mode.   It is a little simpler than the "you have x seconds from bootup to configure" that some other devices have. My board arrived in Slave Mode which works with a PC acting as Master. The module has an on-board voltage regulator and a set of daughter card connectors to add additional shields. They used offset top and bottom connectors rather than a single pass through so the card extends off one side.  I'd probably stack this board on top of any other s...

Installing Oracle Java and Tomcat on Ubuntu Server 12

Ubuntu Server comes with only a command line console so the usual GUI tools are unavailable.  You instead get to Java and Tomcat by hand. Oracle installations require the addition of another apt repository because they are license restricted from the Linux point of view. Install Java Enter the following commands into the VMWare visible console. Ubuntu server doesn't include add-apt-repository so first install that sudo apt-get install software-properties-common Enter "Y" if prompted. Add the repository that contains Oracle information sudo add-apt-repository ppa:webupd8team/java Press "Enter" to continue. Update the list of available packages sudo apt-get update Install Oracle 7 sudo apt-get install oracle-java7-installer Enter "Y" and click on "<OK>" to accept the license Verify Java is installed by running java -version You can set the JAVA_HOME for all processes by adding a adding a JAVA_HOME entry in /etc/environment. ...

Virtual Machine Networking: NAT or Bridged?

VMWare and other desktop or embedded hypervisors create virtual networks that the virtual machines connect to when running on the hosting software.  These virtual networks provide network connectivity from the guest machines through the host machine out to the general LAN/WAN.  There are two main modes. NAT:   The host puts the virtual machines on their own private network and acts as a network gateway for that virtual network.  Guest machines can communicate over the shared network and communicate to the WAN/Internet through the host machine.  Guest machines consume none of the physical network's address space because they are connected on the hosts "virtual network". Guest network interfaces can be configured using DHCP, provided by the host, or with fixed IP addresses to simulate a stable server environment.  Fixed IP addresses are handy when the virtual machines need to communicate with each other. VMWare typically uses the host network's VMnet8...

Setting the Size of the Terminal / Console Window in a Linux Server VM

We did a lot of Linux virtual machine installs when I worked with VMWare's SpringSource group. It let us run multi-node clusters off our MacBooks for customer demos.  We usually used desktop installes because they have you multi-terminal access to the machines.  I decided I wanted get some of my Linux/Java/OpenSource mojo back after 8 months on a Microsoft only project.  I downloaded Ubuntu 12.10 and installed server version so I could spin up more VMs on my Dell. The server install is thin and the Linux console defaults to 640x48 as displayed in the VMWare Player/Workstation.  It wasn't exactly obvious how to make that terminal window larger.  The desktop version of Ubuntu is sync'd with the VMWare window size through the VMWare tools.  That isn't true of the server version.  You have to do the following steps. These assume you have created and installed a new machine and are logged into the console window on the Virtual Machine. I did this with Ubu...

Demonstrating Gemfire Components Configured using spring-data

Image
Gemfire, and the applications that use it are made up of serveral components. There is the data caching tier itself that can exist as one or more data nodes. The data tier can be extended to provide database write-behind, write-through and on-demand read-through. The data tier can also be replicated to remote data clusters through the WAN gateway. WAN replication is not currently part of this example. There is also a client tier that can be pure client, client with local caching and notification client or a combination of the three. Client applications can consume data as they would a no-SQL store, database or they can register for data change notifications with the appropriate callback handlers. Gemfire relies on and makes use of other components including the Gemfire locator and JMXAgent. Gemfire clusters will almost always be be coordinated and linked through the use of Gemfire locator processes. JMXAgents add JMX bean access to a gemfire cluster for management and monit...

Spring.net configuration in App.config

I recently (10/2012) converted my TFS build monitor program to be Dependency Injected using the Spring.Net container. I did this because I wanted a no-code way of setting certain parameters and of specifying a build device management class without having to convert a configuration parameter into a class name. I instead injected the spring object with the same name as the configuration parameter using Spring.Net's built in facilities. Spring.Net is moving towards more annotation based configuration but the XML configuration is still widely used and powerful.  You can easily configure Spring.Net in XML with markup inserted into App.config.  The first thing to do is to tell the system that there are going to be some spring.Net sections added to app.config.  This defines two sections, contexts and objects.   context is the section that describes where to find other pieces.   objects  is the section that contains the actual object wiring.  Additional sect...

Simple log4net configuration in C# applications

Image
Log4net is the .Net cousin of the very popular Java based log4j logging package.  The simple to use package logs information to a variety of data sinks (appenders) with fine grain control over the amount of output generated by each logging source. log4net is available for download  from the Apache Software Foundation  and is part of the Apache Logging Project  which includes logging libraries for several languages. Log messages are generated by calls through named instances of the  ILog  interface. Each class that wants to log creates an instance of the ILog interface based on the class's fully qualified class name, including namespace.  This means each class has its own entry point into the logging system. In some sense each namespace has it's own common entry point by virtue of the fact that the ILog instances for that namespace all share the same base name/category-name. Callers pass a logging level and message along with an op...

Bending NuGet to Your Will by Manipulating the AppData Cache

Image
NuGet decides which versions of dependencies to pull in based a combination of the way dependencies are specified in the dependent packages and the packages that are available on your feeds.  NuGet drills down pulling all of a components direct dependencies and its indirect dependencies based on the nspec specifications of each pulled in component. This lets you pull in some  OSS component and then its dependencies down to bottom level which might be something like a Microsoft component. NuGet compares the versions specifications when resolving those to NuGet packages on a feed. Here are some example version specifications for the Microsoft MVC "4.0.20505.0"  MVC 4.0 RC or later "[4.0.20505.0]" MVC 4.0 RC only "[4.0.20505.0, 4.1] MVC 4.0 RC through any version of 4.1 "[4.0.20505.0, 4.0.20710.0) MVC 4.0 RC and all up to but not including MVC 4 RTM You can run into problem when new versions of dependencies appear on feeds and dependencies are inccor...

Why is the Installer is My Least Favorite Piece of the Microsoft Platform.

I worked on a project where we were contractually restricted to Microsoft products after years of using Java and Open Source tools.  Microsoft tooling is kind of interesting because you get a integrated environment where the MS teams have taken on the burden of implementation. It's not a confused jungle of choices where some big pieces integration are left to you.  The MS world moves at a pace driven by Microsoft itself, often faster than JCP driven Java.  OSS and Java either barely move or go really fast but in a whole bunch of different directions all at once.  Which is pretty, is  much a matter of personal taste. Microsoft and its tooling is installed and managed through GUI installers that bind the installed software/tool to the target machine. Its not like a directory is created and some stuff is registered.  Files are copied different places and system libraries can be updated or overwritten.  This installer and its implications has turned out ...