|
 |
|
02-16-2009, 05:50 PM
|
#1
|
|
North of the land of Hey Huns
Join Date: Jun 2004
Location: Westminster, MD
Posts: 1,037
|
Fusion Brain program for Linux
Here is a library I have written to allow Fusion Brain V4 access in Linux. I have not added support for previous versions, however I will soon. This library depends on libusb-0.1 which can be installed through most distros' package management utility. (yum install libusb-devel on fedora, or apt-get install libusb-dev on debian). The ./FB program included in this package was compiled on ubuntu, so it may or may not work on other distros of linux. The source code is also included so people who cannot run the program can attempt to compile it themselves
You will need libqt4-dev (on ubuntu) to compile this program, and then it is just a matter of "qmake && make" to compile it.
Edit 2/28/2009: Update attached, gui program by Qt. You will need libqt4-dev to compile it, and then just run 'qmake && make' to compile. I have attached an executable, but I don't know how well that will work. I have removed the command line app, that didn't seem to get any interest.
Last edited by malcom2073; 03-28-2009 at 11:14 AM.
|
|
|
|
|
|
Advertisement
|
Sponsored links
|
02-17-2009, 12:07 AM
|
#2
|
|
Fusion Brain Creator
Join Date: Mar 2006
Location: Colorado, but Canadian!
Posts: 8,862
|
FB_Coolness++;
|
|
|
02-21-2009, 11:09 PM
|
#3
|
|
Super Moderator & Wal-Mart Greeter
Join Date: Sep 2003
Location: New Mexico, USA
Posts: 3,391
|
So where is this program?
__________________
Tidder
Try RevFE
The best frontend I've ever used, period.
Best Quote EVER!!
Quote: Originally Posted by bramlet 
I try to search but I usually only find posts where people ask questions and darquepervert tells them to search.
|
|
|
02-21-2009, 11:10 PM
|
#4
|
|
North of the land of Hey Huns
Join Date: Jun 2004
Location: Westminster, MD
Posts: 1,037
|
Uh, it WAS linked..... wait a few
Edit: Main post has the link now. 'bout time someone mentioned I forgot something!
Last edited by malcom2073; 02-21-2009 at 11:14 PM.
|
|
|
02-22-2009, 05:35 PM
|
#5
|
|
Newbie
Join Date: Mar 2008
Posts: 3
|
Hey malcom its good too see you have already made progress on this, ill download it soon and test it out.
-kdog
|
|
|
03-03-2009, 11:16 PM
|
#6
|
|
Newbie
Join Date: Aug 2008
Posts: 3
|
Quote: Originally Posted by malcom2073 
Here is a library I have written to allow Fusion Brain V4 access in Linux. I have not added support for previous versions, however I will soon. This library depends on libusb which can be installed through most distros' package management utility. (yum install libusb-devel on fedora, or apt-get install libusb-dev on debian). The ./main program included in this package was compiled in ubuntu, so it may or may not work on other distros of linux. The source code is also included so people who cannot run the program can attempt to compile it themselves
Command line for compiling on ubuntu:
g++ main.cpp fblib.cpp -o main `pkg-config libusb --libs --cflags`
If you run the program from the command line with no arguments, it will print out a list of examples for how to use the program. Currently only the ability to turn digital outputs on and off, and read analog input is supported. I am working on supporting more, such as timers and pwm. If anyone who has a fusion brain and knows how to run linux, can you please test this out? I am working on a GUI interface that can either be picked apart, or embedded into Linux frontends. Nghost will soon have plugin support for the Fusion Brain as well via this library.
Edit: I never even noticed the error message saying it didn't upload. Why didn't someone mention something! arg!
http://www.mp3car.com/vbulletin/atta...ains-fblib.tar
Is it possible for you to write a comedi driver for this device? http://www.comedi.org/
This hardware looks like it would be perfect for some small robotics projects. http://www.orocos.org/
|
|
|
03-06-2009, 05:46 PM
|
#7
|
|
North of the land of Hey Huns
Join Date: Jun 2004
Location: Westminster, MD
Posts: 1,037
|
Quote: Originally Posted by nsaspook 
I'm sure its quite possible to adapt it to that, but that's not really useful for most carpc applications which is what this was intended for. You can feel free to use the code and adapt it to comedi (under GPL of course)
I've edited the original post due to the fact that I rewrote the library to use libusb0.1 rather than libusb1.0. Most distros have a 0.1 binary package, making it much easier for people to compile
Last edited by malcom2073; 03-06-2009 at 05:51 PM.
|
|
|
03-06-2009, 06:06 PM
|
#8
|
|
Fusion Brain Creator
Join Date: Mar 2005
Posts: 2,197
|
haha I work with comedi and orocos on a daily basis
would be sweet to set this up!
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
03-06-2009, 08:49 PM
|
#9
|
|
Newbie
Join Date: Aug 2008
Posts: 3
|
Quote: Originally Posted by malcom2073 
I'm sure its quite possible to adapt it to that, but that's not really useful for most carpc applications which is what this was intended for. You can feel free to use the code and adapt it to comedi (under GPL of course)
I've edited the original post due to the fact that I rewrote the library to use libusb0.1 rather than libusb1.0. Most distros have a 0.1 binary package, making it much easier for people to compile
I could do it using your code as a example. It looks like the register level bits are defined clearly. I've coded a pcmcia card in the comedi driver lib already and this device is pretty simple. I guess I'll have to buy a few cards for work as product examples and use one to test code with.
PS. I work for Microchip at the fab in Oregon. We make a lot of PIC18F wafers.

