We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

Linux Programming

NiVZ
NiVZ Posts: 174 Forumite
edited 14 March 2010 at 11:17AM in Techie Stuff
Hello,

I'm an experienced Windows user and am writing a program in a scripting language called 'AutoIT'.

My program is going to provide a graphical user interface (GUI) that reads data from diabetic blood glucose meters and uploads them to a database on a web site.

Someone has asked if it would be possible to do something similar in Linux.

I just wondered if anyone could give some suggestions on what is the best flavour of Linux to use, and programming language keeping in mind it needs to have a GUI and access the COM port?

Here is some more techy details from the windows side:

All these meters use USB-to-Serial cables via a virtual COM port. I've heard some versions of Linux detect these and install drivers for them automatically.

The program also needs to be able to handle sending binary via the COM port (to enable sending and receiving of Chr(0) - otherwise it is interpretted as 'end of string')

The uploading to the website is done using an XMLHTTP object and REST.

Any pointers greatly appreciated.

NiVZ
«1

Comments

  • Baldur
    Baldur Posts: 6,565 Forumite
    As a non-programmer, I don't know if the following link will give any hints at all - there's a vast amount of Linux information out there http://www.faqs.org/docs/Linux-HOWTO/Serial-Programming-HOWTO.html#AEN102
  • fwor
    fwor Posts: 7,023
    Part of the Furniture 1,000 Posts Name Dropper
    Forumite
    Probably the best first step is to find out if any of the current Linux kernels actually do have drivers built-in. If they don't, your best option is simply to say No!

    If you download one of the current Linux distributions (Ubuntu is probably a good choice here) and boot it as a LiveCD on a test PC, wait until everything has settled down, plug in your USB device, open a terminal and type "dmesg". You should see (at the bottom of a long list of messages) whether your device was detected, and whether a driver was successfully loaded.

    If that works, there are quite a few BASIC-like scripting languages for Linux - for example Gambas - but you will probably need to go to a much more specialist forum for an answer to the question of whether that will support binary via a COM port...
  • NiVZ
    NiVZ Posts: 174 Forumite
    Hello,

    Thanks for the replies. I'll have a look at Ubuntu - might try running it in a Virtual PC and see how I get on.

    NiVZ
  • fwor
    fwor Posts: 7,023
    Part of the Furniture 1,000 Posts Name Dropper
    Forumite
    NiVZ wrote: »
    might try running it in a Virtual PC and see how I get on.

    I'm not sure why you would choose to do that. You're more likely to find out the limitations of Virtual PC than anything else. Why do you not want to run it as a LiveCD? Ok, it will be slow, but speed surely isn't a concern at this stage?
  • Darksun
    Darksun Posts: 1,931 Forumite
    If you go for Ubuntu, I'd say try a Wubi install, it'll be much faster than a LiveCD and allow you to play around more, but you don't have to go to the trouble of partitioning and formatting the disk as you would for a 'real' install.

    In terms of languages, I'd suggest looking into Python. I'm not sure about AutoIT but having had a quick look at the website, it seems fairly basic so Python may have a bit of a learning curve, but it'd be well worth it since Python is a very flexible and powerful language. It also runs on most platforms, so you can do Windows and Linux programming in it. There is a library for using serial/COM ports called pySerial.
  • NiVZ
    NiVZ Posts: 174 Forumite
    Hello,

    Sorry should have said I've done plenty of programming VB, .NET and C++
    The AutoIT was just for rapid proto-typing and there was already a program available that could interact with the COM port that I've built upon and made it easier to figure out the meters command language (protocols)

    On the Linux side, I've seen someone say that you can use the 'lsusb' command to list the USB devices and see if the cable driver has installed.

    On the language front I've seen Ruby and Java mentioned a few times. The only other thing I need to think about is whether to go for a language like C++ which would need to be compiled on each platform, or JAVA where it doesn't need re-compiled.

    NiVZ
  • gaming_guy
    gaming_guy Posts: 6,128
    1,000 Posts Combo Breaker
    Forumite
    NiVZ wrote: »
    Hello,

    Thanks for the replies. I'll have a look at Ubuntu - might try running it in a Virtual PC and see how I get on.

    NiVZ

    Microsoft Virtual PC is crap for testing a Linux OS. Sun Virtualbox is much better and supports a lot more *nix operating systems than MS VPC.
  • NiVZ
    NiVZ Posts: 174 Forumite
    Hello,

    Tried the Ubuntu 9.10 LiveCD with some success.

    Both meter cables are detected. The Lifescan Onetouch cable appears to use /dev/ttyUSB0.

    The Abbott cable is detected but I can't figure out which device it is in /dev I had a similar problem in Windows as this cable uses a UMP Port instead of a virtual serial port. The Linux 'demsg' command is showing it as a 'new full speed USB device using uhci_hcd device and address 3'

    I was planning to use vmware for the virtual PC as I can't wipe my windows install :( and vmware gives better use of the USB devices.

    NiVZ
  • Darksun
    Darksun Posts: 1,931 Forumite
    NiVZ wrote: »
    I was planning to use vmware for the virtual PC as I can't wipe my windows install :( and vmware gives better use of the USB devices.

    Give Wubi a go then, doesn't affect your windows install and if you ever want to get rid of it you can just remove it the same as a normal Windows program. It'll give much better performance than VMWare and give you a truer picture of how the software will function on a normal Linux install
  • [Deleted User]
    [Deleted User] Posts: 4,466
    Part of the Furniture 1,000 Posts Combo Breaker
    Forumite
    Darksun wrote: »
    Give Wubi a go then, doesn't affect your windows install and if you ever want to get rid of it you can just remove it the same as a normal Windows program. It'll give much better performance than VMWare and give you a truer picture of how the software will function on a normal Linux install

    A simpler set up is the best solution, that being Linux installed on its own partition. Introducing complexity could become time consuming if you've got to troubleshoot later down the line.

    I wouldn't recommend using Ubuntu for development. Debian is a far better distro for the task with a much larger community of developers.
This discussion has been closed.
★ ★ ★ Meet your Ambassadors

Categories

  • All Categories
  • 356K Banking & Borrowing
  • 255K Reduce Debt & Boost Income
  • 456.3K Spending & Discounts
  • 248.5K Work, Benefits & Business
  • 606.3K Mortgages, Homes & Bills
  • 179.1K Life & Family
  • 264.1K Travel & Transport
  • 1.6M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.7K Read-Only Boards
Quick Search

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.