NetDcuA5 with WCE6, how to connect via the Internet

  • As I am new to this question, I am not sure where to start and kindly ask for a little bit help.


    We are running the NetDcuA5 with WC6. The main task of our application is the human-machine-interface. We use a touch screen for inputs and a TFT display as a graphical status display for the machine and to enter parameters and setpoints.


    Next step is to get this status Information over the internet. Goal is to connect to the NetDcuA5 over the internet and to send and receive data. It is not necessary to display anything else beside what is shown until now, it is not necessary to use a browser, we just want to exchange data.
    Idea is that the customer just plugs his Ethernet wire into the NetDcuA5 making it possible to connect to the NetDcuA5 from my PC here in Germany independend from where the machine is actually running.


    How to start this?
    What do I need?
    How can this be done?


    THANK YOU


    Dirk

  • Hello,


    i would use FTP-Server. This service is enabled by default. Is this possible?


    Try to connect via command shell (ftp<enter>...) or a web browser (ftp:\\<ipadress>). For tests you may use FS Device Spy Tool to detect and list the boards in your local area network (see downloads).


    In our download area or msdn you find also documention about ftp setting.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • FTP is fine, that is enough for our needs.
    I got a FTP connection soon after plugging in the NetDcuA5 into our company network.
    But FS Device Spy Tool did not find the board.


    Thank you

  • If I connect the NetDcuA5 to our company network, the NetDcu gets an IP address from the Server. How can I find out this actual IP adress within my own application programm? I want to show the user the actual IP adress of the NetDcuA5.


    Can the port 21 which is used for the FTP protocol be changed?


    THANK YOU
    Dirk

  • Which is your programming language? Every language offers an API for retreive Network Adatpter Information. E.g. using c++ language refer the "IP Helper Functions".
    FTP Server uses port 21 while connect, refer http://slacksite.com/other/ftp.html.
    Try the ftp "port" command for change the port.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

    Edited once, last by fs-support_ZU ().

  • I use C++ and VisualStudio2005.
    In the HELP I found an example code:


    #include <stdio.h>
    #include <windows.h>
    #include <iphlpapi.h>
    main() {
    FIXED_INFO * FixedInfo;
    ULONG ulOutBufLen;
    DWORD dwRetVal;
    IP_ADDR_STRING * pIPAddr;


    FixedInfo = (FIXED_INFO *) GlobalAlloc( GPTR, sizeof( FIXED_INFO ) );
    ulOutBufLen = sizeof( FIXED_INFO );

    if( ERROR_BUFFER_OVERFLOW == GetNetworkParams( FixedInfo, &ulOutBufLen ) ) {
    GlobalFree( FixedInfo );
    FixedInfo = (FIXED_INFO *) GlobalAlloc( GPTR, ulOutBufLen );
    }


    if ( dwRetVal = GetNetworkParams( FixedInfo, &ulOutBufLen ) ) {
    printf( "Call to GetNetworkParams failed. Return Value: %08x\n", dwRetVal );
    }
    else {
    printf( "Host Name: %s\n", FixedInfo -> HostName );
    printf( "Domain Name: %s\n", FixedInfo -> DomainName );

    printf( "DNS Servers:\n" );
    printf( "\t%s\n", FixedInfo -> DnsServerList.IpAddress.String );

    pIPAddr = FixedInfo -> DnsServerList.Next;
    while ( pIPAddr ) {
    printf( "\t%s\n", pIPAddr ->IpAddress.String );
    pIPAddr = pIPAddr ->Next;
    }
    }
    exit( 0 );
    }


    But I can not compile it. The compile finds the "iphlpapi.h", and it includes the "GetNetworkParams", but the linker gives me an error saying that the "GetNetworkParams" can not be found.
    What is wrong?


    THANK YOU
    Dirk

  • "Iphlpapi.dll" should come with the SDK.
    You have explicite to link against the dll using: Project Settings -> Linker -> Additional Libraries.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • THANK YOU VERY MUCH.
    I can compile und run the Programm now.
    If I use the CE desktop to find out the actual network address, it shows me that the NetDcuA5 uses the 10.10.2.12.
    After starting my application, thre IP addresses are listed:
    10.0.0.1
    0.0.0.0
    127.0.0.1
    But NOT the 10.10.2.12. Why can I not see the 10.10.2.12?


    On the other hand, it might be easier for the user to set the IP address including subnet and gateway and to use fixed values.
    My question:
    Where in the registry can I find the values to switch off the DHCP becaused fixed values should be used?
    Where in the registry can I find the settings for IP address, subnet and gateway?


    Or is it better to use the "IP Helper" for switching off the DHCP and for setting the addresses? But how? I can not find functions that will do it.


    THANK YOU
    Dirk

  • Quote

    Or is it better to use the "IP Helper" for switching off the DHCP and for setting the addresses? But how? I can not find functions that will do it.


    You may use this values (HKLM\COMM\ETHNETA1\Parms\TCPIP or (...\ETHNETB1\...)). But this approach has a big disadvantage it is only valid for the internal NetDCUA5 Adapter(s). Using a WLAN extension or an other board your SW won't find any Ethernet-Adapter. So I would use the "IP Helper".


    Quote

    On the other hand, it might be easier for the user to set the IP address including subnet and gateway and to use fixed values


    Fix IP values may not be possible in a special customer Network other customer may use fix values only. Think you have to provide both options by your SW.


    Note, there may be more than one adater active! E.g. ActiveSync also gets an IP!
    List all adapters:

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

    Edited 2 times, last by fs-support_ZU ().

  • PS: I did sometimes follwing for switch DHCP on/off using ndis.h functions. Maybe not the smatest way!


    Code
    1. UnbindNetworkAdapter(THENETADAPTER);
    2. EnableDHCP(THENETADAPTER, 1);
    3. // TODO Reg save
    4. RebindNetworkAdapter(THENETADAPTER);


    Where EnableDHCP is:

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • THANK YOU.
    I found in the documentation that I can crate a "FTP ServerUser List" in the registry. Okay so far, I can add the names of users allowed to access or not.
    But where to store the passwords for this users?
    I found the mark: "For more Information see Web Server Access Rights", but where can I find this?


    Dirk

  • Hello,
    ndcucfg offers possibility to set password refer: How to protect FTP by Username and Password For more details and futher links about FTPD refer the MSDN online help "FTP Server Registry Settings".

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello
    Using ndcucfg to set usernames and passwords works fine.
    BUT: How can I set the username and password from inside my application? Or how can it be set without starting the ndcucfg?
    I want to set the same usernames and passwords for all NetDCUA5 we build into our generators and this usernames and passwords should be set automatically, it should not be necessary during manufacturing to start the netdcucfg.
    Can it be set using the WinNDCUCfg?
    Best solution would be to set it from my application.


    Another question: Is it possible to give different users different access rights to folders inside the NetDCUA5?
    If yes, how can this be done?


    THANK YOU
    Dirk

  • Hello,


    a) ndcucfg provides a library, refer downloads (check if the commands available there)
    b) Use "NTLMSetUserInfo" if you do not have the lib use "LoadLibrary" for access the dll.


    Quote

    ... it should not be necessary during manufacturing to start the netdcucfg.

    How do you do other configuratons - can you add the commands there?

    Quote

    Can it be set using the WinNDCUCfg?

    Why not?


    Quote

    Another question: Is it possible to give different users different access rights to folders inside the NetDCUA5?

    Not for the general system but for FTPD, refer https://msdn.microsoft.com/en-us/library/ms881875.aspx -> userlist

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • THANK YOU for your answer.


    How do you do other configuratons - can you add the commands there?


    We just run the WinNDCUCfg to make all neccessary registry settings and copy the files neccessary for the application into the FFSDISK folder. That's all.


    Why not?


    How can I use the WinNDCUCfg to set the usernames and passwords for the FTP?


    Not for the general system but for FTPD, refer msdn.microsoft.com/en-us/library/ms881875.aspx -> userlist


    This works fine for users without a Password. It would be exactly what I am looking for if I could set a password for each user. Is this possible? How?
    I used the registry entry and I tried to create a user with a password by setting this registry entry to "user:password". But this does not work.

    THANKS
    Dirk

  • Hello,
    please refer https://fs-net.de/assets/downl…/en/NetDCU_FTP_Server.pdf and MSDN.

    Quote

    How can I use the WinNDCUCfg to set the usernames and passwords for the FTP?

    In the same way a via nducfg, did you tried:
    "user create <user> <pw>" then set "AllowAnonymous" to zero.


    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.