Author Topic: == TCPIP Demo App ==  (Read 17518 times)

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
== TCPIP Demo App ==
« on: March 28, 2011, 04:23:01 AM »
===== UPDATE 2014 =====
The post below was for the first, prototype software for the SBC66EC released a couple of years ago. Since then, the SBC66EC has been integrated into the Netcruzer Download software. This software contains many TCP/IP and Webserver demos. Please see main SBC66EC product page for links. Also, see this forum for early releases of current Beta software.

===== Introduction =====
The zip file available for download by clicking here contains the "TCPIP Demo App" from the "Microchip Application Libraries v2010-10-19". The current, unmodified version can be downloaded for free from www.microchip.com/mal. In addition to this (Modtronix) code, we recommend you download and install the Microchip Application Libraries, seeing that it contains lots of additional information and documentaion. The example projects in this zip file have been modified to work with the Modtronix SBC66EC board.

===== Microchip TCP/IP Stack Help and Utilities =====
  • The ".\Microchip\Help" folder contains the "Microchip TCP/IP Stack Help" document.
  • The ".\Microchip\TCPIP Stack\Utilities" folder contains various utilities. See help document for details.
  • The Microchip forum contains lots of additional information.

   
===== Buiding project and programming SBC66EC =====
To build this project, do the following:
  • Download and install Microchip MPLAB IDE (available for free)
  • Download and install Microchip C30 Compiler (available for free)
  • Start MPLAB, and open the MPLAB workspace ".\TCPIP Demo App\TCPIP Demo App - C30 - SBC66EC.mcw"
  • Build project, and program SBC66EC. For details on programming Modtronix board, click here. A PIC
    programmer is required. The cheapest option will be the PICKit 3 available here.
  • Plug the SBC66EC into a network with a DHCP server. You can run the ".\Microchip\TCPIP Stack\Utilities\TCPIP Discoverer - Java.exe"
    application to get IP address of board (will get assigned an IP address when plugged into network with DHCP server).
  • In a browser, enter the IP address of board, or it's NETBIOS name. For example http://192.168.1.100 or http://mchpboard/

===== Modifications required for Modtronix SBC66EC =====
This folder contains the original "TCPIP Demo App" from "Microchip Application Libraries v2010-10-19",
modified to work with the Modtronix SBC66EC. The following modifications were made for it to work with
the Modtronix SBC66EC board:
  • Copied MPLAB Project file "TCPIP Demo App - C30 - PIC24FJ256DA210_DEV_BOARD_ENC624J600.mcp" to "TCPIP Demo App - C30 - SBC66EC.mcp". Edited file, and changed all "PIC24FJ256DA210_DEV_BOARD_ENC624J600" strings to "SBC66EC".
  • Created new workspace with, added "TCPIP Demo App - C30 - SBC66EC.mcp" project, and saved as "TCPIP Demo App - C30 - SBC66EC.mcw"
  • Replace TCPIPConfig.h with new version for SBC66EC
  • Replace HardwareProfile.h with new version for SBC66EC
  • In MainDemo.c file, added code for PIC24FJ256GB206 chip. Search for following string to see changes:
    "defined(__PIC24FJ256GB206__)"
  • In "Include/TCPIP Stack" folder, modified following files. Search for "MODTRONIX" to see modifications made.
       
    • SPIFlash.h, changed page size to 256 for Winbond flash
  • In "TCPIP Stack" folder, modified following files. Search for "MODTRONIX" to see modifications made.
       
    • SPIFlash.h, changed page size to 256 for Winbond flash
    • SPIEEPROM.c, changed eeprom page size to 32 (from 64) for 25LC640 eeprom
« Last Edit: August 04, 2014, 05:00:37 PM by modtro2 »

Rick314

  • Hero Member
  • *****
  • Posts: 55
  • SBC65EC/66EC, PT24E, LCD2S-204FHB, PICkit 3, MPLAB
    • View Profile
Re: == TCPIP Demo App ==
« Reply #1 on: April 12, 2011, 12:14:12 PM »
I have lost the ability to access my SBC66EC via HTTP, and can't even re-program it to its factory-shipped status.  Details follow.  This is my system:

- Microchip MPLAB IDE v8.66 (3/25/11, latest version)
   - Microchip C Compiler for PIC24 (16-bit) MCUs (aka "C30") v3.25 LITE
- Microchip PICkit 3 In-Circuit Debugger
- Modtronix SBC66EC Single-Board Computer
   - Microchip TCP/IP Stack v5.31 + Modtronix mods
 
I can compile/link the Modtronix code, and program it into the SBC66EC.  After doing so, I was able to access the board at http://mchpboard.  (So far so good.)  Using the SBC66EC web pages, I TURNED OFF DHCP AND FIXED THE ADDRESS AT 192.168.1.53.  This is the same thing I had previously done on my SBC65EC.  It is also the same thing I did Friday 4/8 with the factory-programmed SBC66EC firmware, that worked fine.  But now I am doing it using my compiled/programmed version of the Modtronix code, with no changes by me.  I did a re-boot of the SBC66EC, and haven't been able to communicate with it via HTTP since.
 
Now the SBC66EC red LED is blinking as usual (good).  The "Microchip TCPIP Discoverer" software v1.1 says the board is at IP 169.254.94.112 (?!).  When the board is off, TCPIP Discoverer has a blank screen.  When the board is turned on, TCPIP Discoverer shows that address and the board's correct MAC address.  So lots is working, but where that address came from I haven't a clue.  Also that address seems to be meaningless.  I can't communicate with the board at http://mchpboard or http://169.254.94.112 or http://192.168.1.53 or several other addresses I've tried.  I can't "ping 169.254.94.112".  There is no evidence I can find of anything at 169.254.94.112.  I re-programmed the original Modtronix-provided code (instead of my re-compilation of it), and no change.  I went back to my SBC65EC and can configure/see it as usual, just to verify my PC/Router... is still working fine.
 
