wxSpokePOV ported to Linux

SpokePOV kit for bikes

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
jsha
 
Posts: 14
Joined: Fri Jul 06, 2007 4:10 am

wxSpokePOV ported to Linux

Post by jsha »

Re-posting at top level to get more visibility:

I've made a patch porting wxSpokePOV to Linux. Any of you who would like to try this out should run:

cvs -z3 -d:pserver:[email protected]:/cvsroot/spokepov co wxsoft
cd wxsoft
wget http://newview.org/jsha/spokepov-linux-patch.txt
patch < spokepov-linux-patch.txt
less Makefile.linux
make -f Makefile.linux

Make sure to read the Makefile! It has comments in it on what libraries you need installed. In particular you are likely to need to compile your own version of wxGTK, since the version that comes with your distribution may be compiled with --enable-unicode, and wxSpokePOV needs a non-Unicode wxGTK.

Ladyada, if this works for you, any chance of integrating this into the mainline?

jsha
 
Posts: 14
Joined: Fri Jul 06, 2007 4:10 am

Post by jsha »

Any word on this? I never got a response. BTW, the patch file is now available at http://jacob.hoffman-andrews.com/spokep ... -patch.txt.

User avatar
bensch128
 
Posts: 9
Joined: Fri Aug 08, 2008 5:30 am

Problems using spokePOV on linux in usb mode

Post by bensch128 »

Hi,
I got the first spoke (and programmer) soldered together and hooked up to my linux machine. I'm trying to program it over usb but I'd hitting a communication error.

In communication.cpp line267

n = usb_control_msg( usb_handle,
USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
req, val, index, (char*) buf, buflen, timeout );

always returns -1 (yeah for debuggers!!)

Can anyone give me a hint about how to make sure communication is working correctly?

Thanks for the awesome project!
Ben

PS. a multicolor spokePov kit ala kayrock66's project would kick ass.
I'd buy that in a second.

User avatar
bensch128
 
Posts: 9
Joined: Fri Aug 08, 2008 5:30 am

Got it working

Post by bensch128 »

I forgot to use sudo when running the spokepov program... duh!

It works great. Now how can I make it multi-colored???

Thanks for the amazing kit,

It was so asy to throw together

EJ99
 

Re: wxSpokePOV ported to Linux

Post by EJ99 »

jsha, what great work to port it to Linux! :D

I just soldered the POV together and now i want to play with it.

Am i correct when i say that your port only supports the serial port? i read that on your site.
I guess not because bensch128 says he uses USB... what do you use bensch?

Thanks the hard work and the sharing.

EJ

Edit:

This is what i get when i want to compile:

spokepov.cpp: In member function ‘virtual bool SpokePOV_App::OnInit()’:
spokepov.cpp:52: error: cannot convert ‘const char*’ to ‘const wxChar*’ for argument ‘1’ to ‘void wxLogDebug(const wxChar*, ...)’
spokepov.cpp:56: error: conversion from ‘const char [11]’ to ‘const wxString’ is ambiguous
/usr/include/wx-2.6/wx/string.h:643: note: candidates are: wxString::wxString(wxChar, size_t) <near match>
/usr/include/wx-2.6/wx/string.h:633: note: wxString::wxString(int) <near match>
spokepov.cpp: In member function ‘bool SpokePOVFrame::LoadConfiguration()’:

and so on.

I set LD_LIBRARY_PATH to where i compiled wxWidgets.

any ideas?

User avatar
bensch128
 
Posts: 9
Joined: Fri Aug 08, 2008 5:30 am

Re: wxSpokePOV ported to Linux

Post by bensch128 »

Hi EJ,
You have to compile wxGTK WITHOUT unicode (--disable-unicode).
Then you need to set your first include path to point to where it's installed.
That should get rid of the compile errors.

Cheers
Ben

User avatar
bensch128
 
Posts: 9
Joined: Fri Aug 08, 2008 5:30 am

Re: wxSpokePOV ported to Linux

Post by bensch128 »

Oh and I used the USB connection without a problem.
I just had to run wxspokepov with sudo to use the usb device.

Use lsusb to figure out which device the cable is plugged into.

Cheers
Ben

EJ99
 

Re: wxSpokePOV ported to Linux

Post by EJ99 »

hi Ben,

thanks for your info!

I see now that my standard install of wxGTK is used, which is of course not correct because of the unicode.

However, when i want to compile and install wxGTK with the "--disable-gtk2 --disable-unicode --enable-monolithic" options (as stated in the Makefile), i cannot do a make install.

I get this error:

/usr/bin/install -c -d /usr/local/share/aclocal
(cd . ; /usr/bin/install -c -m 644 wxwin.m4 /usr/local/share/aclocal)
/usr/bin/install: cannot stat `wxwin.m4': No such file or directory
make: *** [install] Error 1

Annoying, since i can't seem to find any info on that error message. The wxwin.m4 file is sitting happily in the directory from which i did the compile.

The make process ends OK, only "make install" complains.

wx-config can't find the custom install and $LD_LIBRARY_PATH does not seem to work when i point it to the target directory.
I can see the libwx_gtk-2.8.so, libwx_gtk-2.8.so.0 and libwx_gtk-2.8.so.0.5.0 sitting right there.

Very strange.

Any ideas anyone?

User avatar
bensch128
 
Posts: 9
Joined: Fri Aug 08, 2008 5:30 am

Re: wxSpokePOV ported to Linux

Post by bensch128 »

EJ99 wrote:
I get this error:

/usr/bin/install -c -d /usr/local/share/aclocal
(cd . ; /usr/bin/install -c -m 644 wxwin.m4 /usr/local/share/aclocal)
/usr/bin/install: cannot stat `wxwin.m4': No such file or directory
make: *** [install] Error 1

