Building Firmata test on ARM Linux

Status
Not open for further replies.

TheCageybee

New member
I'm trying to build the firmata test app on ARM linux (Ubuntu not Android).

I downloaded the tar ball at http://www.pjrc.com/teensy/firmata_test/firmata_test.tar.gz and untared.

It fails on make though.

Code:
/bin/sh: 1: /home/miniand/wxwidgets/2.8.10.gtk2.teensy/bin/wx-config: not found
/bin/sh: 1: /home/miniand/wxwidgets/2.8.10.gtk2.teensy/bin/wx-config: not found
firmata_test.cpp:23:23: fatal error: wx/wxprec.h: No such file or directory
compilation terminated.
serial.cpp:18:19: fatal error: wx/wx.h: No such file or directory
compilation terminated.
make: *** [serial.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [firmata_test.o] Error 1
miniand@miniand:~/firmata_test$

It appears some of the files are missing from the tar ball.
Any idea where I can get them?
Or is it something else?

Cheers
The Cageybee
 
You probably don't have the appropriate devel packages installed (<foo>-devel packages are needed to do development, and typically include header files and libraries). On my Fedora system, it looks like there were in wxPython-devel. On fedora, I would use yum to install packages. I believe on ubuntu, you use apt-get.
 
You need to also compile wxWidgets 2.8.10. Later versions might work too, but if you grab 2.8.10 you'll be using the same version I used when I wrote firmata_test.

After you extract wxWidgets, use these commands:

Code:
export CXXFLAGS="-ffunction-sections -fdata-sections -Os"
export LDFLAGS="-Wl,--gc-sections"
./configure --prefix=/home/paul/wxwidgets/2.8.10.gtk2.teensy --enable-optimise --disable-shared --disable-unicode --enable-no_exceptions --without-libtiff -without-libjpeg --disable-compat26 --with-libpng --without-gnomeprint --without-gnomevfs --disable-printarch

Then just run "make" and go get a cup of coffee. Or if it's a slow ARM board like Raspberry Pi, come back several hours later.

When it's done compiling, you should have a bin/wx-config program within that wxWidgets directory. Put that full pathname into the firmata_test makefile.

Once the makefile can run xw-config, the error "/bin/sh: 1: /home/miniand/wxwidgets/2.8.10.gtk2.teensy/bin/wx-config: not found" will go away, and (hopefully) wx-config will provide everything needed to solve all the other errors.
 
Normally, Michael's advise would be right on.

But in this case, the Ubuntu packages will almost certainly be compiled with --enable-unicode, which (probably) doesn't work with firmata_test. You *must* download a copy of the wxWidgets 2.8.10 source, use that configure command, and then compile firmata_test with the pathname of the xw-config inside a properly built copy of the library.
 
Thanks for the quick response.

I'd installed wxwidgets from synaptic and just needed to change the path.

you should have a bin/wx-config program within that wxWidgets directory. Put that full pathname into the firmata_test makefile.

It's getting further now but unfortunately getting lots of errors now and fails I suspect because as Paul points out, wxwidgets is built with unicode.

serial.cpp:807:13: error: conversion from ‘char [512]’ to ‘const wxString’ is ambiguous
serial.cpp:753:7: note: candidates are:
/usr/include/wx-2.8/wx/string.h:692:3: note: wxString::wxString(wxChar, size_t) <near match>
/usr/include/wx-2.8/wx/string.h:692:3: note: no known conversion for argument 1 from ‘char [512]’ to ‘wxChar {aka wchar_t}’
/usr/include/wx-2.8/wx/string.h:682:3: note: wxString::wxString(int) <near match>
/usr/include/wx-2.8/wx/string.h:682:3: note: no known conversion for argument 1 from ‘char [512]’ to ‘int’
/usr/include/wx-2.8/wx/arrstr.h:186:10: error: initializing argument 1 of ‘size_t wxArrayString::Add(const wxString&, size_t)’
make: *** [firmata_test.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [serial.o] Error 1

Still, thanks for your help guys.

The Cageybee
 
You really must compile wxWidgets from source, using those configure options I posted in reply #3. It's really not that hard, just get the source code, run those commands, and in 10 min to a couple hours (depending on the CPU speed and memory), it'll be done compiling.
 
Status
Not open for further replies.
Back
Top