Porting to Mono

2011-06-13
2013-06-12
  • Bret Watson

    Bret Watson - 2011-06-13

    This is a thread to capture the adventures of porting this to mono

     
  • Bret Watson

    Bret Watson - 2011-06-13

    Starting with the 4.2.0.0 release src
    downloaded zedgraph src project from sourceforge
    Mono complained it couldn't find/understand the dot-net-check. project file…

    First build returned 1 error  "The system could not find the file specified which was the revision history! - gah removed it from the project

    Got another error from ZedGraph..

    "Performing main compilation…
    Generating satellite assembly for 'de' culture with al2
    Error while trying to invoke 'al2' to generate satellite assembly for 'de' culture:
    The system cannot find the file specified
    Build complete - 1 error, 0 warnings"

    WTF! - time to hit google….

     
  • Bret Watson

    Bret Watson - 2011-06-13

    Google is a wonderful thing…. got inside zedgraph and ripped out the locale files for everything except english

    built successfully with 4 warnings (mainly unused variables), no idea what it has actually built though as the config stuff didn't happen…

    Big question time now is how to make the buildtime config happen…

    watch this space :)

     
  • Bret Watson

    Bret Watson - 2011-06-13

    holy *&^#@ it appears to have worked!… haven't pluged my wmr200 in yet, but gui has come up….

     
  • A Weather Guy

    A Weather Guy - 2011-06-13

    …that's scary…other than zed graph changes have you stubbed anything out?

    Is there somewhere you could post a screen shot for us to see?

     
  • Bret Watson

    Bret Watson - 2011-06-14

    it wouldn't be that exciting - since its on windows - it just looks the same as your screenshots :)…

    next to try it on linux.. if that works first go without stubbing - I'll poo myself..

     
  • DAVE

    DAVE - 2011-06-14

    Do NOT show us a screenshot of THAT!!

     
  • Bret Watson

    Bret Watson - 2011-06-14

    ok it builds with 155 warnings under debian… and doesn't run :P..
    now to the long slow process of working out what needs to change.. first one off the rack is the path format.. it trying to put windows "\" into a unix "/" path so the crash dump is my first exception :)

     
  • Bret Watson

    Bret Watson - 2011-06-15

    Does anyone know where the usblibrary originally came from? I need to modify it to handle the linux HID world…

     
  • A Weather Guy

    A Weather Guy - 2011-06-15

    It's from the code project, here:

    http://www.codeproject.com/KB/cs/USB_HID.aspx

    Don't know if that will help much. Don't know if you already figured this out, but the Win32Usb.cs file is just a p/invoke interface to standard win32 functions and the rest of it is built on top of that…

     
  • A Weather Guy

    A Weather Guy - 2011-06-15

    Forgot to add - if the Linux HID functions are similar you might be able to just create a LinuxUsb.cs to replace the Win32Usb.cs file and not have to change anything else. You might want to define an interface class to make it easier to swap between windows and linux…

     
  • Bret Watson

    Bret Watson - 2011-06-15

    :) actually I hadn't - I was looking to see if the developer had added linux… but I think what I'll do is try the linuxusb.cs class type thing…

    Working out the c# equivalent of #pragma if calls is my next task.. that way I can easily merge it with your current code…

    it gives me a break from studying ITIL intermediate stuff :)

     
  • Bret Watson

    Bret Watson - 2011-06-15

    actually I might try and move the usblibrary to https://sourceforge.net/projects/libusbdotnet/  the reason being is libusb has both linux and windows versions.. :)

     
  • Michael Gray

    Michael Gray - 2012-02-18

    I'm joining this party a little late, but here goes…  I've been a happy WSDL user for some time but keeping a Windows system
    running 24x7 to gather weather data has always nagged at me.  I got interested in low power computing and plug computers
    in particular and tentatively moved to wview running on PogoPlug/debian - having gone from 100+ watts to about 4 watts
    was rewarding, but…  wview is good stuff (supports a lot of different stations, not just O.S.), but it's not as polished as WSDL.

    There seem to be a couple of threads on the subject of WSDL + mono + linux - both(?) end with USB woes…  Have you,
    or anyone you know, gotten past this?  It seems there are 2 paths: find a linux/mono implementation of the .net HID library,
    or modify WSDL to use some other HID library.  Before I try to reinvent the wheel, I wanted to see if anyone with better
    Google skills than mine has found the former?  Assuming not, has anyone spent time investigating the latter with an
    eye toward picking from among numerous linux usb hid libraries and digging in?

     
  • Bret Watson

    Bret Watson - 2012-02-19

    To be honest I ran out of energy trying to learn mono and work out how to build a new linuxusb.cs…. You reasons are the same as my reasons however :).. I have a different app - wfrog running on my arm box capturing the weather traffic, but its not very good…

     
  • Mauried

    Mauried - 2012-12-24

    For what its worth, its possible to get power consumption down to a pretty low level and still run windows apps like WSDL
    without all the trauma of porting to another platform.
    Im running WDSL on a EEEPC running XP , and in power saving mode with the screen turned off, power consumption is
    12.5 watts.
    Obviously not as good as 4 watts, but for the 8 watts differance and the lack of aggro in getting it to work, quite worthwhile.

     
  • A Weather Guy

    A Weather Guy - 2012-12-29

    Okay, now for something completely different from left field. I'm the developer of WSDL and while I once worked with Unix derivatives, it was long ago and far away. That said, here are some thoughts on solving your USB woes. They may be worth nothing…but then you will have gotten your money's worth :-)

    Regarding the existing HID interface - if there is some way to trick Linux into treating the OS HID device as a generic USB device then you could use some generic USB interface libraries perhaps to get at the raw USB data stream. At the core, all WSDL needs is the raw USB data stream and if you find another way to get at it that could still work. With my current lack of Linux knowledge I have no idea if this is doable. But, if someone could write some Linux code to get at the raw USB data stream it could work.

    And now for another idea - can you talk to an Arduino processor board over USB in Linux? If so then the WxShield could be used instead of the OS base unit. In Windows, WSDL just treats it as a standard COM port; does that interface exist and work in Mono? I must admit some personal bias on this topic, as I've been closely involved in developement and promotion of the WxShields so caveat emptor here. More about the WxShield is available on this web site: http://www.osengr.org. Open source hardware and software. There are two versions - one that can be built by hand and another that requires a custom PCB and SMT assembly skills.

    To wrap this post up, if you can figure a way to get at the USB data stream this can probably be integrated with WSDL. I would consider some sort of tweak (e.g. a generic USB data stream interface class) that might allow a more generic interface between WSDL and the USB data stream to assist with the Mono work.

     

Log in to post a comment.