insert:
Quote:
The "I work for a big public company" disclaimer:
The views expressed on these pages are mine alone and not those of my employer. I am not now, nor have I ever been employed to speak for anyone.
|
|
|
03-07-2009, 09:41 PM
|
#10
|
|
Fusion Brain Creator
Join Date: Mar 2005
Posts: 2,197
|
Quote: Originally Posted by nsaspook 
I could do it using your code as a example. It looks like the register level bits are defined clearly. I've coded a pcmcia card in the comedi driver lib already and this device is pretty simple. I guess I'll have to buy a few cards for work as product examples and use one to test code with.
PS. I work for Microchip at the fab in Oregon. We make a lot of PIC18F wafers.

insert:
We could certainly set you up. Email us at fusioncontrolcentre@gmail.com
|
|
|
05-17-2009, 05:33 AM
|
#11
|
|
Newbie
Join Date: Dec 2008
Posts: 23
|
Nice work getting this far!
Can you please post up the command line app & source?
osx has libusb 0.1.12 and I'd like to have a go at compiling under Darwin.
Thanks.
|
|
|
05-21-2009, 01:52 AM
|
#12
|
|
licensed to kill
Join Date: Aug 2006
Location: Deep in the Rockies... coding in caves
Posts: 1,038
|
FusionBrain Daemon
Using malcom2073's lib, I created a simple daemon that exposes a DBus interface to the fusion brain.
This should (IMHO), be used in place of direct access to the library for most applications. DBus's IPC allows you to code in any language that has DBus bindings: Python, C++, C, C#, Java, Ruby, etc, etc, etc rather than just pure C++ which is what the library is written in.
This is developed for the OpenICE platform under the GPL license.
To install, run qmake, make. Copy FusionBrain.conf to /etc/dbus-1/system.d/. Run as root.
See fbddbus.xml for information on the DBus methods and signals available.
Have fun!
fbd.tar.gz
__________________
LinuxICE - because my car already has enough windows (and because I like speed).
LinuxICE2 beta2 is released!!! get it now!
Follow OpenICE development
|
|
|
05-21-2009, 04:21 AM
|
#13
|
|
Variable Bitrate
Join Date: Mar 2009
Location: Kristiansand, Norway
Posts: 284
|
I do not have Fusion Brain, but still... SWEEEEEEEEETES!
|
|
|
06-02-2009, 01:18 AM
|
#14
|
|
Constant Bitrate
Join Date: Aug 2007
Location: Northern VA
Posts: 125
|
Fantastic work guys!
As soon as I learned about the Fusion Brain I ordered one and it arrived today. I couldn't resist giving it a whirl so I downloaded/built Malcom's FB package and giggled like a little schoolgirl as I toggled LEDs
I then downloaded/built Kev's fbd and ran it per the instructions above. I know next to nothing about dbus so figured a quick commandline test was a good start, but I ran into problems. It's past my bedtime (I'm getting old) so I figured I'd ask in case there was a quick answer. Using dbus-send, I'm not sure how to toggle one of the digital outputs. I have #1 turned on right now so I tried to turn it off with
cgalpin@jaunty:~/fbd$ dbus-send --session --print-reply --dest="org.openice.fbd" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int16:1 boolean:false
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.openice.fbd was not provided by any .service files
cgalpin@jaunty:~/fbd$ dbus-send --session --print-reply --dest="org.openice.fbd.fusionbrain" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int16:1 boolean:false
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.openice.fbd.fusionbrain was not provided by any .service files
As you can see, it doesn't seem to understand the destinations. Any ideas? I tried a few other things and perhaps made progress with
cgalpin@jaunty:~/fbd$ dbus-send --system --print-reply --dest="org.openice.fbd" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int16:1 boolean:false
Error org.freedesktop.DBus.Error.UnknownMethod: No such method 'SetSingleOutput' in interface 'org.openice.fbd.fusionbrain' at object path '/org/openice/fbd' (signature 'nb')
Also, I first build FB using libusb-1.0-0 since it was newer, and other than a #include and a makefile tweak it built and ran fine. When I went to build fbd, there were a boatload of differences to both FB, but also the version of usb. I started making the changes from usb to libusb but then started finding functions that didn't seem to have libusb analogs and gave up and just installed libusb-0.1-4 and libusb-dev and it built fine unmodified. In a nutshell, what is the difference between these versions?
Anyway, just wanted to say thanks and I look forward to being able to get this working, and take some time to contribute myself.
charles
Last edited by cgalpin; 06-02-2009 at 01:26 AM.
Reason: show another dbus-send attempt
|
|
|
06-02-2009, 01:37 AM
|
#15
|
|
licensed to kill
Join Date: Aug 2006
Location: Deep in the Rockies... coding in caves
Posts: 1,038
|
Quote: Originally Posted by cgalpin 
Fantastic work guys!
As soon as I learned about the Fusion Brain I ordered one and it arrived today. I couldn't resist giving it a whirl so I downloaded/built Malcom's FB package and giggled like a little schoolgirl as I toggled LEDs
I then downloaded/built Kev's fbd and ran it per the instructions above. I know next to nothing about dbus so figured a quick commandline test was a good start, but I ran into problems. It's past my bedtime (I'm getting old) so I figured I'd ask in case there was a quick answer. Using dbus-send, I'm not sure how to toggle one of the digital outputs. I have #1 turned on right now so I tried to turn it off with
cgalpin@jaunty:~/fbd$ dbus-send --session --print-reply --dest="org.openice.fbd" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int16:1 boolean:false
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.openice.fbd was not provided by any .service files
cgalpin@jaunty:~/fbd$ dbus-send --session --print-reply --dest="org.openice.fbd.fusionbrain" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int16:1 boolean:false
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.openice.fbd.fusionbrain was not provided by any .service files
As you can see, it doesn't seem to understand the destinations. Any ideas? I tried a few other things and perhaps made progress with
cgalpin@jaunty:~/fbd$ dbus-send --system --print-reply --dest="org.openice.fbd" /org/openice/fbd org.openice.fbd.fusionbrain.SetSingleOutput int16:1 boolean:false
Error org.freedesktop.DBus.Error.UnknownMethod: No such method 'SetSingleOutput' in interface 'org.openice.fbd.fusionbrain' at object path '/org/openice/fbd' (signature 'nb')
Also, I first build FB using libusb-1.0-0 since it was newer, and other than a #include and a makefile tweak it built and ran fine. When I went to build fbd, there were a boatload of differences to both FB, but also the version of usb. I started making the changes from usb to libusb but then started finding functions that didn't seem to have libusb analogs and gave up and just installed libusb-0.1-4 and libusb-dev and it built fine unmodified. In a nutshell, what is the difference between these versions?
Anyway, just wanted to say thanks and I look forward to being able to get this working, and take some time to contribute myself.
charles
I would use (and do use) a utility like qdbusviewer to test fbd. You can use it to browse the system bus to find the org.openice.fbd service and even test out the different functions. If it isn't running there, be sure to copy the fusionbrain.conf to the right dbus directory and restart dbus (or the entire machine). By default, dbus will not allow services to register on the system bus.
hope that helps.
__________________
LinuxICE - because my car already has enough windows (and because I like speed).
LinuxICE2 beta2 is released!!! get it now!
Follow OpenICE development
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:48 PM.
| |