• AVR Freaks

Hot!Send/receive frame (octet) using MPLAB harmony

Author
KokuH
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2018/05/07 08:45:14
  • Location: France
  • Status: offline
2018/09/28 05:27:51 (permalink)
0

Send/receive frame (octet) using MPLAB harmony

Hello,
I have a card PIC32 Ethernet Starter Kit II (PIC32MX795F512L) I use and MPLAB X IDE v4.20 with MPLAB Harmony v2_06.
I would like to create a client/server code to send/receive frames (bytes) between a Raspberry PI and my ESK II card. the Raspberry PI, the ESK II and my computer are connected on the same network with RJ45 cables using a switch.
To do this, I was advised to use MPLAB Harmony demo berkeley_tcp_server .
I created a client program with python on the RPI and I executed the berkeley_tcp_server project for ESK II, my python code allows to send 'Hello' to the same port as the ESK II, the berkeley_tcp_server program allows it to take what is received in the buffer and returned to the port .... so on the shell of python I get 'Hello'

I would like to send a data frame (bytes) for example ([0x7E, 0x18, 0x01, ...]) from the ESK II to the RPI.

:?: I tried to modify the code but I still receive errors, someone would have indications (codes, links, documentation ...)?

Here is the server code of the demo:
 
#include "app.h"

#include "tcpip/tcpip.h"

#include <errno.h>
#include <sys/errno.h>

#define SERVER_PORT 9760
// *****************************************************************************
// *****************************************************************************
// Section: Global Data Definitions
// *****************************************************************************
// *****************************************************************************

// *****************************************************************************
/* Application Data

  Summary:
    Holds application data

  Description:
    This structure holds the application's data.

  Remarks:
    This structure should be initialized by the APP_Initialize function.
    
    Application strings and buffers are be defined outside this structure.
 */

APP_DATA appData;


// *****************************************************************************
// *****************************************************************************
// Section: Application Callback Functions
// *****************************************************************************
// *****************************************************************************

/* TODO: Add any necessary callback functions.
 */


// *****************************************************************************
// *****************************************************************************
// Section: Application Local Functions
// *****************************************************************************
// *****************************************************************************

/* TODO: Add any necessary local functions.
 */


// *****************************************************************************
// *****************************************************************************
// Section: Application Initialization and State Machine Functions
// *****************************************************************************
// *****************************************************************************

/*******************************************************************************
  Function:
    void APP_Initialize ( void )

  Remarks:
    See prototype in app.h.
 */

void APP_Initialize(void) {
    /* Place the App state machine in its initial state. */
    appData.state = APP_TCPIP_WAIT_INIT;

    /* TODO: Initialize your application's state machine and other
     * parameters.
     */
}

/******************************************************************************
  Function:
    void APP_Tasks ( void )

  Remarks:
    See prototype in app.h.
 */

void APP_Tasks(void) {
    SYS_STATUS tcpipStat;
    const char *netName, *netBiosName;
    int i, nNets;
    TCPIP_NET_HANDLE netH;


    SYS_CMD_READY_TO_READ();
    switch (appData.state) {
        case APP_TCPIP_WAIT_INIT:
            tcpipStat = TCPIP_STACK_Status(sysObj.tcpip);
            if (tcpipStat < 0) { // some error occurred
                SYS_CONSOLE_MESSAGE(" APP: TCP/IP stack initialization failed!\r\n");
                appData.state = APP_TCPIP_ERROR;
            } else if (tcpipStat == SYS_STATUS_READY) {
                // now that the stack is ready we can check the
                // available interfaces
                nNets = TCPIP_STACK_NumberOfNetworksGet();

                for (i = 0; i < nNets; i++) {

                    netH = TCPIP_STACK_IndexToNet(i);
                    netName = TCPIP_STACK_NetNameGet(netH);
                    netBiosName = TCPIP_STACK_NetBIOSName(netH);

#if defined(TCPIP_STACK_USE_NBNS)
                    SYS_CONSOLE_PRINT(" Interface %s on host %s - NBNS enabled\r\n", netName, netBiosName);
#else
                    SYS_CONSOLE_PRINT(" Interface %s on host %s - NBNS disabled\r\n", netName, netBiosName);
#endif // defined(TCPIP_STACK_USE_NBNS)

                }

                appData.state = APP_TCPIP_WAIT_FOR_IP;
            }

            break;

        case APP_TCPIP_WAIT_FOR_IP:
            nNets = TCPIP_STACK_NumberOfNetworksGet();
            for (i = 0; i < nNets; i++) {
                netH = TCPIP_STACK_IndexToNet(i);
                if (!TCPIP_STACK_NetIsReady(netH)) {
                    return; // interface not ready yet!
                }
                IPV4_ADDR ipAddr;
                ipAddr.Val = TCPIP_STACK_NetAddress(netH);
                SYS_CONSOLE_MESSAGE(TCPIP_STACK_NetNameGet(netH));
                SYS_CONSOLE_MESSAGE(" IP Address: ");
                SYS_CONSOLE_PRINT("%d.%d.%d.%d \r\n", ipAddr.v[0], ipAddr.v[1], ipAddr.v[2], ipAddr.v[3]);
            }
            // all interfaces ready. Could start transactions!!!
            appData.state = APP_BSD_INIT;
            //... etc.
            break;
        case APP_BSD_INIT:
        {
            // Initialize all client socket handles so that we don't process
            // them in the BSD_OPERATION state
            for (i = 0; i < MAX_CLIENT; i++)
                appData.ClientSock[i] = INVALID_SOCKET;

            appData.state = APP_BSD_CREATE_SOCKET;

        }
            break;

        case APP_BSD_CREATE_SOCKET:
        {
            // Create a socket for this server to listen and accept connections on
            SOCKET tcpSkt = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
            if (tcpSkt == INVALID_SOCKET)
                return;
            appData.bsdServerSocket = (SOCKET) tcpSkt;

            appData.state = APP_BSD_BIND;
        }
            break;

        case APP_BSD_BIND:
        {
            // Bind socket to a local port
            struct sockaddr_in addr;
            int addrlen = sizeof (struct sockaddr_in);
            addr.sin_port = SERVER_PORT;
            addr.sin_addr.S_un.S_addr = IP_ADDR_ANY;
            if (bind(appData.bsdServerSocket, (struct sockaddr*) &addr, addrlen) == SOCKET_ERROR)
                return;

            appData.state = APP_BSD_LISTEN;
            // No break needed
        }
            break;

        case APP_BSD_LISTEN:
        {
            if (listen(appData.bsdServerSocket, MAX_CLIENT) == 0) {
                appData.state = APP_BSD_OPERATION;
                SYS_CONSOLE_PRINT("Waiting for Client Connection on port: %d\r\n", SERVER_PORT);
            }
        }
            break;
        case APP_BSD_OPERATION:
        {
            int length;
            struct sockaddr_in addRemote;
            int addrlen = sizeof (struct sockaddr_in);
            char buffer[15];
            

            for (i = 0; i < MAX_CLIENT; i++) {
                // Accept any pending connection requests, assuming we have a place to store the socket descriptor
                if (appData.ClientSock[i] == INVALID_SOCKET)
                    appData.ClientSock[i] = accept(appData.bsdServerSocket, (struct sockaddr*) &addRemote, &addrlen);

                // If this socket is not connected then no need to process anything
                if (appData.ClientSock[i] == INVALID_SOCKET)
                    continue;

                // For all connected sockets, receive and send back the data
                length = recv(appData.ClientSock[i], buffer, sizeof (buffer), 0);

                if (length > 0) {
                    buffer[length] = '\0';
                    send(appData.ClientSock[i], buffer, strlen(buffer), 0);
                }
                // else just wait for some more data
            }
        }
            break;
        default:
            break;
    }
}
/*******************************************************************************
 End of File
 */

#1

11 Replies Related Threads

    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/09/28 05:56:50 (permalink)
    5 (1)
    KokuH
    ...
    :?: I tried to modify the code but I still receive errors,
    ....

    ... and you don't feel any desire to share what modifications you made, or what those reported errors were?
     

    Nearly there...
    #2
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/10/02 04:56:58 (permalink)
    0
    Hello,
     
    I managed to send bytes with this program, but I still have two problems:
     
    The first is that I send bytes (see the code below) but what I receive on the client side is coded in ascii, so I send for example: char buffer2 [100] = {0x7e , 0x7e, 0x74}; I receive on the client side: ~~ t
     
    The second, I do not know if it's in the app.c code or in the project settings, in fact, when I load the program on the server side (PIC) I wait for it to load completely, then I run the client side program (RPI) and what happens is that the client gets to communicate with the server only 3 times ... I run my client program 1 time, the communication goes well, I run a 2nd and 3rd time, the communication is always good, but when I execute for the 4th time, there is more communication, to have a new communication, I have reloaded the program on the server side (PIC)!
     
    Here is the program to send a byte frame:
    /*******************************************************************************
    Function:
    void APP_Initialize ( void )

    Remarks:
    See prototype in app.h.
    */

    void APP_Initialize(void) {
    /* Place the App state machine in its initial state. */
    appData.state = APP_TCPIP_WAIT_INIT;

    /* TODO: Initialize your application's state machine and other
    * parameters.
    */
    }

    /******************************************************************************
    Function:
    void APP_Tasks ( void )

    Remarks:
    See prototype in app.h.
    */

    void APP_Tasks(void) {
    SYS_STATUS tcpipStat;
    const char *netName, *netBiosName;
    int i, nNets;
    TCPIP_NET_HANDLE netH;


    SYS_CMD_READY_TO_READ();
    switch (appData.state) {
    case APP_TCPIP_WAIT_INIT:
    tcpipStat = TCPIP_STACK_Status(sysObj.tcpip);
    if (tcpipStat < 0) { // some error occurred
    SYS_CONSOLE_MESSAGE(" APP: TCP/IP stack initialization failed!\r\n");
    appData.state = APP_TCPIP_ERROR;
    } else if (tcpipStat == SYS_STATUS_READY) {
    // now that the stack is ready we can check the
    // available interfaces
    nNets = TCPIP_STACK_NumberOfNetworksGet();

    for (i = 0; i < nNets; i++) {

    netH = TCPIP_STACK_IndexToNet(i);
    netName = TCPIP_STACK_NetNameGet(netH);
    netBiosName = TCPIP_STACK_NetBIOSName(netH);

    #if defined(TCPIP_STACK_USE_NBNS)
    SYS_CONSOLE_PRINT(" Interface %s on host %s - NBNS enabled\r\n", netName, netBiosName);
    #else
    SYS_CONSOLE_PRINT(" Interface %s on host %s - NBNS disabled\r\n", netName, netBiosName);
    #endif // defined(TCPIP_STACK_USE_NBNS)

    }

    appData.state = APP_TCPIP_WAIT_FOR_IP;
    }

    break;

    case APP_TCPIP_WAIT_FOR_IP:
    nNets = TCPIP_STACK_NumberOfNetworksGet();
    for (i = 0; i < nNets; i++) {
    netH = TCPIP_STACK_IndexToNet(i);
    if (!TCPIP_STACK_NetIsReady(netH)) {
    return; // interface not ready yet!
    }
    IPV4_ADDR ipAddr;
    ipAddr.Val = TCPIP_STACK_NetAddress(netH);
    SYS_CONSOLE_MESSAGE(TCPIP_STACK_NetNameGet(netH));
    SYS_CONSOLE_MESSAGE(" IP Address: ");
    SYS_CONSOLE_PRINT("%d.%d.%d.%d \r\n", ipAddr.v[0], ipAddr.v[1], ipAddr.v[2], ipAddr.v[3]);
    }
    // all interfaces ready. Could start transactions!!!
    appData.state = APP_BSD_INIT;
    //... etc.
    break;
    case APP_BSD_INIT:
    {
    // Initialize all client socket handles so that we don't process
    // them in the BSD_OPERATION state
    for (i = 0; i < MAX_CLIENT; i++)
    appData.ClientSock[i] = INVALID_SOCKET;

    appData.state = APP_BSD_CREATE_SOCKET;

    }
    break;

    case APP_BSD_CREATE_SOCKET:
    {
    // Create a socket for this server to listen and accept connections on
    SOCKET tcpSkt = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if (tcpSkt == INVALID_SOCKET)
    return;
    appData.bsdServerSocket = (SOCKET) tcpSkt;

    appData.state = APP_BSD_BIND;
    }
    break;

    case APP_BSD_BIND:
    {
    // Bind socket to a local port
    struct sockaddr_in addr;
    int addrlen = sizeof (struct sockaddr_in);
    addr.sin_port = SERVER_PORT;
    addr.sin_addr.S_un.S_addr = IP_ADDR_ANY;
    if (bind(appData.bsdServerSocket, (struct sockaddr*) &addr, addrlen) == SOCKET_ERROR)
    return;

    appData.state = APP_BSD_LISTEN;
    // No break needed
    }
    break;

    case APP_BSD_LISTEN:
    {
    if (listen(appData.bsdServerSocket, MAX_CLIENT) == 0) {
    appData.state = APP_BSD_OPERATION;
    SYS_CONSOLE_PRINT("Waiting for Client Connection on port: %d\r\n", SERVER_PORT);
    }
    }
    break;
    case APP_BSD_OPERATION:
    {
    int length;
    struct sockaddr_in addRemote;
    int addrlen = sizeof (struct sockaddr_in);
    char buffer[100];
    //uint8_t buffer2[100]={'0','x','7','E'};
    //char buffer2[100]={0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x00};
    char buffer2[100]={0x7e,0x7e,0x74}; //frame
    //buffer2[7]={10,20,30,40,50,60,70};

    for (i = 0; i < MAX_CLIENT; i++) {
    // Accept any pending connection requests, assuming we have a place to store the socket descriptor
    if (appData.ClientSock[i] == INVALID_SOCKET)
    appData.ClientSock[i] = accept(appData.bsdServerSocket, (struct sockaddr*) &addRemote, &addrlen);

    // If this socket is not connected then no need to process anything
    if (appData.ClientSock[i] == INVALID_SOCKET)
    continue;

    // For all connected sockets, receive and send back the data
    length = recv(appData.ClientSock[i], buffer, sizeof (buffer), 0);

    if (length > 0) {
    buffer[length] = '\0';
    // send(appData.ClientSock[i], buffer, strlen(buffer), 0);
    send(appData.ClientSock[i], buffer2, strlen(buffer2), 0);

    }
    // else just wait for some more data
    }
    }
    break;
    default:
    break;
    }
    }
    /*******************************************************************************
    End of File
    */

     

     
    What is the problem in both cases?
    #3
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/10/02 05:07:15 (permalink)
    0
    Regarding the project settings with MPLAB Harmony, I do not know what changed to have an open socket and port without limit, to remove the condition of 3 connections only!
    Here is the code of the file system_config.h: (maybe you'll see you quickly where you have to change the configration)
    /*******************************************************************************
    MPLAB Harmony System Configuration Header

    File Name:
    system_config.h

    Summary:
    Build-time configuration header for the system defined by this MPLAB Harmony
    project.

    Description:
    An MPLAB Project may have multiple configurations. This file defines the
    build-time options for a single configuration.

    Remarks:
    This configuration header must not define any prototypes or data
    definitions (or include any files that do). It only provides macro
    definitions for build-time configuration options that are not instantiated
    until used by another MPLAB Harmony module or application.

    Created with MPLAB Harmony Version 2.04
    *******************************************************************************/

    // DOM-IGNORE-BEGIN
    /*******************************************************************************
    Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.

    Microchip licenses to you the right to use, modify, copy and distribute
    Software only when embedded on a Microchip microcontroller or digital signal
    controller that is integrated into your product or third party product
    (pursuant to the sublicense terms in the accompanying license agreement).

    You should refer to the license agreement accompanying this Software for
    additional information regarding your rights and obligations.

    SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
    EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
    MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
    IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
    CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
    OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
    INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
    CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
    SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
    (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
    *******************************************************************************/
    // DOM-IGNORE-END

    #ifndef _SYSTEM_CONFIG_H
    #define _SYSTEM_CONFIG_H

    // *****************************************************************************
    // *****************************************************************************
    // Section: Included Files
    // *****************************************************************************
    // *****************************************************************************
    /* This section Includes other configuration headers necessary to completely
    define this configuration.
    */
    #include "bsp.h"


    // DOM-IGNORE-BEGIN
    #ifdef __cplusplus // Provide C++ Compatibility

    extern "C" {

    #endif
    // DOM-IGNORE-END

    // *****************************************************************************
    // *****************************************************************************
    // Section: System Service Configuration
    // *****************************************************************************
    // *****************************************************************************
    // *****************************************************************************
    /* Common System Service Configuration Options
    */
    #define SYS_VERSION_STR "2.04"
    #define SYS_VERSION 20400

    // *****************************************************************************
    /* Clock System Service Configuration Options
    */
    #define SYS_CLK_FREQ 80000000ul
    #define SYS_CLK_BUS_PERIPHERAL_1 80000000ul
    #define SYS_CLK_UPLL_BEFORE_DIV2_FREQ 48000000ul
    #define SYS_CLK_CONFIG_PRIMARY_XTAL 8000000ul
    #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul

    /*** Ports System Service Configuration ***/
    #define SYS_PORT_AD1PCFG ~0xffdf
    #define SYS_PORT_CNPUE 0x98000
    #define SYS_PORT_CNEN 0x0
    #define SYS_PORT_A_TRIS 0xFFFF
    #define SYS_PORT_A_LAT 0x0000
    #define SYS_PORT_A_ODC 0x0000

    #define SYS_PORT_B_TRIS 0xFFDF
    #define SYS_PORT_B_LAT 0x0000
    #define SYS_PORT_B_ODC 0x0000

    #define SYS_PORT_C_TRIS 0xFFFF
    #define SYS_PORT_C_LAT 0x0000
    #define SYS_PORT_C_ODC 0x0000

    #define SYS_PORT_D_TRIS 0xFFF8
    #define SYS_PORT_D_LAT 0x0000
    #define SYS_PORT_D_ODC 0x0000

    #define SYS_PORT_E_TRIS 0xFFFF
    #define SYS_PORT_E_LAT 0x0000
    #define SYS_PORT_E_ODC 0x0000

    #define SYS_PORT_F_TRIS 0xFFFF
    #define SYS_PORT_F_LAT 0x0000
    #define SYS_PORT_F_ODC 0x0000

    #define SYS_PORT_G_TRIS 0xFFFF
    #define SYS_PORT_G_LAT 0x0000
    #define SYS_PORT_G_ODC 0x0000


    /*** Command Processor System Service Configuration ***/
    #define SYS_CMD_ENABLE
    #define SYS_CMD_DEVICE_MAX_INSTANCES SYS_CONSOLE_DEVICE_MAX_INSTANCES
    #define SYS_CMD_PRINT_BUFFER_SIZE 512
    #define SYS_CMD_BUFFER_DMA_READY
    #define SYS_CMD_REMAP_SYS_CONSOLE_MESSAGE
    #define SYS_CMD_REMAP_SYS_DEBUG_MESSAGE

    /*** Console System Service Configuration ***/

    #define SYS_CONSOLE_OVERRIDE_STDIO
    #define SYS_CONSOLE_DEVICE_MAX_INSTANCES 2
    #define SYS_CONSOLE_INSTANCES_NUMBER 1
    #define SYS_CONSOLE_USB_CDC_INSTANCE USB_DEVICE_CDC_INDEX_0
    #define SYS_CONSOLE_USB_CDC_COMM_BAUD_RATE 921600
    #define SYS_CONSOLE_USB_CDC_RD_QUEUE_DEPTH 1
    #define SYS_CONSOLE_USB_CDC_WR_QUEUE_DEPTH 32
    #define SYS_CONSOLE_USB_CDC_READ_BUFFER_SIZE 64
    #define SYS_CONSOLE_BUFFER_DMA_READY

     

    /*** Debug System Service Configuration ***/
    #define SYS_DEBUG_ENABLE
    #define DEBUG_PRINT_BUFFER_SIZE 512
    #define SYS_DEBUG_BUFFER_DMA_READY
    #define SYS_DEBUG_USE_CONSOLE

    /*** Interrupt System Service Configuration ***/
    #define SYS_INT true
    // *****************************************************************************
    /* Random System Service Configuration Options
    */

    #define SYS_RANDOM_CRYPTO_SEED_SIZE 32

    /*** Timer System Service Configuration ***/
    #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
    #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
    #define SYS_TMR_MAX_CLIENT_OBJECTS 5
    #define SYS_TMR_FREQUENCY 1000
    #define SYS_TMR_FREQUENCY_TOLERANCE 10
    #define SYS_TMR_UNIT_RESOLUTION 10000
    #define SYS_TMR_CLIENT_TOLERANCE 10
    #define SYS_TMR_INTERRUPT_NOTIFICATION false

    // *****************************************************************************
    // *****************************************************************************
    // Section: Driver Configuration
    // *****************************************************************************
    // *****************************************************************************

    /*** MIIM Driver Configuration ***/
    #define DRV_MIIM_ETH_MODULE_ID ETH_ID_0
    #define DRV_MIIM_INSTANCES_NUMBER 1
    #define DRV_MIIM_INSTANCE_OPERATIONS 4
    #define DRV_MIIM_INSTANCE_CLIENTS 2
    #define DRV_MIIM_CLIENT_OP_PROTECTION false
    #define DRV_MIIM_COMMANDS false
    #define DRV_MIIM_DRIVER_OBJECT DRV_MIIM_OBJECT_BASE_Default
    #define DRV_MIIM_DRIVER_INDEX DRV_MIIM_INDEX_0
    /*** Timer Driver Configuration ***/
    #define DRV_TMR_INTERRUPT_MODE true
    #define DRV_TMR_INSTANCES_NUMBER 1
    #define DRV_TMR_CLIENTS_NUMBER 1

    /*** Timer Driver 0 Configuration ***/
    #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_1
    #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_1
    #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T1
    #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_1_VECTOR
    #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL1
    #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
    #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
    #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_256
    #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
    #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
    #define DRV_TMR_POWER_STATE_IDX0 SYS_MODULE_POWER_RUN_FULL


    // *****************************************************************************
    // *****************************************************************************
    // Section: Middleware & Other Library Configuration
    // *****************************************************************************
    // *****************************************************************************
    /*** Crypto Library Configuration ***/

    #define WC_NO_HARDEN
    #define MICROCHIP_MPLAB_HARMONY
    #define HAVE_MCAPI
    #define MICROCHIP_PIC32
    #define NO_CERTS
    #define NO_PWDBASED
    #define NO_OLD_TLS
    #define NO_SHA
    #define NO_AES
    #define NO_ASN
    #define NO_RSA

    /* MPLAB Harmony Net Presentation Layer Definitions*/
    #define NET_PRES_NUM_INSTANCE 1
    #define NET_PRES_NUM_SOCKETS 10

     

    // *****************************************************************************
    // *****************************************************************************
    // Section: TCPIP Stack Configuration
    // *****************************************************************************
    // *****************************************************************************
    #define TCPIP_STACK_USE_IPV4
    #define TCPIP_STACK_USE_TCP
    #define TCPIP_STACK_USE_UDP

    #define TCPIP_STACK_TICK_RATE 5
    #define TCPIP_STACK_SECURE_PORT_ENTRIES 10

    #define TCPIP_STACK_ALIAS_INTERFACE_SUPPORT false

    #define TCPIP_PACKET_LOG_ENABLE 0

    /* TCP/IP stack event notification */
    #define TCPIP_STACK_USE_EVENT_NOTIFICATION
    #define TCPIP_STACK_USER_NOTIFICATION false
    #define TCPIP_STACK_DOWN_OPERATION true
    #define TCPIP_STACK_IF_UP_DOWN_OPERATION true
    #define TCPIP_STACK_MAC_DOWN_OPERATION true
    #define TCPIP_STACK_INTERFACE_CHANGE_SIGNALING false
    #define TCPIP_STACK_CONFIGURATION_SAVE_RESTORE true
    /*** TCPIP Heap Configuration ***/

    #define TCPIP_STACK_USE_INTERNAL_HEAP
    #define TCPIP_STACK_DRAM_SIZE 39250
    #define TCPIP_STACK_DRAM_RUN_LIMIT 2048

    #define TCPIP_STACK_MALLOC_FUNC malloc

    #define TCPIP_STACK_CALLOC_FUNC calloc

    #define TCPIP_STACK_FREE_FUNC free

     

    #define TCPIP_STACK_HEAP_USE_FLAGS TCPIP_STACK_HEAP_FLAG_ALLOC_UNCACHED

    #define TCPIP_STACK_HEAP_USAGE_CONFIG TCPIP_STACK_HEAP_USE_DEFAULT

    #define TCPIP_STACK_SUPPORTED_HEAPS 1

    /*** ARP Configuration ***/
    #define TCPIP_ARP_CACHE_ENTRIES 5
    #define TCPIP_ARP_CACHE_DELETE_OLD true
    #define TCPIP_ARP_CACHE_SOLVED_ENTRY_TMO 1200
    #define TCPIP_ARP_CACHE_PENDING_ENTRY_TMO 60
    #define TCPIP_ARP_CACHE_PENDING_RETRY_TMO 2
    #define TCPIP_ARP_CACHE_PERMANENT_QUOTA 50
    #define TCPIP_ARP_CACHE_PURGE_THRESHOLD 75
    #define TCPIP_ARP_CACHE_PURGE_QUANTA 1
    #define TCPIP_ARP_CACHE_ENTRY_RETRIES 3
    #define TCPIP_ARP_GRATUITOUS_PROBE_COUNT 1
    #define TCPIP_ARP_TASK_PROCESS_RATE 2
    #define TCPIP_ARP_PRIMARY_CACHE_ONLY true

    /*** Berkeley API Configuration ***/
    #define TCPIP_STACK_USE_BERKELEY_API
    #define MAX_BSD_SOCKETS 4
    #define TCPIP_STACK_USE_BERKELEY_API
    /*** DHCP Configuration ***/
    #define TCPIP_STACK_USE_DHCP_CLIENT
    #define TCPIP_DHCP_TIMEOUT 2
    #define TCPIP_DHCP_TASK_TICK_RATE 5
    #define TCPIP_DHCP_HOST_NAME_SIZE 20
    #define TCPIP_DHCP_CLIENT_CONNECT_PORT 68
    #define TCPIP_DHCP_SERVER_LISTEN_PORT 67
    #define TCPIP_DHCP_CLIENT_ENABLED true


    /*** DNS Client Configuration ***/
    #define TCPIP_STACK_USE_DNS
    #define TCPIP_DNS_CLIENT_SERVER_TMO 60
    #define TCPIP_DNS_CLIENT_TASK_PROCESS_RATE 200
    #define TCPIP_DNS_CLIENT_CACHE_ENTRIES 5
    #define TCPIP_DNS_CLIENT_CACHE_ENTRY_TMO 0
    #define TCPIP_DNS_CLIENT_CACHE_PER_IPV4_ADDRESS 5
    #define TCPIP_DNS_CLIENT_CACHE_PER_IPV6_ADDRESS 1
    #define TCPIP_DNS_CLIENT_ADDRESS_TYPE IP_ADDRESS_TYPE_IPV4
    #define TCPIP_DNS_CLIENT_CACHE_DEFAULT_TTL_VAL 1200
    #define TCPIP_DNS_CLIENT_CACHE_UNSOLVED_ENTRY_TMO 10
    #define TCPIP_DNS_CLIENT_LOOKUP_RETRY_TMO 5
    #define TCPIP_DNS_CLIENT_MAX_HOSTNAME_LEN 32
    #define TCPIP_DNS_CLIENT_MAX_SELECT_INTERFACES 4
    #define TCPIP_DNS_CLIENT_DELETE_OLD_ENTRIES true
    #define TCPIP_DNS_CLIENT_USER_NOTIFICATION false

     

     


    /*** NBNS Configuration ***/
    #define TCPIP_STACK_USE_NBNS
    #define TCPIP_NBNS_TASK_TICK_RATE 110

     

     

     

    /*** TCP Configuration ***/
    #define TCPIP_TCP_MAX_SEG_SIZE_TX 1460
    #define TCPIP_TCP_SOCKET_DEFAULT_TX_SIZE 512
    #define TCPIP_TCP_SOCKET_DEFAULT_RX_SIZE 512
    #define TCPIP_TCP_DYNAMIC_OPTIONS true
    #define TCPIP_TCP_START_TIMEOUT_VAL 1000
    #define TCPIP_TCP_DELAYED_ACK_TIMEOUT 100
    #define TCPIP_TCP_FIN_WAIT_2_TIMEOUT 5000
    #define TCPIP_TCP_KEEP_ALIVE_TIMEOUT 10000
    #define TCPIP_TCP_CLOSE_WAIT_TIMEOUT 0
    #define TCPIP_TCP_MAX_RETRIES 5
    #define TCPIP_TCP_MAX_UNACKED_KEEP_ALIVES 6
    #define TCPIP_TCP_MAX_SYN_RETRIES 3
    #define TCPIP_TCP_AUTO_TRANSMIT_TIMEOUT_VAL 40
    #define TCPIP_TCP_WINDOW_UPDATE_TIMEOUT_VAL 200
    #define TCPIP_TCP_MAX_SOCKETS 10
    #define TCPIP_TCP_TASK_TICK_RATE 5
    #define TCPIP_TCP_MSL_TIMEOUT 30
    #define TCPIP_TCP_QUIET_TIME 0
    #define TCPIP_TCP_COMMANDS false

    /*** announce Configuration ***/
    #define TCPIP_STACK_USE_ANNOUNCE
    #define TCPIP_ANNOUNCE_MAX_PAYLOAD 512
    #define TCPIP_ANNOUNCE_TASK_RATE 333
    #define TCPIP_ANNOUNCE_NETWORK_DIRECTED_BCAST false

    /*** TCPIP MAC Configuration ***/
    #define TCPIP_EMAC_TX_DESCRIPTORS 8
    #define TCPIP_EMAC_RX_DESCRIPTORS 6
    #define TCPIP_EMAC_RX_DEDICATED_BUFFERS 4
    #define TCPIP_EMAC_RX_INIT_BUFFERS 0
    #define TCPIP_EMAC_RX_LOW_THRESHOLD 1
    #define TCPIP_EMAC_RX_LOW_FILL 2
    #define TCPIP_EMAC_MAX_FRAME 1536
    #define TCPIP_EMAC_LINK_MTU 1500
    #define TCPIP_EMAC_RX_BUFF_SIZE 1536
    #define TCPIP_EMAC_RX_FRAGMENTS 1

    #define TCPIP_EMAC_RX_FILTERS \
    TCPIP_MAC_RX_FILTER_TYPE_BCAST_ACCEPT |\
    TCPIP_MAC_RX_FILTER_TYPE_MCAST_ACCEPT |\
    TCPIP_MAC_RX_FILTER_TYPE_UCAST_ACCEPT |\
    TCPIP_MAC_RX_FILTER_TYPE_RUNT_REJECT |\
    TCPIP_MAC_RX_FILTER_TYPE_CRC_ERROR_REJECT |\
    0
    #define TCPIP_EMAC_ETH_OPEN_FLAGS \
    TCPIP_ETH_OPEN_AUTO |\
    TCPIP_ETH_OPEN_FDUPLEX |\
    TCPIP_ETH_OPEN_HDUPLEX |\
    TCPIP_ETH_OPEN_100 |\
    TCPIP_ETH_OPEN_10 |\
    TCPIP_ETH_OPEN_MDIX_AUTO |\
    0

    #define TCPIP_EMAC_MODULE_ID ETH_ID_0
    #define TCPIP_EMAC_INTERRUPT_MODE true
    #define DRV_ETHMAC_INSTANCES_NUMBER 1
    #define DRV_ETHMAC_CLIENTS_NUMBER 1
    #define DRV_ETHMAC_INDEX 1
    #define DRV_ETHMAC_PERIPHERAL_ID 1
    #define DRV_ETHMAC_INTERRUPT_VECTOR INT_VECTOR_ETHERNET
    #define DRV_ETHMAC_INTERRUPT_SOURCE INT_SOURCE_ETH_1
    #define DRV_ETHMAC_POWER_STATE SYS_MODULE_POWER_RUN_FULL

    #define DRV_ETHMAC_INTERRUPT_MODE true


    #define TCPIP_EMAC_PHY_CONFIG_FLAGS \
    DRV_ETHPHY_CFG_AUTO | \
    0

    #define TCPIP_EMAC_PHY_LINK_INIT_DELAY 500
    #define TCPIP_EMAC_PHY_ADDRESS 0
    #define DRV_ETHPHY_INSTANCES_NUMBER 1
    #define DRV_ETHPHY_CLIENTS_NUMBER 1
    #define DRV_ETHPHY_INDEX 1
    #define DRV_ETHPHY_PERIPHERAL_ID 1
    #define DRV_ETHPHY_NEG_INIT_TMO 1
    #define DRV_ETHPHY_NEG_DONE_TMO 2000
    #define DRV_ETHPHY_RESET_CLR_TMO 500
    #define DRV_ETHPHY_USE_DRV_MIIM true
    #define TCPIP_EMAC_AUTO_FLOW_CONTROL_ENABLE true
    #define TCPIP_EMAC_FLOW_CONTROL_PAUSE_BYTES 3072
    #define TCPIP_EMAC_FLOW_CONTROL_FULL_WMARK 2
    #define TCPIP_EMAC_FLOW_CONTROL_EMPTY_WMARK 0

     

    /*** UDP Configuration ***/
    #define TCPIP_UDP_MAX_SOCKETS 10
    #define TCPIP_UDP_SOCKET_DEFAULT_TX_SIZE 512
    #define TCPIP_UDP_SOCKET_DEFAULT_TX_QUEUE_LIMIT 3
    #define TCPIP_UDP_SOCKET_DEFAULT_RX_QUEUE_LIMIT 3
    #define TCPIP_UDP_USE_POOL_BUFFERS false
    #define TCPIP_UDP_USE_TX_CHECKSUM true
    #define TCPIP_UDP_USE_RX_CHECKSUM true
    #define TCPIP_UDP_COMMANDS false

    #define TCPIP_STACK_USE_ZEROCONF_LINK_LOCAL
    #define TCPIP_ZC_LL_PROBE_WAIT 1
    #define TCPIP_ZC_LL_PROBE_MIN 1
    #define TCPIP_ZC_LL_PROBE_MAX 2
    #define TCPIP_ZC_LL_PROBE_NUM 3
    #define TCPIP_ZC_LL_ANNOUNCE_WAIT 2
    #define TCPIP_ZC_LL_ANNOUNCE_NUM 2
    #define TCPIP_ZC_LL_ANNOUNCE_INTERVAL 2
    #define TCPIP_ZC_LL_MAX_CONFLICTS 10
    #define TCPIP_ZC_LL_RATE_LIMIT_INTERVAL 60
    #define TCPIP_ZC_LL_DEFEND_INTERVAL 10
    #define TCPIP_ZC_LL_IPV4_LLBASE 0xa9fe0100
    #define TCPIP_ZC_LL_IPV4_LLBASE_MASK 0x0000FFFF
    #define TCPIP_ZC_LL_TASK_TICK_RATE 333
    /*** tcpip_cmd Configuration ***/
    #define TCPIP_STACK_COMMAND_ENABLE
    #define TCPIP_STACK_COMMANDS_ICMP_ECHO_REQUESTS 4
    #define TCPIP_STACK_COMMANDS_ICMP_ECHO_REQUEST_DELAY 1000
    #define TCPIP_STACK_COMMANDS_ICMP_ECHO_TIMEOUT 5000
    #define TCPIP_STACK_COMMANDS_WIFI_ENABLE false
    #define TCPIP_STACK_COMMANDS_ICMP_ECHO_REQUEST_BUFF_SIZE 2000
    #define TCPIP_STACK_COMMANDS_ICMP_ECHO_REQUEST_DATA_SIZE 100


    /*** IPv4 Configuration ***/

    /*** Network Configuration Index 0 ***/
    #define TCPIP_NETWORK_DEFAULT_INTERFACE_NAME_IDX0 "PIC32INT"
    #define TCPIP_IF_PIC32INT
    #define TCPIP_NETWORK_DEFAULT_HOST_NAME_IDX0 "MCHPBOARD_E"
    #define TCPIP_NETWORK_DEFAULT_MAC_ADDR_IDX0 0
    #define TCPIP_NETWORK_DEFAULT_IP_ADDRESS_IDX0 "192.168.1.23"
    #define TCPIP_NETWORK_DEFAULT_IP_MASK_IDX0 "255.255.255.0"
    #define TCPIP_NETWORK_DEFAULT_GATEWAY_IDX0 "192.168.100.1"
    #define TCPIP_NETWORK_DEFAULT_DNS_IDX0 "192.168.100.1"
    #define TCPIP_NETWORK_DEFAULT_SECOND_DNS_IDX0 "0.0.0.0"
    #define TCPIP_NETWORK_DEFAULT_POWER_MODE_IDX0 "full"
    #define TCPIP_NETWORK_DEFAULT_INTERFACE_FLAGS_IDX0 \
    TCPIP_NETWORK_CONFIG_DHCP_CLIENT_ON |\
    TCPIP_NETWORK_CONFIG_DNS_CLIENT_ON |\
    TCPIP_NETWORK_CONFIG_IP_STATIC
    #define TCPIP_NETWORK_DEFAULT_MAC_DRIVER_IDX0 DRV_ETHMAC_PIC32MACObject
    #define TCPIP_NETWORK_DEFAULT_IPV6_ADDRESS_IDX0 0
    #define TCPIP_NETWORK_DEFAULT_IPV6_PREFIX_LENGTH_IDX0 0
    #define TCPIP_NETWORK_DEFAULT_IPV6_GATEWAY_IDX0 0
    /*** USB Driver Configuration ***/


    /* Enables Device Support */
    #define DRV_USBFS_DEVICE_SUPPORT true

    /* Disable Host Support */
    #define DRV_USBFS_HOST_SUPPORT false

    /* Maximum USB driver instances */
    #define DRV_USBFS_INSTANCES_NUMBER 1

    /* Interrupt mode enabled */
    #define DRV_USBFS_INTERRUPT_MODE true


    /* Number of Endpoints used */
    #define DRV_USBFS_ENDPOINTS_NUMBER 3

     


    /*** USB Device Stack Configuration ***/

     

     

     

     


    /* The USB Device Layer will not initialize the USB Driver */
    #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT

    /* Maximum device layer instances */
    #define USB_DEVICE_INSTANCES_NUMBER 1

    /* EP0 size in bytes */
    #define USB_DEVICE_EP0_BUFFER_SIZE 64

     

     

     

     


    /* Maximum instances of CDC function driver */
    #define USB_DEVICE_CDC_INSTANCES_NUMBER 1

     

     

     

     


    /* CDC Transfer Queue Size for both read and
    write. Applicable to all instances of the
    function driver */
    #define USB_DEVICE_CDC_QUEUE_DEPTH_COMBINED 6

     

    // *****************************************************************************
    /* BSP Configuration Options
    */
    #define BSP_OSC_FREQUENCY 8000000


    // *****************************************************************************
    // *****************************************************************************
    // Section: Application Configuration
    // *****************************************************************************
    // *****************************************************************************
    /*** Application Defined Pins ***/

    /*** Functions for BSP_LED_1 pin ***/
    #define BSP_LED_1Toggle() PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_0)
    #define BSP_LED_1On() PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_0)
    #define BSP_LED_1Off() PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_0)
    #define BSP_LED_1StateGet() PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_0)

    /*** Functions for BSP_LED_2 pin ***/
    #define BSP_LED_2Toggle() PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_1)
    #define BSP_LED_2On() PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_1)
    #define BSP_LED_2Off() PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_1)
    #define BSP_LED_2StateGet() PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_1)

    /*** Functions for BSP_LED_3 pin ***/
    #define BSP_LED_3Toggle() PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_2)
    #define BSP_LED_3On() PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_2)
    #define BSP_LED_3Off() PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_2)
    #define BSP_LED_3StateGet() PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_2)

    /*** Functions for BSP_SWITCH_3 pin ***/
    #define BSP_SWITCH_3StateGet() PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_13)

    /*** Functions for BSP_SWITCH_1 pin ***/
    #define BSP_SWITCH_1StateGet() PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_6)

    /*** Functions for BSP_SWITCH_2 pin ***/
    #define BSP_SWITCH_2StateGet() PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_7)


    /*** Application Instance 0 Configuration ***/

    //DOM-IGNORE-BEGIN
    #ifdef __cplusplus
    }
    #endif
    //DOM-IGNORE-END

    #endif // _SYSTEM_CONFIG_H
    /*******************************************************************************
    End of File
    */

     
    Thank you 
     
    #4
    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/10/02 05:23:26 (permalink)
    5 (1)
    KokuH
    ...
    The first is that I send bytes (see the code below) but what I receive on the client side is coded in ascii, so I send for example: char buffer2 [100] = {0x7e , 0x7e, 0x74}; I receive on the client side: ~~ t

    What is the problem?
    That is exactly the same data viewed in different ways.
    You don't have a communication problem, just an interpretation problem.
     
     

    Nearly there...
    #5
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/10/02 05:39:35 (permalink)
    0
    Okay, so I'm going to create a program on the client side to decode this data.
    And for the second problem? What do you think?
    #6
    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/10/02 05:47:43 (permalink)
    5 (1)
    No idea. I've never used that stack, which is why I left it for other people to answer.
     

    Nearly there...
    #7
    JorgeF
    Super Member
    • Total Posts : 3340
    • Reward points : 0
    • Joined: 2011/07/09 11:56:58
    • Location: PT/EU @ Third rock from the Sun
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/10/02 12:04:06 (permalink)
    0
    Hi
    KokuH
    Okay, so I'm going to create a program on the client side to decode this data.
    And for the second problem? What do you think?

    A decoding function for that would be something like:

    unsigned char Decode(unsigned char val)
    {
        return val;
    }

    If you look at an ASCII table you will see that there is nothing to decode because the data is exactly the same.
    Its only a question of "presentation".
    Your {0x7e, 0x7e, 0x64} its exactly the same as {'~', '~', 't'}.
     
     

    Best regards
    Jorge
     
    I'm here http://picforum.ric323.com too!
    And it works better....
    #8
    NKurzman
    A Guy on the Net
    • Total Posts : 17605
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/10/02 18:14:44 (permalink)
    0
    3 connections? Are you closing and reopening the connection?
    Are you Opening it without returning the Old Socket?
     
    Try increasing "TCPIP_STACK_DRAM_SIZE" This is were all you Packet buffers will come from.
    and TCPIP_TCP_MAX_SOCKETS  
    it is 10 But you loss some to system services (ie 2 for DHCP)
     
    #9
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/10/04 05:32:19 (permalink)
    0
    Hello NKurzman,
     
    I tried to modify these two parameters and it does not work, I first increase TCPIP_STACK_DRAM_SIZE, then TCPIP_TCP_MAX_SOCKETS, and finally both together and I always have the same error on the client side, (Error: No route to host).
    #10
    NKurzman
    A Guy on the Net
    • Total Posts : 17605
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/10/04 10:07:09 (permalink)
    0
    Your issue is only 3 transmissions, or only 3 connections to the Microchip Board?
    If it is only 3 transmissions, are you leave the socket open? and reading the Packet on the Microchip board. 
     
    #define MAX_BSD_SOCKETS 10  set to what?
     
    #define TCPIP_HTTP_MAX_CONNECTIONS 4 set to what?
     
    Note these change are not experiments.  If you increase one you must also increase the dependent parameters.
    Like increase MAX_BSD_SOCKETS , then the Total and Max Packets must increase.  And the TCP/IP Heap to hold it all.
    post edited by NKurzman - 2018/10/04 10:14:38
    #11
    marcc70
    Starting Member
    • Total Posts : 64
    • Reward points : 0
    • Joined: 2018/12/03 06:23:00
    • Location: 0
    • Status: offline
    Re: Send/receive frame (octet) using MPLAB harmony 2018/12/11 12:38:56 (permalink)
    0
    Hi, I have te same project as you.

    I made a windows application for the PI which behaves as a server, and needs to read incoming data from the ESK 2.
     
    But I don't actually know how this berkeley demo program works, only thing I need is to send values to a specific ip dress and port.
     
    Do you already have a kind of working program/solution?
    #12
    Jump to:
    © 2019 APG vNext Commercial Version 4.5