Some examples so far… Windows XP, Vista, 7, Ubuntu 10.10, Mac OS X 10.6…
In the end it was Qt that won the day for the cross platform development.
Some examples so far… Windows XP, Vista, 7, Ubuntu 10.10, Mac OS X 10.6…
In the end it was Qt that won the day for the cross platform development.
Looks great!
Typical Mac – has to be different on 70cms while everyone else is on VHF.
Well done. Looks great – I must try and see if QT can replace Borland/Codegear/Embecadero/Whatevertheyarecalledthisweek for C++ development.
Is this software going to be open source?
Hello Mike.
Well as you can imagine I only just got to a stage where I was brave enough to try it across platforms and show you the results. Apart from XP, they’re all on VMs too so I will almost certainly have to build real physical machines to test too.
In particular under VMs, when switching between normal and bootloader modes and vice-versa, the FCD pretends to unplug itself and plug itslef back in, thus forcing a re-enumeration. While this works fine on a real machine, on a VM it’s a bit kludgy and doesn’t work very well.
As long as you are patient, QT isn’t too bad. I found the two books I purchased on it of little use for me I’m afraid. The problem for me was two fold. Firstly, I am using the QT Creator IDE and I haven’t found any books that step you through that. Secondly, I am trying to do some advanced non-GUI stuff on multiple platforms, some that I don’t have much (if any) recent experience of programing, so it’s taken two or three weeks of apparent random button pushing to get this far.
Will the host software be open source? Yes.
Probably not much point distributing the source right at this second as the FCDs aren’t being distributed for a week or so yet and it is in a rather bleeding edge state at the moment.
Howard
Oh, one other thing, it appears that under Ubuntu 10.10 and possibly other Linux distributions, USB Plug and Play isn’t very, well, Plug and Play. I seem to have to explicitly authorise access to the /dev/bus/usb…. devices on each insertion. I’ve seen reference to some fiddling you can do with some udev rules files but it seems really, really messy. Or am I missing something?
For reference I am using Qt SDK 2010.05 (Qt 4.7.0/QT Creator 2.0.1) and Alan Ott’s HID API http://www.signal11.us/oss/hidapi/ with a couple of minor mods to make it compile with the Qt toolchain and across all the 32 bit and 64 bit platforms I’m trying to support. For Linux/Ubuntu 10.10 I am using LIBUSB-1.0 too. Under Linux the HID API can use either LIBUSB or HIDRAW but it looks like the HIDRAW implementation required for the HID API is yet to be released with a standard stable Ubuntu.
Getting started hacking a GUI with Qt couldn’t be easier as long as you only want to stick to the tutorial examples. In particular I found the install painless compared to all my other sojourns into the Linux world as the toolchain is included for each platform with this SDK release.
It gets a little more scary when you start trying to add in platform specific libraries. In addition, almost innevitably, getting your GUI to look right on all platforms is a time consuming iterative process. Also I haven’t figured out how I move the project between different platforms without having to fiddle the build settings each time.
Howard
For Linux, to automatically allow access to the FCD as a non-root user, it is necessary to add a text file in the /etc/udev/rules.d directory. It can be called anything, as the directory is scanned for any files, but I used the filename “fcd.rules”.
Within that file you need the following in a single line:
SUBSYSTEMS=="usb" ATTRS{idVendor}=="04d8" ATTRS{idProduct}=="fb56" MODE:="0777" SYMLINK+="FUNcube Dongle"
I’m not sure what the perceived best practice is for doing this in Linux, so if anyone has any simple suggestions for this other than placing this file, I’d be glad to hear.
Howard
But can you do this if not root? I suppose pretty much everyone has root access when an amateur but it might be very different in schools.
You have set “0777” which allows read/write/execute for everyone. That might be a security risk. Does it have to be “0777” ?
You can call it anything but there are conventions for execution order. Perhaps “99-fcd.rules” or some other more appropriate number?
As you know I’m not a Linux expert although I’ve used it on and off for fifteen years or so.
The documentation how best to do this seems rather elusive and/or inconsistent on this. Not sure if it has to be 777 at all, I just went from an example I found online. 666 will probably work, although I don’t know what security risk I might be saving myself from if I switched it to this.
I am also not sure how many Linux machines there are in the class room, I hadn’t really considered Linux being a target in that market. If it is, I would imgine they must have some clued up sysadmins to support such a setup.
Is there a perceived way to do this kind of thing? ie, should we be considering some sort of packaging mechanism? If so, which one? I am still a bit from the old school on this one, no setup needed, just double click the .exe that you installed in the folder of your own choice.
Howard
I think 66 might be better than 777 but it depends.
Linux is very common in colleges, perhaps not schools.
There is a package mechanism and it is probably the best way to do this – but I suggest we ask for a linux expert to do the packaging. Surely if we have people that can build rockets and satellites within AMSAT UK we have someone who understands linux packaging.
Here is the guide – it is not that difficult but it is effort:
https://help.ubuntu.com/6.10/ubuntu/packagingguide/C/basic-scratch.html
There is something called Debhelper to help https://help.ubuntu.com/6.10/ubuntu/packagingguide/C/basic-debhelper.html
This is probably too much effort compared to posting a zip. A package does allow you to manage dependencies – like the QT libs for example.
Howard;
I am running 64 bit Ubuntu. I have put the rule in as you described, as before that I got the libussb error cannot ope.. permission denied.
Now with the rule in udev I get a segmentation fault. If the FCD is not plugged in, the hid002 programme will start – but of course with the error “No FCD detected” followed by a warning on the command line again of segmentation fault.
Any idea of a quick fix for the segmentation error problem yet? I see a couple of others have this error as well
Hi Mike
Thanks for your input. I think I’ll leave the packaging to someone else to do for now. My brief experience of trying to do any SDR under Linux suggests to me that you need some degree of technical experience already anyway. As you suggest it will take some time and effort for someone to do that packaging. Until a month or so ago I had no intention of providing anything other than making sure the operating systems recognised the device at a driver level, and to provide a Windows interface with source together with the HID interface documentation for the coders.
However a small number of people complained that their OS wasn’t being properly supported, so I’ve now spent quite a lot of time on getting a cross platform front end going for them. Even now, it still needs some work, for example the integrated HID firmware bootloader part doesn’t work properly in Linux for some reason.
Once I have it in a reasonably working state in the next week or two I’ll release the source for someone far better qualified than me to fancy it up! (The FUNcube team very well know that I am not a GUI guy!).
Howard
Progress – After success with QT Creator I have managed, with some argument over wchar_t* vs char*, to get the HID class to compile under Borland C++ Builder – the fcd.c functions also compile with only a few warnings, so I am well on my way to an application. So far I have only got as far as setting the frequency and correcting for the crystal offset (mine is -106ppm) but the rest should be straightforward. There are various registers to deal with. I am looking forward to finer frequency resolution.
Next task is to try and couple to Spectravue – some form of com port hijack maybe.
Mike
Hi Mike
Sounds excellent!
I am in the process of adding in a new frequency set HID command that will allow you to specify frequency down to 1Hz, although the PLL isn’t that accurate.
Its command code is, perhaps unsurprisingly, 101, and it takes a 32 bit rather than a 24 bit unsigned frequency and it also returns the 32 bit actual frequency set.
Howard
Excellent – we need that to get the offsets right.
Why not just replace the 1kHz function – it is not really needed any more. Compatibility with older code perhaps? Save a byte in USB comms?
The frequency word is 32 bit unsigned? That should be sufficient to 4GHz – except for those requesting sub-Hz resolution. Your current function definition uses int – which could be dangerous if any compilers still define ints as 16 bits.
EXTERN FCD_API_EXPORT FCD_API_CALL FCDMODEENUM FCDAppSetFreqkHz(int nFreq)
Incidentally, one of the things I had to do to make your code work was replace all the custom integer declarations with unsigned __int32 etc. I am sure there is a simpler way using typedef but I could not remember how at 11:30pm so global replace was used as a fast fix.
Mike
PS – This is probably not the right place to discuss software – must be boring to most readers.
Much of the SDR software seem to use a set of the ‘Kenwood’ commands for changing frequencies etc.
It’s well beyond my abilities, but it would be awsome if someone could kludge something together to interpret the Kenwood commands into something that would work with the FCD.
Matty
Not so easy with Spectravue. Yes one can make a virtual com port connection and decode the Kenwood commands, but there ought to be a better way not requiring a com port.
It is possible to control Spectravue from another program – Moe provides some source code, but unfortunately it is in Microsoft Visual C. Everyone uses a different version of C++ – that is one of the good things about standards, there is a lot of choice as there are so many of them, but in this case I don’t think it will be a simple job.
Mike
http://sdr-radio.com/Support/Interfacing/CATCommands/tabid/317/language/en-US/Default.aspx
Some info here on Simon’s site.
Matty
Came a bit late for me….
I managed to get power SDR to set the frequency of the dongle, and I could scan up and down the band with the mouse, but it was a bit of a cludge. I managed to tune in Manchester Airport weather on 128.185MHz
I am using a virtual com port utility called com0com to link com10 to com11. My FCD control software is listening on com10 for FAxxxxxxxxxxx; commands from powerSDR which thinks it has an SDR1000 attached is sending kenwood style commands on com11. When my application gets a valid frequency command it sets the frequency of the FCD to it. The 1kHz resolution is a problem as I can’t seem to work out how to make PowerSDR move its demodulation window relative to the passband – fine for FM but not SSB. Also, to get above 50MHz one has to tell PowerSDR it is using a transverter at 28MHz. PowerSDR also seems to be trying to apply USA band plans and refuses to run unless set to RX only. Why it applies these is another mystery, I can see why it does this on transmit but not on receive. There does not appear to be a country setup option to avoid it. It is all a bit fraught so I do not recommend PowerSDR and FCD just yet.
Spectravue, my preferred platform, refuses to send or receive frequency commands when in Soundcard mode. I will Email Moe and ask him how it should be done as there is an API.
The other SDR package WRplus – is frustrating as it insists on using the entire screen and so makes debugging impossible. I abandoned it. Why do people do this – it is obviously great software?
Hello Mike,
I just send Sandro (the maker of WRplus) a email with a request to make it possible to size the screen of his wonderful WRplus program (screenshot available on the Yahoogroup):
http://uk.groups.yahoo.com/group/funcube/photos/album/1547931915/pic/1591889242/view?picmode=original&mode=tn&order=ordinal&start=1&dir=asc
73 de Frank PH2M (FCD #111)
Hello all, I got the reply from Sandro on this issue:
Hello Frank,
please start WRplus with the command line option “-wv” (see the user guide): this will solve your
display issues (there is a problem in the Borland runtime with large screen
resolutions).
Best regards
73 Sandro
Hi Mike,
WRplus has one of the best AM (e.g. for Airband) and FM demodulators in any SDR software to date that I’ve tried…..
I would still give it a try. Or use HDSDR (almost identical in terms of how to send/receive frequency commands via the EXTIO.DLL interface)….HDSDR can be scaled to my knowledge…..
Otherwise the authors may provide you with a scaleable window version just for your debugging purposes.
WRplus currently is my favourite SDR RX app….
Oscar
Sort of working now. http://www.flickr.com/photos/ad6xy/5300267205/
This seems to be the way to do – intercept the coms.
Folks
I am delighted that some people are already writing software for the FCD!
The fast rate of third party development wasn’t quite what I expected at all, but I guess you’re a bit like me, given a bit of code to run with, that beats a formal API specification any day.
Thanks again, Howard
rob, thanks for sending me to this post!
i have tried creating the udev rules but this leads me to a segfault, i can only see the qtGUI when i ran it as user, but then i get the permissions to read and write error, if i change the user allowed to run the device or the permissions to the device i only get a segfault, yes this is latest ubuntu 10.10, please see:
libusb couldn’t open USB device /dev/bus/usb/001/012: Permission denied.
libusb requires write access to USB device nodes.
can’t open device
alejo@dspstv:~/Desktop/qthid002$ ls -lah /dev/bus/usb/001/012
crw-rw-r– 1 root root 189, 11 2011-01-10 17:56 /dev/bus/usb/001/012
alejo@dspstv:~/Desktop/qthid002$ sudo chown alejo:alejo /dev/bus/usb/001/012
alejo@dspstv:~/Desktop/qthid002$ ./hid002
Segmentation fault
alejo@dspstv:~/Desktop/qthid002$ ls -lah /dev/bus/usb/001/012
crw-rw-r– 1 alejo alejo 189, 11 2011-01-10 17:58 /dev/bus/usb/001/012
i could generate a debian/ubuntu package if someone provides a makefile
See my message on the Yahoo group:
http://uk.groups.yahoo.com/group/funcube/message/525
This seems to be (an almost correct) udev rule – n.b you have to be root to create the rule, and don’t plug in the FCD before running the app, or you will still seg fault.
So I am now compiled and running on 64 bit Linuxmint; a Ubuntu 10.10 variant.
Hello Andy
OK I will take a look when I get a moment on 64 bit. Trying to make this stuff work cross platform is proving to be a serious amount of work I’m afraid, and it was exactly what I was afraid of when I was coerced into doing cross platform application code a couple of months ago, something I never originally intended to provide. This does not apply to the driver: the FCD was always designed to work at the driver layer cross platform.
My original intention was to let third parties do the application code given the HID specification, something that is being done successfully already on Windows and Linux by several others. After all, there are some great SDR programs out there already, why reinvent the wheel?
Howard
I have the same problem getting a segmentation fault on ubuntu 10.10 with the udev rules set.
I there any solution yet?
Martin
what are the plans and progress for the QT cross platform FCD controller?
Currently it is useless since it can not set the filters an gains like FCHid.
Since the gain and filter parameters are not persistent, I can not run the FCD on a mac right now.
Gerrit.
Hello Gerrit
Expanding QT is dependent on opening up the firmware.
The plans are to open up the entire API so that the QT cross platform controller can use it. In fact, there is already a prerelease of that firmware on the FCDDevelopment Yahoo group with example source code that opens up everything. That was released on Sunday. We are currently welcoming feedback so that we get the firmware right first.
Now I have a Mac that arrived last week it will of course be easier.
It’s purely a matter of time! I had my first half day off since Christmas last week. If there are others who would like to have a go they are of course welcome.
Howard