• AVR Freaks

Create an Client/Server project with PIC32

Page: 12 > Showing page 1 of 2
Author
KokuH
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2018/05/07 08:45:14
  • Location: France
  • Status: offline
2018/09/19 01:19:05 (permalink)
0

Create an Client/Server project with PIC32

Hello,
 
I would like to create a simple TCP project (Client / Serevur) on a PIC32 ETHERNET STARTER KIT card that has a PIC32MX795F512L, Without using MPLAB Harmony.
To achieve this, I installed: MPLAB X IDE v4.20 and MPLAB IDE v8.90, for lack of experience, I do not know which to use to achieve this project.
 
I did a lot of research, but I only find projects and demos that use Harmony (which I do not want to use), I also test my card with a simple LED ignition program.
 
Someone would have links on examples (Client / Server)?
 
Thank you
 
#1

22 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 18033
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/19 06:04:06 (permalink)
    5 (1)
    MPLab is only one part. Why do you have old versions of both IDEs? You need XC32 also. If you do not want to use Harmony you would Need to use MLA. Note, while available, MLA is no longer supported.
    #2
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/19 08:03:26 (permalink)
    0
    Hello Nkurzman, 
     
    Normally, I installed everything you said! I have more than create my project, I can not find any example on PIC32 except Harmony! demos, so if you can help me at least with the right terms to search on google and also the steps the creation of the project!
    You see that I block at first, but I'm sure that if I'm unlocked and I understand how it works, I would have more to bother you
     
    Thank you
    #3
    NKurzman
    A Guy on the Net
    • Total Posts : 18033
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/19 09:30:29 (permalink)
    5 (1)
    If you do not want to use Harmony on a PIC32
     
    your Options are:
    Possibly:
    https://aws.amazon.com/iot-core/getting-started/
    It has a Stack, and does not use Harmony.
     
    or MLA a discontinued product, that may not be up to date  It should have examples.
    http://www.microchip.com/mplab/microchip-libraries-for-applications
     
    while Harmony is Not a Great Product , the TCP/IP Stack works well.
    It is probably the Best option. why don't you want to use it?
    #4
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/20 00:19:34 (permalink)
    0
    Hello Nkurzman, 
     
    I do not want to use Harmony because I can not! I tried several demos on my PIC32 ETHERNET STARTER KIT card and it does not work, I posted topics about it, and I have not received a concrete answer.
     
    Here are the topics I posted:
    http://picforum.ric323.com/viewtopic.php?f=69&t=668
    https://www.microchip.com/forums/m1066760.aspx 
     
    Thank you 
    #5
    NKurzman
    A Guy on the Net
    • Total Posts : 18033
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/20 06:10:12 (permalink)
    5 (1)
    My project has Berkeley sockets from client a and master, using Harmony. It does work.
    MLA may be harder to use.
    But try it if it is what you want.
    #6
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/20 06:36:39 (permalink)
    0
    Thank you for your answer,
     
    That's not what I want! it's the fact of not being able to succeed with Harmony that made me turn to another solution!
    The sockets project Berkeley, compiles perfectly but when I load it on my card, well there's nothing happening, I turn on the wireshark and I do not visualize anything!

    I think the code is not fully loaded! in fact, on my PIC32 ESK card there is a DEBUG LED which blinks when the program is loading, then stops when the program is fully loaded, for my part, when I load a simple program like to "light an LED", the program will load and the DEBUG LED will stop blinking when it is fully charged, but when I load the berkeley_tcp_server.X program, it starts to load, the LED flashes and then freezes and stays on! so I think the code is not fully loaded! 
     
    Is this a hardware problem?
     
    #7
    rainad
    Super Member
    • Total Posts : 1225
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/20 10:17:21 (permalink)
    5 (1)
    I can try to help you with getting your Harmony project to work.
    I suggest you start with an out of the box project for the PIC32 ESK from Harmony v2.06: please try first the web_server_nvm_mpfs project for the PIC32MX configuration and this should work just fine. You should be able to point your browser to the board and see the web page.
    If this works correctly we can then move on to the client - server problem.
    Let me know.
     
    #8
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/21 02:56:40 (permalink)
    0
    Hello,
     
    So I tried the project web_server_nvm_mpfs and in this one I made 3 projects:
     
    pic32_eth_web_server.X
    pic32_eth_wifi_web_server.X
    pic32_wifi_web_server.X
     
    I started the project pic32_eth_web_server.X and I built it, then I loaded it and in fact, nothing happens, I do not visualize anything on the wireshark on the IP address 192.168.100.115 fixed on the code :
     
    / *** Configuration IPv4 *** /
    / *** Index Configuration réseau 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.100.115"
    #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 "complet"
    #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
    / *** TCPIP SYS FS Wrapper *** /
    #define SYS_FS_MAX_PATH 80
    #define LOCAL_WEBSITE_PATH_FS "/ mnt / mchpSite1"
    #define LOCAL_WEBSITE_PATH « / mnt / mchpSite1 / "
    #define SYS_FS_DRIVE" FLASH "
    #définit SYS_FS_NVM_VOL" / dev / nvma1 "
    #define SYS_FS_FATFS_STRING" FATFS "
    #define SYS_FS_MPFS_STRING" MPFS2 "

     
    And also, there is no web page that opens as you say, and there's the led of the debugger that stays on !
    #9
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/21 04:33:14 (permalink)
    0
    Regarding the web page, I enter the browser, I type http://192.168.100.115 or 192.168.100.115 and I can not find anything (This site is inaccessible)
    #10
    rainad
    Super Member
    • Total Posts : 1225
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/21 09:10:07 (permalink)
    5 (1)
    The IP address 192.168.100.115 is a default one and probably it does not match you network settings.
    What is the address of your machine from which you're trying to reach the PIC32 (use ipconfig on Windows, ifconfig on Linux).
    It looks like you have the DHCP turned on, which is good ( TCPIP_NETWORK_CONFIG_DHCP_CLIENT_ON is set).
    Do you have a DHCP server running in your network, how does your computer get its IP address?
     
    Another thing that will be useful is to connect your machine to the PIC32 ESK board over USB to the console port on the ESK.
    Then connect a terminal (teraterm, putty, etc.) on that port and see if you can enter commands and if the board replies.
    As a test try "netinfo" and then share the results.
     
     
    #11
    NKurzman
    A Guy on the Net
    • Total Posts : 18033
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/21 15:16:55 (permalink)
    5 (1)
    1. Which Microchip board are you using?  You need to use a sample project that supports your board. Is it Wi-Fi or wired?  For Wi-Fi G demo you may need to update the Wi-Fi firmware.
    2. Did you read how to Build and use the sample application. It also covers what sample works with what board.
    3. To find the IP address of you Board you can use the Microchip discover application, Or type "MCHPBOARD_E" ( for the web server demo.
    #12
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/24 00:49:18 (permalink)
    0
    Hello,
    • The IP address of my machine is 192.168.1.13, my computer gets its address by DHCP;
    • I loaded the program pic32_eth_web_server.X and then I opened the teraterm, I connected to port 16 and I can not write on the console, I did the same operation with putty and I can not write also;
    • I use the PIC32 ETHERNET STARTER KIT card with PIC32MX795F512L, my ESK card has an Ethernet port, so I connect to the network via rj45 cable;
    • Normally, the examples I tried should work with my ESK card;
    • I was unable to find my IP address as you said, but in the code it is set to 168.192.100.115 
    Thank you
    #13
    crosland
    Super Member
    • Total Posts : 1695
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/24 01:21:17 (permalink)
    4.5 (2)
    KokuH
    • I was unable to find my IP address as you said, but in the code it is set to 168.192.100.115 
     

    If you are using a static IP address you need to change it so that it is on the same subnet as your computer. Otherwise let the PIC get an IP address from your DHCP server and then use that address or the hostname.
     
    If this doesn't make sense then I suggest a visit to Amazon for a good book about Ethernet.
    #14
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/24 02:53:59 (permalink)
    0
    Hello crosland,
     
    pic32_eth_web_server.X is a demo MHC, in its configurations I found that an IP address has been fixed, (see the piece of code that I shared a bit higher), let my pic get an IP address alone incites me thought ! to change the code and therefore the configurations of the demo! What do you think? what should I change to the code to have an IP address with DHCP?
     
    Thank you
    #15
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/24 03:46:13 (permalink)
    5 (1)
    Why not just pick a spare valid address on your network (192.168.1.xxx)
    and update this line to match:
    #define TCPIP_NETWORK_DEFAULT_IP_ADDRESS_IDX0 "192.168.100.115"

    and update these lines to point to your gateway
    #define TCPIP_NETWORK_DEFAULT_GATEWAY_IDX0 "192.168.100.1" 
    #define TCPIP_NETWORK_DEFAULT_DNS_IDX0 "192.168.100.1"


    Nearly there...
    #16
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/24 06:34:39 (permalink)
    0
    Hello qhb,

    I changed in the demo code the IP address 192.168.100.115 to 192.168.1.115, and I still have the same problem, the project is well built but when I do https://192.168.1.115. or https: // mchpboard_e, there is no web page coming out (This site is inaccessible)
    #17
    rainad
    Super Member
    • Total Posts : 1225
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/24 09:07:55 (permalink)
    5 (1)
    The project comes with the DHCP client enabled by default.
    If the ESK doesn't pick up an address from the server, then you have some other issues with that board.
    When you changed the static IP address to 192.168.1.115, can you ping the board from your machine?
    That's the 1st thing to try.
    Then try to solve the console thing, because using it we'll be able to understand what's going on.
    Make sure you've inserted the USB cable to the right connector. The COM port should show up once the demo is running on the PIC32 ESK.
     
    #18
    qhb
    Superb Member
    • Total Posts : 9999
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/24 13:12:36 (permalink)
    5 (1)
    KokuH
    ... but when I do https://192.168.1.115. or https: // mchpboard_e, there is no web page coming out (This site is inaccessible)

    Why add the extra complication of forcing secure sockets with the "https://" prefix?
    The secret to efficient debugging is starting simple and working your way up in complexity.
    Drop the "https://" to start with, and see of there is any response.
     

    Nearly there...
    #19
    KokuH
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2018/05/07 08:45:14
    • Location: France
    • Status: offline
    Re: Create an Client/Server project with PIC32 2018/09/25 01:25:10 (permalink)
    0
    The ping failed for both addresses, when I keep 192.168.100.115 and also I set it to 192.168.1.115, in both cases the ping fails;
    Regarding the USB, it is enabled on the COM port (COM port 16), but I still can not write anything on the console, it remains blocked despite the COM port for the ESK is activated;
    I removed the "http://" and I still (this site is inaccessible), I really start to believe that it is a hardware problem!
     
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5