Skip to content →

Category: Miscellaneous

Port already in use issue of Arduino for Eclipse plugin

When uploading with avrdude the plugin give a error prompt saying “Port already in use” (while no other application is using the port). After clicking OK it actually uploads the program to Arduino board.

port_in_use

After reading issue #6 I check the librxtxSerial.jnilib in eclipse:

.cp$ file librxtxSerial.jnilib
librxtxSerial.jnilib: Mach-O universal binary with 4 architectures
librxtxSerial.jnilib (for architecture x86_64): Mach-O 64-bit bundle x86_64
librxtxSerial.jnilib (for architecture i386): Mach-O bundle i386
librxtxSerial.jnilib (for architecture ppc7400): Mach-O bundle ppc
librxtxSerial.jnilib (for architecture ppc64): Mach-O 64-bit bundle ppc64

While in my Arduino application the librxtxSerial.jnilib output is:

llibrxtxSerial.jnilib: Mach-O universal binary with 2 architectures
librxtxSerial.jnilib (for architecture i386): Mach-O bundle i386
librxtxSerial.jnilib (for architecture ppc): Mach-O bundle ppc

So I just copied the Arduino.app//Contents/Resources/Java/librxtxSerial.jnilib file to eclipse/configuration/org.eclipse.osgi/bundles/419/1/.cp/librxtxSerial.jnilib It works after restarting eclipse. No error prompts are shown.

Leave a Comment

iCal crashes with iCal Reply Checker uninstalled

My iCal crashes everytime when someone sends me an invitation and I try either to accapt or decline it. After some investigation I found out it is the problem with “iCal Reply Checker” at http://www.nhoj.co.uk/icalreplychecker

After unstalled this app, it resets the Mail.scpt file to an empty file. To solve the problem: get another copy of Mail.scpt from another Mac, preferably from the same OS X version; and put it inside the folder: /Applications/iCal.app/Contents/Resources/Scripts

Lesson learnt: take care when trying amature software.

9 Comments

Bug in Waspmote API v0.15

I found a bug in Waspmote API v0.15 when I was trying to set XBee link keys. The API failed to set the key as specified in the code. The bug lies in function gen_data()” in lines 4355-4403. Details below. However, it was corrected in v0.18.

/*
 Function: Generates the API frame to send to the XBee module
 Parameters:
 	data : The string that contains part ofthe API frame
 	param : The param to set
 Returns: Nothing
 Values: Stores in 'command' variable the API frame to send to the XBee module
*/
void WaspXBeeCore::gen_data(const char* data, uint8_t* param)
{
	uint8_t inc=0;
	uint8_t inc2=0;
		
	clearCommand();
	it=0;
	while(data[it] != '\0') {
		inc++;
		it++;
	}
	inc/=2;
	
	while(inc211) 
	{
		for(it=0;it<8;it++)
		{
			command[inc-9+it]=param[it];
		}
	}
	else if(inc==11)
	{
		for(it=0;it<3;it++)
		{
			command[inc-4+it]=param[it];
		}
	}
	else if(inc==10)
	{
		for(it=0;it<2;it++)
		{
			command[inc-3+it]=param[it];
		}
	}
	else command[inc-2]=param[0];
}

The function in v0.18 is as follows:

/*
 Function: Generates the API frame to send to the XBee module
 Parameters:
 	data : The string that contains part of the API frame
 	param : The param to set
 Returns: Nothing
 Values: Stores in 'command' variable the API frame to send to the XBee module
*/
void WaspXBeeCore::gen_data(const char* data, uint8_t* param)
{
    uint8_t    inc=0;
    uint8_t inc2=0;
		
    clearCommand();
    it=0;
    while(data[it] != '\0') {
        inc++;
        it++;
    }
    inc/=2;
	
    while(inc2

Leave a Comment

Generating UML diagram from Java source code

Sometimes we may need to generate UML diagrams from source codes. Here’s what I do for Java code: graphviz + ant + UMLGraph. Details below:

1. Install graphviz and ant, download UMLGraph from http://www.umlgraph.org/

2. Place UMLGraph.jar in your project, for example, under
lib/

3. Write or modify your ant script, for example:


   
   The specification for the Java-based umlgraph build processes.

 
   
   
   
   
   
   
   
 
   
       
       
       
       
       
       
  
 
   
       
           
               
               
                   
               
          
           
       
   
 
   
       
           
               
               
                
               
               
               
               
               
               
               
          
       
  
 

4. Run this ant script.

ant javadocs

5. You will get the UML class diagram as expected in the generated Java docs. Here’s one example (click to enlarge):

com.andryy.hccdroid

Leave a Comment