LPCxpresso Ethernet

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCxpresso Ethernet

5,200 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by johnnyalexa on Mon Jan 24 04:05:49 MST 2011
Hello to all,

I am a newbie in LPC, I have two LPCxpresso 1769 boards ( big plans).

My main purpose is to understand and write ethernet applications, so I have compiled easyweb demo. Maybe I don't have the right rj45 connection,cause the aplication isn't working (I can't make a network connection with it, using crossover cable). If I have to modify something in the code before runing it, please let me know. And also how can I determine what kind of internal connection my rj45 connector has.

Thanks
0 Kudos
55 Replies

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cesimkaol on Wed May 14 02:23:52 MST 2014
HEY ,

ı can implement easy web and change web page :)

it is working but ı have accomplished it in debug mode ...When ı plug out usb cable and plug in it again after wrote flash. it is not working. When I write it flash and process it in debug mode then it is working. I want to use it without debuging mode...Why is it happening?
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Oct 03 06:19:19 MST 2012

Quote: PRASATH
If you are unable to load any pages, [SIZE=4][B][COLOR=Red]check your computer's network connection.[/COLOR][/B][/SIZE]
  If your computer or network is protected by a firewall or proxy, make sure
    that Firefox is permitted to access the Web.



So what's the question here?
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by PRASATH on Wed Oct 03 05:09:56 MST 2012
ACOMMAND WINOW:
Pinging 192.168.0.110 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.0.110:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),


i debugging the easyweb program in lpcxpresso ide ,but  i could not get output.
the pinging will not perform,

IN WEB PAGE ERROR:


The connection has timed out
               The server at 192.168.0.110 is taking too long to respond.
      The site could be temporarily unavailable or too busy. Try again in a few
    moments.
  If you are unable to load any pages, check your computer's network
    connection.
  If your computer or network is protected by a firewall or proxy, make sure
    that Firefox is permitted to access the Web.
any one plese help me.
Thanku.
s.prasath.:(
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcbane on Sun May 27 23:23:06 MST 2012
hi primate,

The JS looks ok to me. Two suggestions:
) Get the webdebugging tool of your choice(e.g.firebug for firefox) and check the response
) If you wish feedback to your Cortex M3 code you should post it here...

Are you sure you setup your webserver properly? E.g. uIP/simplewebserver does not handle POST requests - did you change that?

BR
mcbane
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by primate on Tue May 08 03:09:16 MST 2012
I have made some progress in my spare time and made an apache server and used an ajax function which works great with an cgi script (i.e. /cgi-bin/test.cgi). Unfortunately when i enter an local IP address like 192.168.1.XXX (the IP address of the board server) looks like no information is sent from the server.

Here is a part of the code, any help is apriciated:

function xmlhttpPost(strURL) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', "http://192.168.1.125", true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'text/xml');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send("sent_word");
    alert("send");
}


I have set up EasyWeb to read all incoming messages (via printf). Is that OK?
As I know the self.xmlHttpReq.open should "open" http://192.168.1.125
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by primate on Mon Apr 16 22:02:27 MST 2012
Tnx for the explanation mcbane, respect.

This will help me understand some things and give me the guidance to explore additional literature.

If I come up with something useful it will be posted here.
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcbane on Sun Apr 08 10:27:23 MST 2012
Hi,

First of all, let me clarify the architecture I'm talking about as you refer to a "server" and a "board".
In the easyweb example, the server *is* the board, i.e. a service running on the board.
The javascript you are trying to run is also hosted as text on the board, downloaded and executed by your webbrowser.

Now in order to send something to your board you have to use the tools Javascript and the browser provide. There is a technology calles AJAX that lets you send customized http calls.
Strictly http speaking, to change the state of a web resource you need to send a "PUT" or "POST" request, but many developers misuse "GET" due to browser compatibility issues.
So, to send something to the server on your board, you need to craft an XMLHttpRequest and have the server code you mentioned set up to parse it properly.

There are a gazillion examples on how to do this available via the search engine of your choice, here is one of them, randomly picked:
http://www.degraeve.com/reference/simple-ajax-example.php
I would also crosscheck the script you already have, I usually use JS libraries such  for the graphics.

There is one problem with this approach: Even simple javascript libraries sum up to a decent amount of kilobytes and you probably dont have that space on the board, also the throughput of the tcp implementation in easyweb is not comparable to a, say, linux stack.

Thus, I come back to the recommendation to host the GUI on an apache server and have
the "boardserver" only respond to webcalls.

/mcbane
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by primate on Wed Apr 04 23:43:41 MST 2012
Hi,
First of all tnx for the reply mcbane.

I have changed the EasyWeb example to "scan" incoming packages and change the LED if a specific package comes in. But I am not sure if I did it right. If I understood correctly I need to change the webside.h so it sends those packages I want to the board but the question is how. I was suspecting that the server does not send any useful data to the board and your suggestion is a big big help.

Is a this ok:
"<input type=\"button\" onclick=\"LED1();\" value=\"LED 1\">"

and it calls this:
"<script language=\"javascript\" type=\"text/javascript\">"
"function LED1() {"
SEND MESSAGE
"}"
"</script>\r\n"


Unfortunately I do not have any experience in webpage coding. I am not sure what to write instead of SEND MESSAGE. Can I relate to jharwoods uIP mods code posted in http://knowledgebase.nxp.com/showthread.php?t=1629&page=2
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mcbane on Tue Apr 03 06:52:35 MST 2012
Hi primate,

