Hot!using WiFi module and ENC28j60 with TCPIP stack

Author
Shishi
Super Member
  • Total Posts : 322
  • Reward points : 0
  • Joined: 2016/06/15 05:34:10
  • Location: 0
  • Status: offline
2018/06/04 04:55:18 (permalink)
0

using WiFi module and ENC28j60 with TCPIP stack

Hello all,
i wrote also in Mbplab Harmony section but no body answers me. :(
I am using Pic32 starter kit and WINC1500(wifi module) and Enc28j60, i developed the software inwitch both using TCPIP stack with HTTP server, i configured them with MPLAB HARMONY.
problem is, when i open browser with their IP addresses at the same time, after awhile Enc28 goes to time out and does not reconnect any more.
Is there anyone that run both together?
 
#1

17 Replies Related Threads

    rainad
    Super Member
    • Total Posts : 1013
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/04 09:06:24 (permalink)
    0
    Can you please try to run the same project but just with the ENC interface and check that everything is OK? It may be some issue on the SPI bus that both interfaces share.
    In system_init.c::TCPIP_STACK_Init(), please change:
    tcpipInit.nNets = sizeof (TCPIP_HOSTS_CONFIGURATION) / sizeof (*TCPIP_HOSTS_CONFIGURATION);
    with
    tcpipInit.nNets = 1;
     
    and make sure that the TCPIP_HOSTS_CONFIGURATION[] lists the ENC as the 1st interface.
     
    #2
    Shishi
    Super Member
    • Total Posts : 322
    • Reward points : 0
    • Joined: 2016/06/15 05:34:10
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/05 07:53:33 (permalink)
    0
    rainad
    Can you please try to run the same project but just with the ENC interface and check that everything is OK? It may be some issue on the SPI bus that both interfaces share.
    In system_init.c::TCPIP_STACK_Init(), please change:
    tcpipInit.nNets = sizeof (TCPIP_HOSTS_CONFIGURATION) / sizeof (*TCPIP_HOSTS_CONFIGURATION);
    with
    tcpipInit.nNets = 1;
     
    and make sure that the TCPIP_HOSTS_CONFIGURATION[] lists the ENC as the 1st interface.
     


    Dear Rainad
    thanks for your reply.
    it works perfectly, also if i do not remove WINC configuration part and just open the browser with IP of ENC28 it works good without disconnection.
    i tried to put TCPIP with RTOS configuration of Stand alone , in this case ENCJ doesnot go to time out but it seems that WinC1500 becomes slow, i mean the realtime data and LEd that is on web page (web server demo example) do not updating fast and it seems there is some disconnection in between.
    What is RTOS exactly?why Harmony recommend that?
    #3
    rainad
    Super Member
    • Total Posts : 1013
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/05 09:42:30 (permalink)
    5 (1)
    The RTOS configuration is probably suggested for the use of  the WINC driver.
    There seems to be some conflict when both Wi-Fi and ENC use the SPI bus.
    I'll bring the issue to the attention of someone involved with the WINC development, he can be of better help than I am.
     
    #4
    rainad
    Super Member
    • Total Posts : 1013
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/05 10:12:17 (permalink)
    0
    Since you use the PIC32 ESK, I'd recommend switching to the internal ETH controller. This way you avoid the issue of using another device on the SPI bus. And this is a combination that is well known and it works.
     
     
    Otherwise, if ENC is a must for you, probably it's best to open a ticket so this can be looked in officially. There are some tests to be done here, etc., it will require some work.
     
     
    #5
    Shishi
    Super Member
    • Total Posts : 322
    • Reward points : 0
    • Joined: 2016/06/15 05:34:10
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/06 00:30:14 (permalink)
    0
    rainad
    Since you use the PIC32 ESK, I'd recommend switching to the internal ETH controller. This way you avoid the issue of using another device on the SPI bus. And this is a combination that is well known and it works.
     
     
    Otherwise, if ENC is a must for you, probably it's best to open a ticket so this can be looked in officially. There are some tests to be done here, etc., it will require some work.
     
     


    Dear Rainad


    i use pic32 starter kitr for test at the end i have to put all these configuration in our custom board,that wants to use WIFI and ETHernet RJ45. what is this Internal Ethernet ? is that LAN8740 PHY that is on the pic32 SK,that can be use by cable)?
    #6
    rainad
    Super Member
    • Total Posts : 1013
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/06 12:16:23 (permalink)
    0
    Yes, the PIC32MZ has an internal Ethernet controller and on the Ethernet Starter Kit that you use there is the LAN8740 PHY plug in/daughter board.
     
    #7
    RISC
    Super Member
    • Total Posts : 5271
    • Reward points : 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/06 14:20:39 (permalink)
    0
    Hi shishi,
    Can you be explicit as there are many PIC32 starter kits.
    Do you use the PIC32MZ Embedded Connectivity with FPU (EF) Starter Kit or the PIC32 Ethernet starter kit II ?
    regards
     
     
    #8
    maxruben
    Super Member
    • Total Posts : 3285
    • Reward points : 0
    • Joined: 2011/02/22 03:35:11
    • Location: Sweden
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/07 12:47:09 (permalink)
    0
    Try to add more TCP_PURPOSE_GENERIC_TCP_SERVER sockets. This is for the V5 TCP/IP stack, this may be done differently in Harmony, maybe even dynamically.
     
    /Ruben
    #9
    Shishi
    Super Member
    • Total Posts : 322
    • Reward points : 0
    • Joined: 2016/06/15 05:34:10
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/13 00:40:31 (permalink)
    0
    RISC
    Hi shishi,
    Can you be explicit as there are many PIC32 starter kits.
    Do you use the PIC32MZ Embedded Connectivity with FPU (EF) Starter Kit or the PIC32 Ethernet starter kit II ?
    regards
     
     


    yes i am using PIC32MZ Embedded Connectivity with FPU (EF) Starter Kit.
    #10
    Shishi
    Super Member
    • Total Posts : 322
    • Reward points : 0
    • Joined: 2016/06/15 05:34:10
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/13 00:48:23 (permalink)
    0
    maxruben
    Try to add more TCP_PURPOSE_GENERIC_TCP_SERVER sockets. This is for the V5 TCP/IP stack, this may be done differently in Harmony, maybe even dynamically.
     
    /Ruben


    Dear Ruben 
    as i said i am using Harmony v2.05, i could not find TCP_PURPOSE_GENERIC_TCP_SERVER sockets, but i increased TCP_default_TX_size and TCP_default_RX_size.
    does "TCP_PURPOSE_GENERIC_TCP_SERVER" sockets have another definition maybe?
    #11
    Shishi
    Super Member
    • Total Posts : 322
    • Reward points : 0
    • Joined: 2016/06/15 05:34:10
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/13 01:00:14 (permalink)
    0
    i have another problem also, in web server demo(HTTP web server) there is a page with "network configuration"
    in which we can change IP,Gateway and so on. but when i change IP, it does not reconnect me to new IP address,and always start with default configuration.
    i am confused, when i saved these changes on my external eeprom for example, when i read IP address of both ENC28 and WINC from my memory, where should i insert them? to start with new config not with default? 
     
     
    #12
    rainad
    Super Member
    • Total Posts : 1013
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/13 09:01:32 (permalink)
    3 (1)
    You should use your externally stored network data (IP, gateway, etc.) when you start the stack, i.e. the parameters to the TCPIP_STACK_Initialize call (see the standard demo that starts the stack).
    If you want to do it at run time, use TCPIP_STACK_NetDown() and then TCPIP_STACK_NetUp() with the new parameters (this is what the HTTP web server demo does when you use the "Network Configuration" page).
     
     
    #13
    Shishi
    Super Member
    • Total Posts : 322
    • Reward points : 0
    • Joined: 2016/06/15 05:34:10
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/13 23:41:01 (permalink)
    0
    rainad
    You should use your externally stored network data (IP, gateway, etc.) when you start the stack, i.e. the parameters to the TCPIP_STACK_Initialize call (see the standard demo that starts the stack).
    If you want to do it at run time, use TCPIP_STACK_NetDown() and then TCPIP_STACK_NetUp() with the new parameters (this is what the HTTP web server demo does when you use the "Network Configuration" page).
     
     


    exactly this part of HTTP web server demo does not work...i mean when i change the IP in "Network Configuration" page, the pic does not respond to new IP ,but still respond to the default one.
    #14
    rainad
    Super Member
    • Total Posts : 1013
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/14 10:05:13 (permalink)
    0
    Do you have DHCP enabled?
    If so, it doesn't matter what static values you set, those will be used only when DHCP failed.
     
    #15
    Shishi
    Super Member
    • Total Posts : 322
    • Reward points : 0
    • Joined: 2016/06/15 05:34:10
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/19 06:08:00 (permalink)
    0
    rainad
    Do you have DHCP enabled?
    If so, it doesn't matter what static values you set, those will be used only when DHCP failed.
     


    no i am using static ip
    #16
    Shishi
    Super Member
    • Total Posts : 322
    • Reward points : 0
    • Joined: 2016/06/15 05:34:10
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/19 06:11:48 (permalink)
    0
    i think i have declare a parameters then befor stack_init() i read memory and put on that then maybe works???
    #17
    Shishi
    Super Member
    • Total Posts : 322
    • Reward points : 0
    • Joined: 2016/06/15 05:34:10
    • Location: 0
    • Status: offline
    Re: using WiFi module and ENC28j60 with TCPIP stack 2018/06/19 06:18:49 (permalink)
    0
    is there any one that used download rutine  in javascript?i already used in my old project (that was only Ethernet RJ45),and it was around 130 integer and i saved them in local, in txt format... now i have big data maybe 2000 integer,but when i save my data, i saw in my txt file that it just saved around 300 integer data not more.
    is there anyone that know about it?
     
    #18
    Jump to:
    © 2018 APG vNext Commercial Version 4.5