I used some of ladyada's code and modified it to just turn on/off an LED. The matchport will serve up the webpage no problem but will time out when an on/off option is selected. Why is this happening and how can I fix it?!? Thank you. (BTW, ladyada's code works for both matchport and xport).
Perhaps I should also mention that sometimes (although I set it to port 80), the device still shows the webserver menu instead of the code embedded in the arduino. Odd...
I think you might be misunderstanding how the matchport works.
The matchport has its webserver on port 80. The configuration webpage utility is preloaded onto the webserver, but you can overwrite it with your own page. That webserver is completely seperate from its serial connection. You don't need any webserving code to access the webpage because its already built into the matchport. Just transfer a .cob file to the matchport using tftp and then access it in a browser.
The default port # for the serial port to the arduino is 10001 or 10002 (I think), depending on which of the two available serial ports you are using. You can directly talk to the arduino through these ports. The matchport is just passes along the data when accessed over these ports.
The data/commands sent through the serial port cannot be used to modify the webpage stored on the matchport webpage directly. Rather, you have a program (java applet or something) running on the browser that establishes a connection to the arduino to recieve data that is then displayed on the webpage.
The way I currently have my system set up goes like this:
1)I send an http request to the matchport on port 80 to get the webpage containing the java applet. 2) the matchport serves up the webpage 3) the the java applet runs on my page and sets up a client socket connection over port 10001 to "tunnel" data through the matchport 4) the java applet sends a 5 byte command to port 10001 when a button on the applet gui is clicked 5) the arduino reads the serial port and performs actions (LED on/off) depending on what message is recieved.
I'll take a closer look at ladyada's code to see if I can help out more, but to me it seems like a more complicated way to achieve what you want.
Why on earth would ladyada not use the built in sever then... Thank you again for the great info.
Still having timeout issues with current setup...unsure why.
I think she isn't using the webserver because in the example she is using an xport direct. The xport direct doesn't have any webserver capabilities. Therefore, she has to host it on the arduino. The Matchport you are using does have webserver capabilities.
How are you powering the matchport? It may or may not be relevant.
variable power supply. tested the output, works fine. Don't think that would affect it at all. I'm almost certain it has to do with my flow control/disconnect mode settings. What did you set that info to? (for channel1)?
I was just curious. Sometimes its simple things that are the problem. I just wanted to make sure that you are not trying to power it off the arduino.
My serial settings are 9600 baud, no flow control, no parity, 1 stop bit.
I believe that my disconnect mode setting are whatever the defaults are.
What about the Channel 1 settings of the matchport itself like these:
*** Channel 1 Baudrate 9600, I/F Mode 4C, Flow 00 Port 10001 Remote IP Adr: --- none ---, Port 00000 Connect Mode : D4 Disconn Mode : 00 Flush Mode : 00
Are those your settings?
I think everything is the same, except the connect mode setting.
The connect mode setting I use is C0, I think. The difference between my setting and your is that I have no character returned when a connection is made, and I have no active startup.
I'm not sure that matching my settings will help you. I'm not using ladyada's library functions and I don't really know what the code behind them is. You probably need to look into that if you want to use her libraries.
I’ve been trying various settings found online, nothing is really working though. Thanks for your help, guess i have to try the COB tftp thing.
Can you post your code if you still have it please?
I'll post what I have when I get home today.
After looking over my code, its not really going to be any easy to understand than the code posted on the lantronix page. My code is completely undocumented. I'm sorry, but your going to have learn at least a little java to get what you want out of that code.