Menu

Problem with Owdotnet in WinCE

Help
giannip
2008-11-20
2023-03-13
1 2 > >> (Page 1 of 2)
  • giannip

    giannip - 2008-11-20

    I use Owdotnet for a winCE application. When i make the call : adapter = AccessProvider.GetAdapter("DS9097U", "COM1:");
    i have this error : Method not found: GetAssemblies System.AppDomain.
    I verify that the problem isin mscorelib because in the Compact Framework version there is not this method.
    Someone has a solution?

     
    • PerMal

      PerMal - 2008-11-20

      That call is used to load the custome containers, and you can modify the source to not do that.

      PortAdapter.cs, line 427

       
      • giannip

        giannip - 2008-11-21

        Where can i download the source code for Owdotnet?
        Thank

         
        • PerMal

          PerMal - 2008-11-21

          Use a subversion client and download it from the SVN repository.

           
    • Marco Sauter

      Marco Sauter - 2009-04-29

      Hi,

      i have the same error while
      adapter = DalSemi.OneWire.AccessProvider.GetAdapter("{DS9097U}", "COM1");

      are the '{' nessecary?
      without the brackets i get an adapterexception.
      what do I have to edit for solve this error?
      I work with the version from https://owdotnet.svn.sourceforge.net/svnroot/owdotnet/Source/Classes/OWdotNET/tag/0.13.1

      greetings, marco

       
    • PerMal

      PerMal - 2009-04-29

      Yes, the curly braces are necessary.

       
    • Marco Sauter

      Marco Sauter - 2009-04-29

      ok, thx

      but how can I avoid the "Method not found: GetAssemblies System.AppDomain." error?

       
    • Marco Sauter

      Marco Sauter - 2009-06-02

      I've still have the same problems with ow.net on Win CE.
      I tried do port the sources for .Net Compact Framework, but had no success.
      Can anyone send me a ported version or help me with this problem?

       
  • jasoncd

    jasoncd - 2009-10-14

    On CE, you can only use the new Serial adapter, DS9097U (no braces). No braces will give you the new class that does not rely on TMEX. TMEX is not available on CE. You will to enable this class on about line 127 in AccessProvider.

    There is one actual 'bug' in the code that kept me from getting this working until yesterday. On about line 1049 in CommAPI, change from:

    this.DCBlength = (uint)Marshal.SizeOf(this);
    to:
    this.DCBlength = 28;

    Finally, if you are not already, create a new Windows Mobile DLL project and copy the source there. The existing code has several features that are not available in CE. It's easier to find these issues in a CE project.

     
  • Space

    Space - 2011-05-27

    Hi Jasoncd,

    you speak about a "bug" .. why it is not update in a new version ?

    i have the same problem as GIANNIP .. and can't find a solution :(

    Please provide more help, i'm totaly stoped on my winCE application ..
    can't find my DS9097U adapter on the COM4

    thanks, regards

     
  • Space

    Space - 2011-05-28

    i have try to enable the class as you explain JASONCD in #10 …
    recompile the DLL .. but not more lucky … :(

    how can we use 1WIRE on winCE device with COM port and DS9097U adapter ?…

    PLEASE HELP !

    thanks

     
  • Anonymous

    Anonymous - 2011-05-31

    Use the sources and compile it yourself. That way you will find all the code that is not CE-compatible. Using the precompiled .dll will only give you problems.

     
  • Space

    Space - 2011-05-31

    it's what i try.. but i'm not C# expert ..

    in fact, if the OW.NET project need the TMEX driver to work properly …
    i don't understand what is the plus !.. we have the same with the MAXIM library !..? no ?

    nobody use OW.NET with serialpor COMt instead TMEX drivers ??
    the serial port work great on all platform !.. why not use it !..?

    thanks for more help .. Please :)
    regards
    phil

     
  • Space

    Space - 2011-06-01

    Hi all readers of this thread ;)

    well i try to build my own version of OWdotNET library to work with my DS9097U adapter on COM port of my winCE 6.0 device ( only CF2.0 enable - CF3.5 disable )

    ( all tests are firstly try on CF3.5, the resultas are same ! )

    well i try all suggestion on this thread ( #9 )
    when i come to the problem of #2, i comment the line :

            static PortAdapter()
            {
                //InitAssemblyContainerClasses( containerClasses, customContainers );
            }
    

    then i obtain this error :

    the "WIN32" message seem not for winCE ..?
    don't know to do now ?..

    Please ?
    Phil

     
  • Space

    Space - 2011-06-01

    this image :

     
  • Space

    Space - 2011-06-01

    i have investigate the schematic or my board and see that the RTS CTS lines are not wired to the SUBD9 COM port connector …

    is it a problem with the serial class adapter or OWnet ??

    thanks
    phil

     
  • Space

    Space - 2011-06-01

    i precise that my DS9097 is powered by an external power and work great if i use it on my PC.

    i think that the RTS ans CTS lines are only used to power up some DIY adapter .. 

    so it will not be a problem for my question #17..

     
  • Space

    Space - 2011-06-05

    Well, nobody use OW.NET on winCE device then ?

    i'm the only one on this world, who want use 1WIRE on winCE device  ???

    regards
    phil

     
  • jasoncd

    jasoncd - 2011-06-06

    I honestly haven't touched this code since I tested it two years ago. Oddly enough, last week we finally decided to use it. I confirmed it still works. I can't provide more info that what I already did with regards to drivers: Create a new Windows Mobile DLL and make the changes I described. Here's how I use it; maybe this will help.

    Dim liState As Byte()
    Dim loAdapter As DalSemi.OneWire.Adapter.PortAdapter = OneWire.AccessProvider.GetAdapter("DS9097U")
            Try
                If loAdapter.OpenPort("COM1:") Then
                    loAdapter.BeginExclusive(True)
                    loAdapter.SetSearchAllDevices()
                    loAdapter.TargetFamily(&H21)
                    Dim loThermochron As OneWire.Container.OneWireContainer21 = New OneWire.Container.OneWireContainer21(loAdapter, loAdapter.GetFirstDeviceContainer.Address)
                    If loThermochron IsNot Nothing Then
                        liState = loThermochron.ReadDevice
                        'Call whatever functions you need.
                        loThermochron = Nothing
                    End If
                End If
            Catch ex As Exception
                '
            Finally
                If loAdapter IsNot Nothing Then
                    loAdapter.EndExclusive()
                    loAdapter.FreePort()
                    loAdapter.Dispose()
                    loAdapter = Nothing
                End If
            End Try

     
  • Space

    Space - 2011-06-07

    Well good to have news from you Jason ! :)

    i will try your post asap .. in 1 or 2 hours max ! ;) …

    i have try to rebuild the dll, but i'm not sure i do all right .. please can you update the repository ?
    or send me a link to download the DLL you use on a winCE platform ..

    you confirm, i can use CF3.5 ?

    Thanks jason for your reply
    regards
    phil

     
  • Space

    Space - 2011-06-07

    Jason,

    i try your code with the new DLL compiled like you describe ( i hope ! )
    my adapter is on "COM4:"

    this is my code :

    Imports DalSemi
    Public Class Form1
        Dim adapter As DalSemi.OneWire.Adapter.PortAdapter
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim liState As Byte()
            Dim loAdapter As DalSemi.OneWire.Adapter.PortAdapter = OneWire.AccessProvider.GetAdapter("DS9097U")
            Try
                If loAdapter.OpenPort("COM4:") Then
                    loAdapter.BeginExclusive(True)
                    loAdapter.SetSearchAllDevices()
                    loAdapter.TargetFamily(&H21)
                    Dim loThermochron As OneWire.Container.OneWireContainer21 = New OneWire.Container.OneWireContainer21(loAdapter, loAdapter.GetFirstDeviceContainer.Address)
                    If loThermochron IsNot Nothing Then
                        liState = loThermochron.ReadDevice
                        'Call whatever functions you need.
                        loThermochron = Nothing
                    End If
                    ResultsTextBox.Text = "Adapter: " & loAdapter.AdapterName & " Port: " & loAdapter.PortName
                End If
            Catch ex As Exception
                MessageBox.Show("Error:  " & ex.ToString)
            Finally
                If loAdapter IsNot Nothing Then
                    loAdapter.EndExclusive()
                    loAdapter.FreePort()
                    loAdapter.Dispose()
                    loAdapter = Nothing
                End If
            End Try
        End Sub
    End Class
    

    please check the error :

    http://ekofpga.free.fr/CEZoom0-OW.NET.BMP

    may i try with your DLL please ?

    thanks
    phil

     
  • Space

    Space - 2011-06-07

    Jason,

    of cours, i have try all possibility like :

    SODim loAdapter As DalSemi.OneWire.Adapter.PortAdapter = OneWire.AccessProvider.GetAdapter("DS9097U", "COM4")
    code]
    or
    [code]Dim loAdapter As DalSemi.OneWire.Adapter.PortAdapter = OneWire.AccessProvider.GetAdapter("DS9097U", "COM4:")[/code]
    every time a problem to open the COM port ( yes i'm sure, it's COM4 i need ;) )
    when the FORM load, i receive this error :
    L'exception System.MissingMethodException n'a pas été gérée
      Message="Impossible de charger le type 'Microsoft.Win32.SafeHandles.SafeWaitHandle' à partir de l'assembly 'mscorlib, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC'."
      StackTrace:
        à DalSemi.OneWire.Adapter.SerialAdapter.OpenPort(String PortName)
        à DalSemi.OneWire.AccessProvider.GetAdapter(String adapterName, String portname)
        à TestF35_CF35_OW.NET.Form1.Form1_Load(Object sender, EventArgs e)
        à System.Windows.Forms.Form.OnLoad(EventArgs e)
        à System.Windows.Forms.Form._SetVisibleNotify(Boolean fVis)
        à System.Windows.Forms.Control.set_Visible(Boolean value)
        à System.Windows.Forms.Application.Run(Form fm)
        à TestF35_CF35_OW.NET.Form1.Main()
    and the file "SerialAdapter.cs" open to line 221 .. i check the basic settings and see that the RTS and DTR control lines are enable ... the problem may be here, on my COM4, theses lines are not available !!..
    how can i change that ?
    thanks for your help, regards
    phil
    
     
  • jasoncd

    jasoncd - 2011-06-08

    While I have not tested it, I believe .NET 3.5 should work fine. It is based on .NET 2.0.

    I do not know much about the wiring, but I'm pretty sure the DTR and RTS *MUST* be present. They are used to power the DS9097. If possible, try to get it working with your desktop computer to verify the adapter works.

    I can't provide any information on your error message.

    Something to remember: The CompactFramework will not be around forever. It gets harder every year to find WindowsMobile PocketPC's. We're only attempting to use this for legacy products.

    Also, have a look at this application note that Maxim wrote:
    http://www.maxim-ic.com/app-notes/index.mvp/id/4633

    They provided their own code. Maybe it could be adapted for the CF; I've not tried it.

     
  • Space

    Space - 2011-06-08

    Jason,

    thanks for your reply.

    i think that the DTR and RTS are only wired to power up some adapter.
    my adapter is powered with an external power and work great with the COM port of my PC.

    the library provided by MAXIM and OW.NET work perfectly under CF3.5 on my PC.. but not on my real winCE device with CF3.5 !

    in your #20, you say that you use it again .. but on PC ? on winCE device ??

    phil

    Please can you share your last DLL or better your last full project ( where you apply all modifications you mentionabout OW.NET) ?

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.