Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Easy tcp/ip twi problems

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> Easy TCP/IP Archive
View previous topic :: View next topic  
Author Message
zolsi

Bascom Member



Joined: 24 Jan 2006
Posts: 51

belgium.gif
PostPosted: Fri Mar 10, 2006 12:09 pm    Post subject: Easy tcp/ip twi problems Reply with quote

I just tried for the first time my easy tcp/ip twi board and i cant see a web page from the web server (webserver.bas sample).
I can ping the web server with my pc while he is running).
I tried ping.bas and i can ping my pc.

Any idea ? thank you
Back to top
View user's profile
zolsi

Bascom Member



Joined: 24 Jan 2006
Posts: 51

belgium.gif
PostPosted: Fri Mar 10, 2006 1:08 pm    Post subject: Reply with quote

i use an atmega8, could it be a problem? i think no since i cant ping my pc with the board...

When i do a request on 192.168.1.25 or 192.168.1.25/index.htm (config of the webserver, on port 80) i can see the orange light blinking...

In the hyperterminal i can see :

Code:
init w3100A
CLOSED
Listening on socket : 0



it never change, even when i ping or do a request.


EDIT : when i try http://192.168.1.25:6969/ (6969 is the good port, i tried some different port 1000,80,6969...)it says that the server takes too much time to answer. it should means that i can connect the server ? still nothing more in the terminal anyway...
Back to top
View user's profile
Frankeman

Bascom Member



Joined: 11 Aug 2004
Posts: 948
Location: the Netherlands

netherlands.gif
PostPosted: Fri Mar 10, 2006 7:32 pm    Post subject: Reply with quote

hi,

And if you try:
http://192.168.1.25:6969/index.htm

Frank
Back to top
View user's profile
zolsi

Bascom Member



Joined: 24 Jan 2006
Posts: 51

belgium.gif
PostPosted: Sat Mar 11, 2006 12:30 am    Post subject: Reply with quote

already tried and same result Sad
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Sat Mar 11, 2006 10:14 am    Post subject: Reply with quote

Hi,

You need to make sure the EEP file is also programmed !
This file is programmed into the EEPROM space.

_________________
Mark
Back to top
View user's profile Visit poster's website
zolsi

Bascom Member



Joined: 24 Jan 2006
Posts: 51

belgium.gif
PostPosted: Sat Mar 11, 2006 10:45 am    Post subject: Reply with quote

what the h*** is that EEP file ?? tell me more Razz
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Sun Mar 12, 2006 11:36 am    Post subject: Reply with quote

The webserver sample demonstrates various methods to send data.

Look at the line :
Tempw = Tcpwrite(i , Eeprom , Woffset , Wsize) ' write data

Here the EEPROM is used as a data source. What means that some of the web pages are stored in EEPROM.
BASCOM uses the EEP file extion for this. The EEP is just a binary image.

BASCOM can program this file. Some programmers only understand HEX. For this reason BASCOM also has an option $EEPROMHEX in case you generate the files from bascom data lines.

The EEP file was generated with a simple html editor. There are tools such as BIN2HEX that can convert binary files into Intel HEX files.

I advise to set the fusebit of the micro so the EEPROM does not get erased once it is programmed.

Another option is to change the program and to send data from the flash memory or dynamic generated.

For this case, a conversion from bin to hex would be needed when AVR tools can not read the EEP file.

_________________
Mark
Back to top
View user's profile Visit poster's website
zolsi

Bascom Member



Joined: 24 Jan 2006
Posts: 51

belgium.gif
PostPosted: Sun Mar 12, 2006 1:32 pm    Post subject: Reply with quote

Ok thank you now its clear about eep file.

But why does i dont see a connection in the hyperterminal (with debug = 1) when i try to connect with my browser.
Even without that eep file, i should see a connection in the terminal (and nothing in the browser because the program doesnt find the data in the eeprom.)

I tried bin2hex and avr studio doenst want toflash the generated hex file ( it says that is not valid hex file..) Then i tried to remove the
Code:
If Bgenerate = 0 Then                                    
      S = "Content-Length: " + Str(wsize) + "{013}{010}"
      Tempw = Tcpwritestr(i , S , 255)                      
      Tempw = Tcpwrite(i , Eeprom , Woffset , Wsize)

So it would always go to index.htm but doesnt work neither.

need help Sad Sad Sad Sad Sad Sad Sad Sad Sad Sad Sad Sad Sad
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Sun Mar 12, 2006 2:53 pm    Post subject: Reply with quote

Hi,

I read various things. ABout TWI, webserver.bas, port 6969. A lot is not clear to me. I am not part of the 4400 Smile so i need to determine what is working and what not.
Hereis what you need to do :
- read the Easy TCP manual
- read the Easy TCP TWI manual
- perform the test programs. Use Tools, Easy TCP/IP to perform the TCP and UDP tests.
- Since you use TWI, you need to use the samples from the TWI subdir.
The webserver sample is named webserver_TWI.bas
In general, when you can PING the port, the configuration wend well.
But there are firewalls in routers, PC's that can block a port.
Make sure that these ports are enabled, or disconnect the PC from the internet and enable all fire walls. MAKE SURE there is no internet connection while disabling the firewalls !!!
In general it is a bad idea anyway to leave a development connected to the internet all the time.


The line :
I = Getsocket(0 , Sock_stream , 5000 , 0)
Listen on PORT 5000. So you probably modified the code sample?
Maybe you changed more. It is best to test the samples as provided without mods.
So to get data from this webserver you need to use http://IP:5000/index.htm

you should see data from the browser when you try to look at a page.
the browser send a lot of info.

I think that your problem is the wrong port or firewall.

_________________
Mark
Back to top
View user's profile Visit poster's website
zolsi

Bascom Member



Joined: 24 Jan 2006
Posts: 51

belgium.gif
PostPosted: Sun Mar 12, 2006 4:02 pm    Post subject: Reply with quote

Ok it works .

The problems was : the port in the tcp init line is not the port you have to connect to get the wab page.
So its :5000 by default


Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed Embarassed

Thank you mark !
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> Easy TCP/IP Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum