Announcement

Collapse
No announcement yet.

bug when using ltrx_tcp_connect with a bridge.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • bug when using ltrx_tcp_connect with a bridge.

    Hi,

    I'm working with the SDK and I think there may be a bug in the firmware of the xPico250. I'm trying to setup a TCP connection (as a client) with an remote device while a bridge is configured. But the function ltrx_tcp_connect doesn't work and the system reboot. When I disable the bridge, this doesn't happen.

    I've try the other way around (xPico as a server) and I haven't seen this problem.

    Here are the file that may help to see the problem.

    // ####################### modules.make NOT WORKING ###############

    MODULE_NAMES := \
    main \
    test \
    bridge \

    // ####################### modules.make WORKING ###############

    MODULE_NAMES := \
    main \
    test \


    //##################### test.c #################

    #include "test_module_defs.h" /* Automatically generated by make. */
    #include "ltrx_line.h" /* Delivered with SDK. */
    #include "ltrx_compile_defines.h" /* Delivered with SDK. */
    #include "ltrx_stream.h" /* Delivered with SDK. */
    #include "ltrx_tlog.h" /* Delivered with SDK. */

    #include "ltrx_network.h"


    bool StartSerial(uint16_t);
    void StopSerial(uint16_t);


    static const struct ltrx_line_protocol infoProtocol =
    {
    .protocolName = "TestLine",
    .helpHtml = "Programme de test",
    .startProtocol = StartSerial,
    .stopProtocol = StopSerial
    };

    struct ltrx_ip_socket *sockTest;

    bool SerieInitialized = false;


    void test_module_registration(void)
    {
    ltrx_module_register(&g_testModuleInfo);
    ltrx_line_register_protocol(&infoProtocol);


    TLOG(TLOG_SEVERITY_LEVEL__INFORMATIONAL, "Enregistrement du module");
    }

    void test_module_startup(void)
    {

    TLOG(TLOG_SEVERITY_LEVEL__DEBUG, "Waiting...");

    while(!SerieInitialized)
    {
    ltrx_thread_sleep(100);
    }
    sockTest = NULL;

    ltrx_thread_sleep(30000);
    TLOG(TLOG_SEVERITY_LEVEL__DEBUG, "GO");
    sockTest = ltrx_tcp_connect(0, "192.168.0.6", 12440, NULL);
    TLOG(TLOG_SEVERITY_LEVEL__DEBUG, "YEAH!");
    }

    void test_module_shutdown(void)
    { }

    bool StartSerial(uint16_t idLine)
    {
    (void)idLine;
    TLOG(TLOG_SEVERITY_LEVEL__INFORMATIONAL, "Debut de la connexion serie");
    SerieInitialized = true;
    return true;
    }

    void StopSerial(uint16_t idLine)
    {
    TLOG(TLOG_SEVERITY_LEVEL__INFORMATIONAL, "Fermeture de la connexion serie.");
    ltrx_line_purge(idLine);
    }

    // ####################### cfiles.make ##########################

    CFILES := \
    $(MY_DIR)/test.c \


    // ####################### Config change ########################
    <!-- Automatically generated XML -->

    <configrecord version = "0.1.0.1">
    <configgroup name = "Access Point" instance = "ap0">
    <configitem name = "SSID">
    <value>xPico250RW1</value>
    </configitem>
    </configgroup>
    <configgroup name = "CPM">
    <configitem name = "Role" instance = "SPI.CS">
    <value name = "CP">8</value>
    </configitem>
    <configitem name = "Role" instance = "SPI.MISO">
    <value name = "CP">3</value>
    </configitem>
    <configitem name = "Role" instance = "SPI.MOSI">
    <value name = "CP">4</value>
    </configitem>
    <configitem name = "Role" instance = "SPI.SCK">
    <value name = "CP">7</value>
    </configitem>
    </configgroup>
    <configgroup name = "HTTP Server">
    <configitem name = "Authentication Timeout">
    <value>1 hour</value>
    </configitem>
    <configitem name = "Inactivity Timeout">
    <value>30 minutes</value>
    </configitem>
    </configgroup>
    <configgroup name = "Interface" instance = "ap0">
    <configitem name = "IP Address">
    <value>192.168.0.1/24</value>
    </configitem>
    </configgroup>
    <configgroup name = "Interface" instance = "eth0">
    <configitem name = "DHCP Client">
    <value>Disabled</value>
    </configitem>
    <configitem name = "IP Address">
    <value>192.168.0.2/24</value>
    </configitem>
    <configitem name = "Hostname">
    <value>RaycoBtModule</value>
    </configitem>
    <configitem name = "Priority">
    <value>2</value>
    </configitem>
    </configgroup>
    <configgroup name = "Interface" instance = "wlan0">
    <configitem name = "State">
    <value>Disabled</value>
    </configitem>
    </configgroup>
    <configgroup name = "Line" instance = "1">
    <configitem name = "Protocol">
    <value>BluetoothScan</value>
    </configitem>
    </configgroup>
    <configgroup name = "OEM">
    <configitem name = "Interface" instance = "ap0">
    <value name = "MAC Address">00 80 A3 CD 15 9C</value>
    </configitem>
    <configitem name = "Interface" instance = "eth0">
    <value name = "MAC Address">00 80 A3 CD 15 9B</value>
    </configitem>
    <configitem name = "Interface" instance = "wlan0">
    <value name = "MAC Address">00 80 A3 CD 15 9C</value>
    </configitem>
    <configitem name = "SKU">
    <value>XPC250100</value>
    </configitem>
    </configgroup>
    <configgroup name = "User" instance = "admin">
    <configitem name = "Password">
    <value>&lt;Configured&gt;</value>
    </configitem>
    <configitem name = "Privilege">
    <value>Admin</value>
    </configitem>
    </configgroup>
    <configgroup name = "Bridge">
    <configitem name = "Interface">
    <value>ap0</value>
    </configitem>
    <configitem name = "Ethernet">
    <value name = "Mode">Dynamic</value>
    <value name = "MAC Address"></value>
    </configitem>
    </configgroup>
    </configrecord>
    // ###############################################



    If there is no problem there could you tell me what I'm doing wrong?

    Thanks,

    Have a nice day!
    Last edited by vchartier; 07-11-2018, 05:46 PM.

  • #2
    I just tried your code with the 1.9.0.0R4 SDK and can't replicate the reboot when changing to the TestLine protocol. Can you try the new SDK that I posted in the New Releases forum? Make sure to backup anything that you have in the custom directory prior to installing the new SDK.

    Comment


    • #3
      Ok, well, I've since found that the problem occur just when i'm trying to connect to a WinCE PC.
      I've try with the firmware 1.7.0.1R7 and 1.9.0.0R4 and with the SDK 1.7.0.1R7 and 1.9.0.0R4. I've always the same result without any log.

      Comment


      • #4
        Alright, So to those who might want to know the solution. Currently, the SDK didn't allow for more then one device connected to the LAN port. I was using a switch to connect both my PC and WinCE device. The bridge was configured with a dynamic MAC address. Since I was using my PC to get the log from the web interface, the dynamic address was always set to my PC. When I wanted to connect my WinCE to the xPico,it rebooted to change the MAC for the WinCE device.

        So I could have avoid all that by setting a static MAC address for the bridge.

        Comment

        Working...
        X