No PST Response on boot
I formatted an SD card, created the index.htm and put it on the card for hello world. I plugged in the card.
Using BST, I can only get a serial terminal response using the above items commented out. If they are in, there is no response so it is assumed the code is hanging up here.
Any suggestions?
debug := 1
'SDCard.Start
'stringMethods := str.Start
'Request.Constructor(stringMethods)
'Response.Constructor(stringMethods, @txdata)
Using BST, I can only get a serial terminal response using the above items commented out. If they are in, there is no response so it is assumed the code is hanging up here.
Any suggestions?
Comments
If so, did the previous tutorial step work? The step to setup the configuration.
How is the SD card formatted? Did you use a computer? Is it FAT, FAT32???
The card was already formatted new, that didn't work so I reformatted on Win XP, not the quick version. I think FAT32. That didn't work either. I can make the user LED turn on so I know the code is booting, also I can get the serial term to display Mount SD Card - if I comment out the parts above. There is no response from 192.168.1.120:5000. But I do get BLUE and RED activity.
Obviously it is not getting past the SDcard.start. I pulled the card out and put it back.
PUB Initialize | id, size, st debug := 1 'SDCard.Start stringMethods := str.Start 'Request.Constructor(stringMethods) 'Response.Constructor(stringMethods, @txdata) pst.Start(115_200) pause(200) 'Mount the SD card pst.str(string("Mount SD Card - ")) 'SDCard.mount(fileErrorHandle) pst.str(string("OK",13))
?Mount SD Card - OK Start RTC: 01/02/2000 00:14:25 W5100 Driver Started Status Memory Lock ID : 0 HTTP Server Lock ID : 1 TCP Socket Listener ID : 0 TCP Socket Listener ID : 1 TCP Socket Listener ID : 2 TCP Socket Listener ID : 3 Started Socket Monitoring Service Initial Socket States 3-14 2-14 1-14 0-14 clsd open lstn estb clwt clng udps 0000-0000-1111-0000-0000-0000-0000 Initial Socket Queue FIFO[0] 00000000 ////////////////////////////////////////////////////////////// ----- Start of Request---------------------------- ID: 0 Request Count : 0
'Request.Constructor(stringMethods) 'Response.Constructor(stringMethods, @txdata)
Can you hit http://spinneret.servebeer.com:5000/? Because it is running the exact same code.
T Chap, Please give it a shot and let me know if it works. You'd be the first... Unless D.P. finds this thread.
djnz j, $-1 ' decr j and; jump to current min
Illegal hex number. After removing the -, so that the number is just $1, the program compiles and loads. The PST shows what it should that did not work on BST. I looked back on the Mac and the code also has the $-1, but no errors are reported in Spin.
Just be check again, I re-downloaded the same zip, extracted, replaced all older copies in the folder, and got the same exact error. Fix the error and it compiles.
Without making ANY changes to the code, I can type in Firefox and IE and each browser displays the following in the pane:
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fmodern\fcharset0 Courier;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww10500\viewh9600\viewkind0 \deftab720 \pard\pardeftab720\ql\qnatural \f0\fs24 \cf0 \ \ \ \ \ Hello World!\ \ \ }
I thought I had copied and pasted the exact notes from the setup document, but it could have been weirded out using a Mac and text editor. This is a minor issue to solve on my end.
Next, I tried to change the MAC address to my board numbers. Making any change to the MAC addr causes the browser to just spin, never loads. Using the default MAC address the in code of byte $00, $08, $DC, $16, $EF, $22 and the browser will load the hello world page. Why can I not change to my own MAC address written on the bottom of the board?
Once again, if you post the source code loaded in the Spinneret, I'll verify that you have the latest files. I can't understand why you are against such a simple request. Especially when I'm trying to help you.
How is the Spinneret connected to your network? What are your network parameters; Subnet, Gateway...?
This is where I got the original files. I have just replaced all of the files from with the files from here as you requested:
http://code.google.com/p/spinneret-web-server/source/browse/#svn%2Ftrunk%2FMultiSocketServer_MikeG
I just uploaded the same httpserver.spin that I just downloaded off your link, they should be identical to the link.
One thing I have noticed, that with PropTool V1.02 the Strings Method produces an error as I mentioned before. I got the newer PropTool 1.3.2 and it does compile without the illegal hex value.
I replaced all the files linked on that url above that you said is the latest. Still the same problem. If I run the code AS IS, direct off the site with NO changes, I can type 192.168.1.120:5000 and get HELLO WORLD!. BUT, if I change the MAC number, to my device number, or to ANY other number, the 192.168.1.120:5000 just spins and times out with "not found".
So, why does this require that the MAC number must be the number that is already in the DAT section as downloaded, when I understood from your tutorial on servebeer.com that I needed to change these settings?
DAT
mac byte $00, $08, $DC, $16, $F3, $1B
subnet byte 255, 255 ,255, 0
gateway byte 192, 168, 1, 254
ip byte 192, 168, 1, 120
port word 5000
remoteIp byte 65, 98, 8, 151 {65.98.8.151}
remotePort word 80
uport word 5050
When I open ipconfig:
Wireless:
subnet = 255.255.255.0
default gateway = 192.168.1.254
The gateway address in the "as is" source is 192.168.1.1. Is there more than one router involved in this network? Is the Spinneret connected to a router or a PC?
The spinnerete is connected via ethernet cable to the main router.
It do not understand why using a gateway of 192.168.1.254 would allow your default MAC address to return Hello World, but I couldn't enter my own devices MAC. But for some strange reason, using 192.168.1.1 as the gateway, I can use my own MAC number. Weird stuff, but whatever it takes.
Thanks for the help. I will now try to turn on and off the built in user LED from LAN. I have the index and LED files on the SD card and can see the helloworld/led options. But clicking LED ON, nothing happens. It looks like the same httpserver.htm found under hsled has the LED code.
On your Getting Started tutorial http://spinneret.servebeer.com:5000/gstart/get.htm, I put that and the index.htm on the SD drive. I also installed the HSLED.spin off the google downloads link you provided. I assumed this was required to run the LED, since the other version httpserver does not have any code for LED. The Hello World Works. When I click the LED page button, I see RESTful, LED ON, LED OFF, LED: State. If I click on LEDOn, nothing happens. If I click it twice, the wheel just spins and it is locked up, the board requires reboot to work again with Hello World. Same thing happens on LED OFF, press once, nothing, press twice, locked. I have posted both the codes from the SD and Spin. I have all the latest associated files off the google site you linked. Can you give any advice on how to get this to work so I can start dissecting it and change to my own GET requirements? Thanks [code] <html> <head> <title>Hello World</title> </head> <body> <div style="width:600px;margin:auto;"> <h1 style="text-align:center;color:blue;">Hello World!</h1> <div style="text-align:center;"><a href="index.htm">Hello World</a> | <a href="led.htm">LED</a></div> </div> </body> </html>
<html> <head> <title>GETing AJAX</title> <script language="javascript" type="application/javascript"> //Gets the browser specific XmlHttpRequest Object function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your Browser does not support AJAX!\nIt's about time to upgrade don't you think?"); } } //XmlHttpRequest object var req = getXmlHttpRequestObject(); var htmlTarget; function getRequest(resource, elementId) { // handle the case where a querystring is not detected var char = "&"; if(resource.indexOf("?", 0) == -1) { char = "?"; } if (req.readyState == 4 || req.readyState == 0) { req.open("GET", resource + char + 'ms=' + new Date().getTime(), true); req.onreadystatechange = handleResponse; htmlTarget = elementId; req.send(null); return false; } } function handleResponse() { if (req.readyState == 4) { var str = req.responseText; //alert(str); var placeholder = document.getElementById(htmlTarget); placeholder.innerHTML = str; } } </script> </head> <body style="background-color:beige;"> <div style="width:600px;margin:auto;background-color:white;padding:10px;"> <h1 style="text-align:center;color:blue;">LED</h1> <div style="text-align:center;"><a href="index.htm">Hello World</a> | <a href="led.htm">LED</a></div> <h2>RESTful</h2> <p> <a href="led.htm" onClick="return getRequest('led/23/on', 'placeholder');">LED On</a> :: <a href="led.htm" onClick="return getRequest('led/23/off', 'placeholder');">LED Off</a> </p> <p>LED: <span id="placeholder">State</span></p> </div> </body> </html>
[html]
<html>
<head>
<title>GETing to the Server</title>
</head>
<body>
<div style="width:600px;margin:auto;">
<h1 style="text-align:center;color:blue;">LED</h1>
<div style="text-align:center;"><a href="index.htm">Hello World</a> | <a href="led.htm">LED</a></div>
<p><a href="led.htm?led=on">LED On</a> :: <a href="led.htm?led=off">LED Off</a></p>
<p>LED: <span id="placeholder"></span></p>
</div>
</body>
</html>
[/html]
The HTML code in post #29 is for use in RESTful HTTP requests. This is where data is embedded in the URL.
http://spinneret.servebeer.com:5000/services/restled.htm