Hallo !
Hier erstmal der Link zur benutzten Software :
http://forums.parallax.com/forums/attach.aspx?a=38137
In Webserver.spin sind folgende Änderungen zu machen :
Code: Alles auswählen
DAT
mac_addr byte $10, $00, $00, $00, $00, $01
ip_addr byte 192, 168, xxx, xxx ' device's ip address, statt xxx sind die Ziffern des eigenen Netzes einzutragen
ip_subnet byte 255, 255, 255, 0 ' network subnet
ip_gateway byte 192, 168, xxx, xxx ' network gateway (router), statt xxx sind die Ziffern des eigenen Netzes einzutragen
ip_dns byte 192, 168, xxx, xxx ' network dns, statt xxx sind die Ziffern des eigenen Netzes einzutragen
dhcp_or_static byte 0
PUB start
web.start(14,15,16,17,-1,-1,@mac_addr,@ip_addr) 'Die Pin-Nr. sind an den Hive wie angegeben anzupassen
'''web.start(11, 10, 9, 8, -1, -1, @mac_addr, @ip_addr)
'''if sdfat.mount_explicit(7,6,5,0) == 0
if sdfat.mount_explicit(10,11,12,13) == 0 'Die Pin-Nr. sind an den Hive wie angegeben anzupassen
'''ifnot \sdfat.mount(12)
cognew(webServer, @webStack)
Wie von "Paticklab" im Parallax-Forum angegeben (
http://forums.parallax.com/forums/defau ... 2&m=408206), sollte der Inhalt bei sdfat.popen wie folgt aussehen.
Code: Alles auswählen
if sdfat.popen(@fname,"r") <> 0 ' Try to open the requested file
web.str(@http404) ' if it is not found on the sd card send back the 404 error message
else
size:=sdfat.get_filesize
web.str(@http200) ' file has been found and will be transmitted,
web.str(string("Server: PropServer")) ' but first we are going to send the header
web.str(@crlf) ' which includes some information about the server and file
web.str(string("Content-Length: "))
web.dec(size)
web.str(@crlf)
web.str(string("Content-Type: "))
web.str(type)
web.str(@crlf)
web.str(string("Connection: close"))
web.str(@crlf)
web.str(@crlf) ' This is the end of the Header
Regnatix und Bellatrix sind auszuschalten.
ohne Gewähr
bei mir hats geklappt
Ich hoffe das Verstößt jetzt nicht gegen das Urheberrecht.
Gruß
Günter