Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: arduino svn compile bug on: February 04, 2008, 06:27:42 pm
Quote
BTW, if you compile the Arduino version of avrdude, you shouldn't need to actually build the Arduino distribution - just replace the RXTX with a 64 bit version.  (Most of the code is Java, so it should run fine on 64-bit systems.)

Cool smiley

It would be awesome if the dev's could throw together an ebuild for this and get it in portage  8-)
2  Forum 2005-2010 (read only) / Bugs & Suggestions / Directions for getting Arduino working Gentoo-64 on: February 04, 2008, 06:20:36 pm
First, follow the Arduino on Gentoo guide. Down to the part where it tells you to download and un-tar the arduino software archive.  We are going to take it from there.
First checkout the latest version
svn checkout http://arduino-svn-repo/trunk/latest/ /path/to/where/u/want/arduino-svn

Now we need to recompile some lib's of our own.

Start by compiling rxtx and avrdude for your system
You'll need to add dev-embedded/uisp and dev-embedded/avrdude to your /etc/portage/package.keywords since they are keyword masked for some arches (namely amd64)
#emerge -vp rxtx avrdude
and if your happy
#emerge -v rxtx avrdude

Now we need to hook those into the arduino build.
So as root
#updatedb

Now locate librxtxSerial.so and the avrdude binary file.
locate librxtxSerial.so
locate avrdude
Note those path's.

Now either copy or symlink those files into the build system
$ln -s /local/path/librxtxSerial.so /path/to/arduino-svn/build/linux/dist/lib/librxtxSerial.so
$ln -s /local/path/to/avrdude to /path/to/arduino-svn/build/linux/dist/tools/avrdude

Lastly we need to edit the file
nano /path/to/arduino-svn/app/AvrdudeUploader.java
and before the line
"commandDownloader.addAll(params);" [which for me appears at line 152]
add
//add a -F flag
commandDownloader.add("-F");
What this does is force the uploader to go even though the device signature won't be correct.  Arduino provides a patched version of avrdude so you dont need to do this (safer) but this would require downloading and compiling that separately and I prefer to use portage for everything since that is the reason i use gentoo in the first place.

Build Time!
Now cd /path/to/arduino-svn/build/linux/. and clear the work directory out if anything is there rm -rf work.
Now build it ./make.sh

Now cd work
And we need to add the ldscripts reference, which is mentioned in the gentoo guide (but we didn't do since it was past the cut off point smiley)
Your version of avr-binutils MAY be something other than 2.18, most likely it'll be the only entry in there so you can just tab complete it.
ln -s /usr/lib64(NOTE THE 64 HERE)/binutils/avr/2.18/ldscripts/ /path/to/arduino-svn/build/linux/work/ldscripts

now if you aren't already there
cd /path/to/arduino-svn/build/linux/work/.

and you should be able to ./arduino and it should work.

 Now you need to go back to the Arduino Gentoo guide and finish getting the hardware setup in the kernel.  Pick backup where it says
"The next step is to get the USB to serial adapter working. "
and follow it the rest of the way from there.


Happy Gentoo'ing! smiley
JM
3  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: arduino svn compile bug on: February 04, 2008, 06:06:46 pm
K. Got it working

I edited app/AvrdudeUploader.java and added in the last function right before the commandDownloader.addAll
commandDownloader.Add("-F");

Now this will force uploading even for an improper ident which I would imagine could do bad things if you don't have the proper board hooked up.

The preference saving issues went away once I changed that.... very weird..... but good smiley

I will write up another post that can be appended to the gentoo guide.
4  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: arduino svn compile bug on: February 04, 2008, 02:48:57 pm
I'm getting very close!

So im summary to get this built and running on a 64-bit gentoo system do the following

Build your own version of RXTX.
then either symlink or cp your local version of librxtxSerial.so to /path/to/arduino-svn/build/linux/dist/lib
#updatedb
#locate librxtxSerial.so
$cp /local/path/librxtxSerial.so /arduino-svn/build/linux/dist/lib/.

Then deal with AVRDUDE, which will take care of 64 bit libusb issues.
so compile avrdude for your own system.

then locate your avrdude binary path locally
then cp /local/avrdude to arduino-svn/build/linux/dist/tools/.


now go to /arduino-sv/build/linux/ and rm -rf work, then ./make.sh

NOW we have to symlink the ldscripts libray
cd into work
ln -s /usr/lib64(NOTE THE 64HERE)/binutils/2.18/ldscripts/

now ./arduino and it'll run.

Things I still need to figure out.

BUG I NEED HELP WITH:
When uploading firmware I get that the device signature doesn't match.  This is because arduino uses another method of determining this with a patch source which I could've used to compile avrdude locally.  I chose portage since that'll keep it up to date and line with gentoo config's.....
That being said, I can also add the "-F" flag to ignore this.  Now, where in the arduino-gui source do I add that flag?  Where is that command actually called from?   This way I can use the button on the GUI.

2. My sketchbook directory is NOT saved upon exiting the program.

JM
5  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: arduino svn compile bug on: February 04, 2008, 11:51:59 am
ahh ok.

So i will delete the rxtx that comes with it and replace it with the one found locally on my system after compile, THEN compile arduino.

thanks!
6  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: arduino svn compile bug on: February 03, 2008, 10:19:46 pm
I get
$ ./run.sh

(<unknown>:1321): Gtk-WARNING **: Attempting to add a widget with type GtkButton to a GtkComboBoxEntry (need an instance of GtkEntry or of a subclass)

(<unknown>:1321): Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(<unknown>:1321): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1321): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1321): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1321): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
      at java.lang.Runtime.loadLibrary0(Runtime.java:823)
      at java.lang.System.loadLibrary(System.java:1030)
      at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
      at processing.app.Editor.populateSerialMenu(Editor.java:903)
      at processing.app.Editor.buildToolsMenu(Editor.java:800)
      at processing.app.Editor.<init>(Editor.java:190)
      at processing.app.Base.<init>(Base.java:149)
      at processing.app.Base.main(Base.java:104)