It seems that the IP address re-assignment is both incorrect and non-volatile.  So now I am just wanting to just get the board back to its factory-delivered status.  Remember all 5 items above are new to me, as well as much of the underlying technology, if you suggest a solution path.
« Last Edit: April 12, 2011, 12:17:43 PM by Rick314 »

leifo

  • Hero Member
  • *****
  • Posts: 51
    • View Profile
    • Olsens PrivatPC
Re: == TCPIP Demo App ==
« Reply #2 on: April 13, 2011, 02:31:06 PM »
An IP address like 169.254.x.x is generally an indication of a PC not being able to obtain an IP address via DHCP. In your SBC66EC case, it might mean that there's something wrong with the IP-address buried in the EEPROM and then the board perhaps defaults to this. :?

In order to talk to the board again, you could try assigning your PC an IP-address in same range eg. like 169.254.94.1 and then try to reach the board.
   
If your PC obtains it's address via DHCP (from your Internet router), you may try to create a small network that only consist of your PC and the SBC66EC ie. via a crossed network cable or a simple switch (but not your Internet router). That way, your PC will also get a 169.254.x.x address when rebooted.
/Leif

Rick314

  • Hero Member
  • *****
  • Posts: 55
  • SBC65EC/66EC, PT24E, LCD2S-204FHB, PICkit 3, MPLAB
    • View Profile
Re: == TCPIP Demo App ==
« Reply #3 on: April 13, 2011, 04:46:28 PM »
Thank you Leif, I am back online after connecting my PC directly to the SBC66EC and browsing to the address reported by TCIP Discoverer.  Here are some comments I hope help others, and some feedback to Modtronix:

I was able to use a normal LAN cable to connect my PC directly to the SBC66EC instead of the recommended crossover cable, since my hardware is able to recognize the wrong cable and compensate for it.  (I think this is common on most modern PCs.  Mine is a circa-2005 Dell laptop running Windows XP.)

I searched for "169.254" in all the provided files, and found it in AutoIP.c, TCPIP Stack Version.txt, and zeroconfLinkLocal.c.  Reading nearby comments explains what Leif mentioned.  You will learn about "Link Local" and use of the 169.254.x.x subnet.  But I don't think the 169.254.x.x address should have appeared in the first place (next paragraph).

Modtronix: I just tried the same thing that started all my problems, with the same result.  I think you have a defect, but please give your response here if you would.  Here is how to replicate it -- I used the toolset previously listed here to build the provided code (no changes) and program it onto the SBC66EC.  I visited the board at http://mchpboard.  So far so good.  I went to the Network Configuration page, turned off DHCP, changed the IP address to 192.168.1.53, and pressed Submit.  That's it.  The "reboot page" (attached) is displayed, and now TCPIP Discoverer shows the SBC66EC is at 169.254.94.112.  Why isn't the SBC66EC at the address I told it to be at?  For now I will keep using DHCP so I can keep developing, but I need to use a fixed IP address soon.

(4/29/11 update on the above paragraph: I got the Microchip PIC32 Ethernet Starter Kit (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en545713) and got the TCP/IP Demo Application working.  This is the same application that comes on the Modtronix SBC66EC, but with minor Modtronix mods.  I had the same problem with the Microchip hardware -- Can't use the web pages to turn off DHCP and configure a static IP address.  In the case of the Microchip PIC32 Ethernet Starter Kit, the TCP/IP Stack is configured not to even try and save the information to non-volatile memory, because that hardware doesn't have any non-volatile memory.  It's just a guess, but perhaps the code mods made by Modtronix didn't take advantage of the fact that the SBC66EC *does* have non-volatile memory, and configure the Microchip TCP/IP Stack to take advantage of it.  The related Microchip Forum thread is at http://www.microchip.com/forums/tm.aspx?tree=true&m=574380.)


Modtronix: On the attached Microchip "re-boot" page, step #3, it doesn't say what to do if using a PICkit 3, as I am, and as you recommend.  I am guessing I clear EEPROM "via the MPLAB IDE".  But *how*?!  How to clear SBC66EC EEPROM to factory settings would be a good thing to add to the post that started this thread, I think.

Modtronix (a little thing): Using your provided "Microchip_Solutions_v2010-10-19_for_SBC66EC.zip" and instructions at the start of this thread, my MPLAB IDE "Build All" results in a clean build of all files *except* for 4 "unused variable bISREnabled" warnings for file ENCX24J600.c.  (Just warnings, not errors.)  But particularly with all new tools and low confidence, I think it would help to see a completely clean build, even if it means changing one more Microchip file on your part.
« Last Edit: April 29, 2011, 04:46:31 PM by Rick314 »

Jan

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: == TCPIP Demo App ==
« Reply #4 on: May 10, 2012, 03:34:26 PM »
Maybe David expects all the buyers of these boards to be highly skilled professionals which they are probably not (all).
That's why I'm sorry there is no reaction from his side for these problems since I experienced them as well.......

mg7

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: == TCPIP Demo App ==
« Reply #5 on: May 16, 2012, 11:33:42 PM »
important modification to the file with the hardware profile (config fuses) for those who want to debug their programs in MPLAB:
post from Modtronix in Microchip-Forum
(it took me some hours before I found this one)

edit: I should have read this topic before.
« Last Edit: May 17, 2012, 01:01:31 AM by mg7 »

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: == TCPIP Demo App ==
« Reply #6 on: May 30, 2012, 03:40:46 AM »
Please try new firmware, many improvements and more documentation:
http://forum.modtronix.com/index.php?topic=1551.0