Showing posts from March, 2014

Communicating with the Intel Galileo

Developers have confusing array of ways to communicate with the Intel Galileo embedded board.  This is partially because the board wants to look like an Arduino while at the same time letting developers make use of the much  larger hardware provided by the Intel platform.  There are probably 4 main areas for communication Programming the board with the IDE. Communication between the board and a host computer using the Arduino library. Administration  and monitoring of the board's embedded Linux operating system. Communicating between the board and other systems using network or other Linux level capabilities. This chart describes the main channels of communication.  The Arduino IDE and Arduino Serial device are mapped to the USB port. The USB port does not support any type of multi-channel composite device.  This means you can only communicate with the underlying Linux system if you build a custom serial port cable or connect via Ethernet.  The embedded Linux does not sta

Communicating with Ambient Orb via Serial Port

Pins on the back of ambient developer/ DIYSerialDeveloperBoard.html Powered by PIC 18f242 CPU with 16K bytes ROM and 768 bytes RAM. Physical Connection pin 1 is on the left looking at it from the back Pin 1 Vunreg - 11 volts DC from power transformer Pin2 MCLR - used to reset device for programming. Leave unconnected Pin 3 PGD - used for programming. Leave unconnected Pin 4 PGC - used for programming. Leave unconnected Pin 5 RS-232 RX (TTL level signal) Pin 6 RS-232 TX (TTL level signal) Pin 7 Ground RS-232 Parameters The serial port connects to the orb with the following fixed parameters: 19200 Baud 8 data bits no parity 1 stop bit no flow control Sample Script Install perl Install serial port library for perl with apt-get install libdevice-serialport-perl Download Change the tty port to match

Managing the Data Lifetime and Access Through Scoping

 Software developers think of the lifetime of data or objects within the confines of the language or frameworks they are using.  They need to think of data lifespan or scope as a first class component of design. Business and business process data is valid for some period of time.  It has a lifetime, scope, that may vary based on business rules, transaction time or some other function.  Technical or software transaction data is also scoped, valid for some period of time. This talk focuses on how these lifetimes can be more naturally integrated into a running software system. Lifespan Every business entity, attribute or property is valid for some period of time. It may be the lifespan of a project, a contract period , the length of time someone is a customer.   Transient copies of the data or newly created business entities may be valid for the life of some user session or only while some transaction operation is active.  This means applications often operate on dat

Adding a Bluetooth adapter to a Dell E6430

My Dell outlet site E6430 didn't come with a Bluetooth adapter or the cable to attach it.  Dell offers their 380 which supports bluetooth 4.0 LE.  You can go to EBay to purchase the parts.  The cable is kind of rare and surprisingly pricey. I have found in the past that the Dell parts department will often beat Ebay especially for slightly older or refurbished parts.  It has always worked out well for me.  Go to their parts website and start a chat session with a Dell representative.  They can sell you parts that do not show up on parts / accessories site.  Dell used to have a lot of interesting parts on their web site.  They seem to have pulled a lot of that off the public facing site so you're best bet is to use a chat session or call the toll free number.  My total cost was $24.35.  You need the following to do an upgrade: Dell 380 Bluetooth Adapter part number 3YX8R .  It cost me $9.99. Dell E6430 Bluetooth cable part number 1RNW1 . It cost me $4.99 A screwdriver Some

A quick jni4net performance hack

jni4net is a great library that creates Java proxies for Microsoft based C# libraries on the Windows platform. It makes Java JNI easy with good performance.  You follow this processes to use jni4net Create your C# library Run proxygen to generate Java native library source code and C# adapter source that shims in between Java and the original library. Run javac to compile the java code Create a jar file of the compiled java code Run the .Net csc.exe that comes with the default .Net installation to compile the C# code Create a new DLL of the just compiled C# code Create a Java program that uses the new generated Jar file, the generated C# dll and the original C# dll. I found a quick hack that improves the performance of the jni4net bridge that involves inserting a line of code in each generate C# method. This hack improves the Java-to-DLL call time only.  It does not impact the performance of the Java code on one side or the C# code on the other.  It lowers the overhead of

Java API Wrapper for Windows Performance Counters

Now its time for a quick overview of the Java wrapper API for the Windows Performance Counters. Lifecycle  System Preparation  Library Initialization Counter Caching  Key Retrieval  Counter Usage Time Based Operations Related Posts Lifecycle The lifecycle for these counters is pretty straightforward: System Preparation: creation of counters in the Windows OS. Library Initialization: loading and initializing the library inside your running program Counter caching an optional step that warms up the counter library Key retrieval for any counter you use Counter usage including the API System Preparation You must create any custom counters as Administrator before running any program that uses the Performance Counter system. The simplest way to do this is in a Powershell script because Powershell is available on all modern Windows operating systems.  The following sample script creates a new Category " Freemansoft.JavaTestCategory" and two simple counters

Recording Java Metrics with the Windows Performance Counters

Example Java Code  Library Performance  Library and Source Code Classspath  CreatingCountersWindowsOperatingSystem  Repository Organization Related Posts Java provides good monitoring through the MBean interface and monitoring tooling. It is nice because it works the same no matter what platform you run on.  There are times when you want to plug into the native performance recording tools especially when running on Windows machines because this makes it easy to integrate your Java application with your Windows based operational consoles. A Java test program generates 2,000,000 performance counter events per second in a single thread and up to 6,500,000 updates per second multi-threaded. (source available on github) This means that counter updates can be made at normal volumes with very little effect on the system. I've created a simple C# library and Java / JNI wrapper that lets you record native Microsoft Windows Performance Counters directly from your Java code.   Th

Windows Performance Counters

Microsoft Windows has a mechanism for recording performance metrics from running applications using the Windows Performance Counters.  This is a high speed system that can be used to gather counts, rats, averages or other numbers based on raw counts or ratios like items/second.  You can see these counters using the perfmon  application.  This system has low overhead and is capable of a high rate of capture. I measured 10 million messages / second  using 4 threads on a 2011 Macbook Pro.  Performance Counters are generated/updated by major system modules and can be extended to include your own modules. Windows 8 comes with over 29,000 standard counters. You can see them by running the typeperf.exe -qx > counterlist.txt.   You can see the Performance counters in action using perfmon. This screen shot shows the  perfmon  application monitoring a cpu performance counter and a custom test performance counter generated by this  c# library I've put up on github .  The  ROCPS64  cou