The GTK errors occur while loading the dialog that asks me to pick my sketch directory.

After I do that, and press ok, nothing comes up and the error about the linker comes up smiley-sad

It should be noted that this is after I deleted librxtxSerial.so.

If svn-update which restores the file, rm -rf work and then rebuild it and re-run it i get another error

$ ./run.sh

(<unknown>:1492): Gtk-WARNING **: Attempting to add a widget with type GtkButton to a GtkComboBoxEntry (need an instance of GtkEntry or of a subclass)

(<unknown>:1492): Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:1492): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed
java.lang.UnsatisfiedLinkError: /home/jm/arduino-svn/build/linux/work/lib/librxtxSerial.so: /home/jm/arduino-svn/build/linux/work/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch) thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/jm/arduino-svn/build/linux/work/lib/librxtxSerial.so: /home/jm/arduino-svn/build/linux/work/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
      at java.lang.ClassLoader$NativeLibrary.load(Native Method)
      at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
      at java.lang.Runtime.loadLibrary0(Runtime.java:823)
      at java.lang.System.loadLibrary(System.java:1030)
      at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
      at processing.app.Editor.populateSerialMenu(Editor.java:903)
      at processing.app.Editor.buildToolsMenu(Editor.java:800)
      at processing.app.Editor.<init>(Editor.java:190)
      at processing.app.Base.<init>(Base.java:149)
      at processing.app.Base.main(Base.java:104)
7  Forum 2005-2010 (read only) / Bugs & Suggestions / arduino svn compile bug on: February 03, 2008, 08:14:10 pm
When attempting to compile on 64 gentoo with the lastest of all deps built locally I get errors from the make.sh script.  It errors due to deprecation issues.  It advises to add -Xlint:deprecation to the build command

editing the make.sh to add that i get the following

 ~/arduino-svn/build/linux $ sudo ./make.sh
Copying shared and core files...
Copying examples...
Copying dist files...
Building the PDE...
tools/DiscourseFormat.java:6: warning: unmappable character for encoding ASCII
  Copyright (c) 2005-06 Ignacio Manuel Gonz?lez Moreta
                                           ^
../core/PGraphics.java:2296: warning: [deprecation] getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
          Toolkit.getDefaultToolkit().getFontMetrics(textFontNative);
                                     ^
tools/Archiver.java:105: warning: [deprecation] show() in java.awt.Dialog has been deprecated
    fd.show();
      ^
Editor.java:1083: warning: [deprecation] show() in java.awt.Window has been deprecated
          find.show();
              ^
Editor.java:1235: warning: [deprecation] show() in java.awt.Window has been deprecated
    window.show();
          ^
Editor.java:1640: warning: [deprecation] show() in java.awt.Dialog has been deprecated
        dialog.show();
              ^
Sketch.java:816: warning: [deprecation] show() in java.awt.Dialog has been deprecated
    fd.show();
      ^
Sketch.java:954: warning: [deprecation] show() in java.awt.Dialog has been deprecated
    fd.show();
      ^
syntax/JEditTextArea.java:164: warning: [deprecation] isManagingFocus() in javax.swing.JComponent has been deprecated
  public final boolean isManagingFocus()
                       ^
Sketchbook.java:179: warning: [deprecation] show() in java.awt.Dialog has been deprecated
      fd.show();
        ^
Sketchbook.java:328: warning: [deprecation] show() in java.awt.Dialog has been deprecated
    fd.show();
      ^
FindReplace.java:228: warning: [deprecation] hide() in java.awt.Window has been deprecated
    hide();
    ^
syntax/TextAreaPainter.java:77: warning: [deprecation] isManagingFocus() in javax.swing.JComponent has been deprecated
  public final boolean isManagingFocus()
                       ^