Annoying, since i can't seem to find any info on that error message. The wxwin.m4 file is sitting happily in the directory from which i did the compile.
I bet you need to do "sudo make install". /usr/local not writable by the normal user.

EJ99
 

Re: wxSpokePOV ported to Linux

Post by EJ99 »

good call!

you are right, but the thing is i wanted to install wxGTK in a local dir. otherwise it would interfere with the standard wxGTK that packet-manager placed on my system.

in the case of installing into a local dir i get the wxwin.m4 problem. "make install" should not be necessary, if i could point to the local dir but that does not work.

i used an alternative install that i don't use much, i removed the standard system wxGTK, compiled my own version and now it almost works, only the "connect"-button does not want to show.

maybe i will create a LiveCD for SpokePOV when i get it all to work.

cheers,

EJ

EJ99
 

Re: wxSpokePOV ported to Linux

Post by EJ99 »

i'm very sorry to post this, but after hours of work the compile still is not correct.

the port needs some work in the Makefile.

when wxGTK is already installed there is no way to add a custom compile with the options set as mentioned in the Makefile.

now i have soldered everything together and it still does not work.

EJ99
 

Re: wxSpokePOV ported to Linux

Post by EJ99 »

fisrt off this:
I want to thank jsha for his excellent port, and Ben for his support, thanks!

And ladyada for this great project!

OK i finally got it to work on Debian.

This post is intended as a last resort, in case the normal install does not work.
I had to create this because wxGTK was already on my machine and i had to keep it clean, so i could not install another version of wxGTK with otjer compiler options next to it. They would clash.

For all you Ubuntu users, Debain almost never uses " sudo " so that's why i don't use that.

Here goes:

download the software and the patch like jsha said:

cvs -z3 -d:pserver:[email protected]:/cvsroot/spokepov co wxsoft
cd wxsoft
wget http://jacob.hoffman-andrews.com/spokep ... -patch.txt
patch < spokepov-linux-patch.txt

i needed to edit the Makefile.linux.
Copy it first:
cp Makefile.linux Makefile.linux-ori


GTK:

i installed wxGTK in /home/user/wxGTK/2.8.9. wxGTK was already installed on my system and i did not want another version to conflict.

i compiled it with
./configure --disable-gtk2 --disable-unicode --enable-monolithic --prefix=/home/user/wxGTK/2.8.9
make
make install

edit Makefile.linux:

i replaced 3 lines.

the original lines:
LDFLAGS_GUI = `wx-config --libs`
CPPFLAGS = `wx-config --cxxflags`
EXTRALIBS = `wx-config --libs` -lusb


the modified lines:
LDFLAGS_GUI = `/home/user/installs/wxGTK/2.8.9/bin/wx-config --libs`
CPPFLAGS = `/home/user/installs/wxGTK/2.8.9/bin/wx-config --cxxflags`
EXTRALIBS = /home/user/installs/wxGTK/2.8.9/lib


to make the spokePOV software do

make -f Makefile.linux

if you have to compile again, first do

make -f Makefile.linux distclean

it cleans up and allows you to recompile with everything reset, so compile will listen to changes you make.

to run your program do ./spokepov

i have to run spokePOV as root on my machine.

if it complains about not finding a wxGTK library, we have to make a small adjustment.

we need to do a dirty hack, but i cannot find another way to do it.

export LD_LIBRARY_PATH=/home/user/wxGTK/2.8.9/lib

now you can run spokepov.

edit: one more thing: i had to make the spokePOV-window bigger to see the "connect" button. maximizing the window helps too :)



EJ

User avatar
jason0x21
 
Posts: 2
Joined: Sat Dec 05, 2009 4:02 pm

Re: wxSpokePOV ported to Linux

Post by jason0x21 »

I seem to have gotten the instructions immediately above to work, however I can't seem to load a BMP into the program. Do I actually need to have a SpokePOV connected to try out the program and see if I've at least got bitmap file import working (that seems a little backwards)? I'd like to know that the program is sort of correct before plunking down my cash :-) Thanks.

Also, if you have to build wxWidgets from scratch to get around the unicode problem, add "--disable-shared" to the configure command, so that when you get around to building the spokePOV program it will statically link the wxWidgets library into the executable, and you won't have to fiddle with the whole LD_LIBRARY_PATH thing. Like this...

Code: Select all

./configure --disable-gtk2 --disable-unicode --disable-shared --enable-monolithic --prefix=/local/wxGTK/install/path
Last edited by jason0x21 on Sat Dec 05, 2009 4:27 pm, edited 1 time in total.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: wxSpokePOV ported to Linux

Post by adafruit »

yup it requires a spokepov connected. that said, hundreds of people have managed to get it working so it -does- work :)

User avatar
jason0x21
 
Posts: 2
Joined: Sat Dec 05, 2009 4:02 pm

Re: wxSpokePOV ported to Linux

Post by jason0x21 »

I can dig it. Being a Linux-only guy, I wanted to make sure I'd gotten as much working correctly as I could before making the next step (especially since the process is "apply this patch to the official software"). Thanks! SpokePOV now ordered!

Locked
Please be positive and constructive with your questions and comments.

Return to “SpokePOV (discontinued)”