Is that all you changed in the example?

This line will display something in the browser but thats about it.
There are a number of things you need to implement to make your usecase work:

1) Add Javascript to actually send a message to the board. the browser will only send a simple http GET request when you enter the Ip in the address field and the plain easyweb example actually discards most of it.
2) change the http server code to read, parse and act upon whatever you sent
3) code to switch a GPIO on/off (can be taken from various blinky examples)

number 2 is the most work. I personally would go with jharwoods earlier suggestion and implement a REST service, this would serve you well for many applications.

-mcbane
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by primate on Mon Apr 02 02:50:41 MST 2012
Hi,
I am a noob trying to control my LPC expresso LEDs trough a web interface with buttons but without any success. I use EasyWeb as a template with added buttons:
<input type=\"button\" OnClick=\"Pwr_On\" value=\"LED On\"\>


It seems that the LPC does not get any "button" messages at all and I do not know did I code the webpage wrong or the expresso. Should I notice the LPC that a button has been pushed in another fashion?

Any help needed! Thank you.
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Tue Feb 15 22:00:49 MST 2011

Quote: johnnyalexa
Hi,

I am happy that I could test EasyWeb and uIP on my LPCXpresso 1769. I have build a small board with some push buttons, Magjack, USB connector, sd-card holder and 16x2 LCD. I like the way uIP web page looks like, and I would like to go on with it. The issue I have is that, the web page is stored in external eeprom chip ( correct me if I'm wrong), and I don't have any idea on how to upload another web pages.

If someone has some experience with that, please give me some ideas.

Thanks a lot,

Regards,
johnny



The web page content for both EasyWeb and uIP httpd are hard-coded as static const unsigned char arrays. So the content lives in flash memory defined at compile time.

My approach to this would be to arrange the micro(s) to be purely RESTful web services, responding only to resource state changes. All the look and feel part would be handled by a nearby full-blown web server like Apache or LAMP stack. Ajax would provide the link between client web browser and the micro's RESTful web service.
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by johnnyalexa on Tue Feb 15 10:51:08 MST 2011
Hi,

I am happy that I could test EasyWeb and uIP on my LPCXpresso 1769. I have build a small board with some push buttons, Magjack, USB connector, sd-card holder and 16x2 LCD. I like the way uIP web page looks like, and I would like to go on with it. The issue I have is that, the web page is stored in external eeprom chip ( correct me if I'm wrong), and I don't have any idea on how to upload another web pages.

If someone has some experience with that, please give me some ideas.

Thanks a lot,

Regards,
johnny
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Feb 07 08:57:38 MST 2011
Thanks for the comments Zero. Updated version of ZIP uploaded. Note that I've fixed the LPC_GPIO0->FIODIR issue in tcpip.c, rather than in easyweb.c.

Regards,
CodeRedSupport.
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Feb 07 08:47:07 MST 2011

Quote: CodeRedSupport
If someone can confirm that this does indeed work...



Working as expected: Semihosting / ICMP

Just had to change my IP address in tcpip.h and add __LPCXPRESSO__ to Symbols.

Changed GPIO1 to GPIO0 in ew_systick.c:
LPC_GPIO0->FIOPIN ^= 1 << 22; // Toggle user LED P0.22


and added output def to easyweb.c
#ifdef __LPCXPRESSO__
[LEFT]// LPCXpresso 176x board
LPC_GPIO0->FIODIR |= (1<< 22); //set LED output
#endif[/LEFT]
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Feb 07 05:40:27 MST 2011
I've just uploaded a port of the RDB1768 version of EasyWeb application to the LPCXpresso176x board to:

http://support.code-red-tech.com/CodeRedWiki/NXPDriverLibraries

Changes from the RDB1768 version:
- Information messages now displayed via semihosting to the debugger console window, rather than to the RDB1768 LCD screen.
- GPIO used to flash LED from systick interrupt changed to match LPCXpresso176x board.

I've also implemented the ICMP/ping fix that Zero highlighted.

If someone can confirm that this does indeed work, I will move this project into the Examples provided with the next release of the tools [I don't currently have access to an ethernet capable LPCXpresso176x board.]

Regards,
CodeRedSupport.
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Feb 07 02:34:01 MST 2011

Quote: Zero
In this version of RDB1768cmsis_EaysWeb

http://support.code-red-tech.com/CodeRedWiki/RDB1768cmsisExampleProjects

PING is not working. This is caused by tcpip.c line 848-861



Thanks for the catch. We'll get this fixed in the next release of the examples.

Regards,
CodeRedSupport
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Sun Feb 06 16:42:59 MST 2011
Ok. I just need to do a bit more testing and write a readme.txt for it.
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Feb 06 16:00:13 MST 2011
You're kidding :)

Open a new thread and you will get >1000 views next week.
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jharwood on Sun Feb 06 15:46:49 MST 2011
Just got a TFTP secondary boot loader working on an LPC1769, if anyone's interested.
0 Kudos

967 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Feb 06 14:32:07 MST 2011

Quote:
Let me know if you ever get those base board PCBs made



:confused: Made 2 of them last month.

http://www.flickr.com/photos/58892165@N08/5420507148/

http://www.flickr.com/photos/58892165@N08/5419968233/

Just writing CAN part of code, SD & camera has to be included, too. Although all this was running on PC2368 & MBED, I want to add a few new features and so I'm sure I'll end with board revision C before I'm content with it.
Nevertheless customer is waiting and I promised to get it done this month...
0 Kudos