syntax/TextAreaPainter.java:360: warning: [deprecation] getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
    fm = Toolkit.getDefaultToolkit().getFontMetrics(font);
                                    ^
syntax/SyntaxStyle.java:102: warning: [deprecation] getFontMetrics(java.awt.Font) in java.awt.Toolkit has been deprecated
    fontMetrics = Toolkit.getDefaultToolkit().getFontMetrics(
                                             ^
Base.java:158: warning: [deprecation] show() in java.awt.Window has been deprecated
    editor.show();
          ^
Base.java:545: warning: [deprecation] show() in java.awt.Dialog has been deprecated
      fd.show();
        ^
Preferences.java:547: warning: [deprecation] show() in java.awt.Window has been deprecated
    dialog.show();
          ^
RunnerClassLoader.java:89: warning: [deprecation] toURL() in java.io.File has been deprecated
        return searchResource.toURL();
                             ^
19 warnings

Done.

I would've filed it on a bug tracker but i couldn't find one.
8  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: arduino startup bug on: February 02, 2008, 02:03:12 pm
Quote
Are you on a 64-bit version of Linux?  If so, you'll need to install RXTX yourself.  
Yes I am on 64 bit. smiley

RXTX has  been compiled from source using portage.

$ sudo emerge -vp rxtx
Password:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] dev-java/rxtx-2.1.7.2-r2  USE="-doc -lfd -source" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB


Do i need to use the -source flag?  Does it have binary components or something?
9  Forum 2005-2010 (read only) / Bugs & Suggestions / arduino startup bug on: February 02, 2008, 12:43:40 am
After following the Arduino on gentoo guide to the t, on ./arduio i get

java.lang.UnsatisfiedLinkError: /home/jm/arduino-tar/lib/librxtxSerial.so: /home/jm/arduino-tar/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch) thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/jm/arduino-tar/lib/librxtxSerial.so: /home/jm/arduino-tar/lib/librxtxSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1030)
        at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
        at processing.app.Editor.populateSerialMenu(Editor.java:903)
        at processing.app.Editor.buildToolsMenu(Editor.java:800)
        at processing.app.Editor.<init>(Editor.java:190)
        at processing.app.Base.<init>(Base.java:149)
        at processing.app.Base.main(Base.java:104)

thoughts?

I've also tried the export command used in the generic linux guide.

if i try and build from svn i get
jmf-new-desk linux # export CLASSPATH=/opt/blackdown-jre-1.4.2.03/bin:/opt/blackdown-jre-1.4.2.03/lib/rt.jar
jmf-new-desk linux # ./make.sh
Copying shared and core files...
Copying examples...
Copying dist files...
Building the PDE...
tools/DiscourseFormat.java:6: warning: unmappable character for encoding ASCII
  Copyright (c) 2005-06 Ignacio Manuel Gonz?lez Moreta
                                           ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 warning

Done.

and thats the same whether or not the export line is there.
10  Forum 2005-2010 (read only) / Syntax & Programs / atmel 168 timer and prescaler question on: February 06, 2008, 02:25:25 am
So I've setup an ISR using Timer 1.

What I can't seem to get is right is the physical amount of time per count.

I've tried all sorts of prescalers, using the CS10,11, and 12 bits.

Those are divisions of the I/O-clk, and i can't find anywhere for the atmel 168 what that clock is.

I've setup CTC, but it still seems that I need to reset TNT1 = 1 and OCR1A = num_max_counts after every ISR loop or the behavior is different

I'm setting my TMR1A = 0x00 and my TMR1B = (1 << CS10)  [or 11 or 12 as i play with prescalers]

Any help here or example scripts would be appreciated that show for a given timer setup exactly how much time passes for each count.  I'm doing some numerical integration and its vital i get this.


FWIW i'm taking care of the analogRead outside the interrupt, and my main loop() function has no delay statements.  I am running a serial connection at 9600 baud.


Thanks!
JM
11  Forum 2005-2010 (read only) / Development / Re: self stabilizing platform on: March 14, 2008, 11:02:46 pm
Quote
John,

A friend of a friend back at the University actually used an Arduino + accelerometer and attached them to a remote control tank.  He could throw the tank a few meters at a time, and the vehicle would automatically find its way back to its original position.  I have the video if anyone is interested.

I would love to see the video.... and the code  ;D if possible.
12  Forum 2005-2010 (read only) / Development / self stabilizing platform on: March 12, 2008, 11:01:53 am
Has anyone endeavored to do this before?  I was thinking of something mechanically simple like a base board with three servos mounted  @ 120 from each other then attach another board at the three points to each servo arm.  Then if you picked up the base and tilted it the upper board would attempt to remain coplanar with the ground. (obviously within a range of motion limited by the servo arms).  Some rate gyros and an accel or two should do the trick for sensing

After you go the software you could get creative with the servo mounting and in theory create a hollow sphere with the platform inside and you could rotate all 360 yada yada... but thats to much for now.

cheers!
jm
Pages: [1]