Spinneret Errors (Can't load page!)
rapscaLLion
Posts: 75
Hi,
I'm using the latest (I think!) HTTPServer build, and am having trouble with serving simple pages. The Spinneret is connected via router to a closed wireless LAN, no WAN access. Desktop computers can access the Spinneret with seemingly no problem (which is to say that the page and contents display properly). An iPad running iOS 5 seems to be the same. However, an iPhone 4 running iOS 5 is extremely unreliable in accessing the pages. On rare occasion (I would guess once every forty or more attempts) I can get the whole page to load, more commonly (once every twenty attempts?) I get the partial page (which seems to be just the html, no images, css or js).
When I look at the PST results, I see that even when the page loads successfully on PC or iPad, there are timeouts seemingly at random. On the iPhone, in most cases there is nothing served and a single timeout appears in the PST as soon as the request is sent.
I am inclined to believe that it's not my htm/css/js/png files or code, since the extremely basic Serverbeer Hello World page exhibits the same problems
My config in the HTTPServer.spin is as follows:
mac byte $00, $08, $DC, $16, $F2, $6E
subnet byte 255, 255 ,255, 0
gateway byte 192, 168, 1, 1
ip byte 192, 168, 1, 150
port word 80
remoteIp byte 65, 98, 8, 151 {65.98.8.151}
remotePort word 80
The PST results are attached, with explanations of what's going on in each section. The ONLY code modified in the HTTPServer was the config setup as shown above.
Any thoughts?
EDIT: Same results on an alternate Spinneret unit and different ip/port settings.
I'm using the latest (I think!) HTTPServer build, and am having trouble with serving simple pages. The Spinneret is connected via router to a closed wireless LAN, no WAN access. Desktop computers can access the Spinneret with seemingly no problem (which is to say that the page and contents display properly). An iPad running iOS 5 seems to be the same. However, an iPhone 4 running iOS 5 is extremely unreliable in accessing the pages. On rare occasion (I would guess once every forty or more attempts) I can get the whole page to load, more commonly (once every twenty attempts?) I get the partial page (which seems to be just the html, no images, css or js).
When I look at the PST results, I see that even when the page loads successfully on PC or iPad, there are timeouts seemingly at random. On the iPhone, in most cases there is nothing served and a single timeout appears in the PST as soon as the request is sent.
I am inclined to believe that it's not my htm/css/js/png files or code, since the extremely basic Serverbeer Hello World page exhibits the same problems
My config in the HTTPServer.spin is as follows:
mac byte $00, $08, $DC, $16, $F2, $6E
subnet byte 255, 255 ,255, 0
gateway byte 192, 168, 1, 1
ip byte 192, 168, 1, 150
port word 80
remoteIp byte 65, 98, 8, 151 {65.98.8.151}
remotePort word 80
The PST results are attached, with explanations of what's going on in each section. The ONLY code modified in the HTTPServer was the config setup as shown above.
Any thoughts?
EDIT: Same results on an alternate Spinneret unit and different ip/port settings.
Comments
"remoteIp byte 65, 98, 8, 151 {65.98.8.151}"
Didn't Mike G say 65.98.8.151 belong to Servebeer? If you google "whats my ip", your own Ip will be displayed. Try using that as your remoteIp.
The new config is as follows:
mac byte $00, $08, $DC, $16, $F1, $E3 {$EF, $22 or $F1, $32}
subnet byte 255, 255 ,255, 0
gateway byte 192, 168, 1, 1
ip byte 192, 168, 1, 152 {120 or 122}
sntpIp byte 69, 25, 96, 13 {San Jose CA}
port word 5000
port2 word 5010
remoteIp byte 65, 98, 8, 151 {65.98.8.151}
remotePort word 80
uport word 5050
Everything else is working?
The running source code is as current on the Spinneret Google code repository. The following is the DAT again, which contains the ONLY modified portion of code:
DAT
mac byte $00, $08, $DC, $16, $F1, $E3 {$EF, $22 or $F1, $32}
subnet byte 255, 255 ,255, 0
gateway byte 192, 168, 1, 1
ip byte 192, 168, 1, 100 {120 or 122}
sntpIp byte 69, 25, 96, 13 {San Jose CA}
port word 80
port2 word 81
remoteIp byte 65, 98, 8, 151 {65.98.8.151}
remotePort word 80
uport word 5050
emailIp byte 68, 6, 19, 4
emailPort word 25
sntpPort word 123
status byte $00, $00, $00, $00
rxdata byte $0[RxTx_BUFFER]
txdata byte $0[RxTx_BUFFER]
tempBuff byte $0[TEMP_BUFFER]
fileErrorHandle long $0
debug byte $0
lastFile byte $0[12], 0
closedState byte %0000
openState byte %0000
listenState byte %0000
establishedState byte %0000
closingState byte %0000
closeWaitState byte %0000
lastEstblState byte %0000
lastEstblStateDebug byte %0000
udpListen byte %0000
tcpMask byte %1111
udpMask byte %0000
fifoSocketDepth byte $0
fifoSocket long $00_00_00_00
debugSemId byte $00
debugCounter long $00
stringMethods long $00
closingTimeout long $00, $00, $00, $00
udpLen long $00
time byte "00/00/0000 00:00:00", 0
httpDate byte "Wed, 01 Feb 2000 01:00:00 GMT", 0
globalCache byte $0
dynamicContentPtr long @txdata
I'm attaching my main htm. The css and js are not included, but the js is the current minified jQuery build. Like I said however, the Hello World page with no dependencies is equally problematic.
Currently it's all connected to a LinkSys WRT54GL running Tomato Version 1.27 firmware. I have tried it as DHCP and with static ip setups. No difference either way.
Since the whole point of this project is for it to be accessed entirely on iPads/Pods/Phones, intermittent function is really not ideal. Also, there will be an AJAX component that will need to function reliably, and in a time sensitive manner. Besides, at this point I'm completely unable to load the page on the iPhone.
Thanks a lot for your help thus far!
When I was creating HTTPServer, it was a lot of work to handle all the mainstream browsers. This was not an easy task. They all handle connections a bit differently. Some are inpatient and some are forgiving...
It sounds like a little time patience is needed to figure out what's going on.
I'm assuming that the iPhone and iPad are connecting over WiFi?
Like I said, iPad works fine (the page loads and functions, even though there are some timeouts in the PST). The iPhone's Safari debug hasn't been of much help, save to point out that it never downloads the .js file.
I'm about to try the whole setup on a different wireless router, as for whatever reason I can't get the Spinneret to appear on the Linksys' device status list. I'll let you know how that goes, but I doubt its the problem since the iPad works...
Thanks for your help!
How do you know the .js file does not download? Do you see the resource request? Are you getting a 404? What happens to the initial request? Do you have a copy of the request header?
The best thing to do is create a simple test/logging app and start experimenting.
I sometimes see the resource request, sometimes not. How might I be able to get a copy of the request header from the iPhone? I'd love to see it
Interestingly I just discovered it works just fine on an iPhone 4S. All of the test phones are up to date with the latest iOS updates, so I'm not sure why 4S works and 4/3GS don't.
Use a packet sniffer to see the data flying between the Spinneret and the other device by MAC address.
I'm guessing the culprit has something to do with socket connections, the W5100, and the status register parser. I'm sure it can be fixed with a little patience and troubleshooting.
Do we have a taker?
I'll gladly whip this thing into shape but I'm in the middle of a project. I will not have the time for several weeks. Plus someone would have to lend me an iDevice.
BTW, my Android phone works great!
Mike: The pst.str(@data) is not in the main loop, at least in the version I'm running (07/16/2011). Where can I put it where it will be useful? I'll see about setting up a packet sniffer and get back to you.
Thanks for all the help guys!
Here's the current setup:
Linksys Router: 192.168.1.1
Spinneret: 192.168.1.100 (port 80)
iPhone: 192.168.1.181
PC: 192.168.1.127
For whatever reason, the iPhone 4 doesn't ever get to send a GET request because it can't ever find the server. This is the packet that shows up on page request:
1 0.000000 Apple_20:1a:44 Broadcast ARP 60 Who has 192.168.1.100? Tell 192.168.1.181
Then nothing. After a few seconds there's a flurry of activity between the PC on the network, the router and various external IP addresses. Not sure if it's related, and they never communicate with the iPhone.
What this means to me (a complete layman) is that the router doesn't really know where the router is. I can not - and have not ever been able to - see the Spinneret in the device list (tried two different routers, with assigned IPs and DHCP). However, that theory doesn't make a whole lot of sense when I run the request from the PC. These are the packets I get with the PC:
1 0.000000 Intel_a3:95:2b Broadcast ARP 42 Who has 192.168.1.100? Tell 192.168.1.127
2 0.000737 Wiznet_16:f1:e3 Intel_a3:95:2b ARP 60 192.168.1.100 is at 00:08:dc:16:f1:e3
(The GET request comes a few lines later)
6 0.002215 192.168.1.127 192.168.1.100 HTTP 349 GET /test.htm?led=on HTTP/1.1
(And the response shortly after)
10 0.081910 192.168.1.100 192.168.1.127 HTTP 60 HTTP/1.1 200 OK (text/html)
So why can my PC find the server as well as an iPad, and not the iPhone 4? Why does the router not show the Spinneret in the device list (even if I assign its MAC address to its ip)?
Let me know if you need more complete copies of the logs.
Thanks!
Am i'm pretty sure it exists in all version as I always have to use it but I'm often mistaken.
Sorry for the absence, had to work on another project for a few weeks.
So the pst.str(@rxdata) is not in the version of code I'm running, but I added it in under the if(debug) section of main.
Here's a request from Chrome on a PC, which always loads the page without a problem:
Here's a few failed requests from Safari on iPhone 4g running iOS 5.1:
I notice that the request count does not increment... what does that indicate?
Now I've stated before that on RARE occasion, the page will load incompletely on an iPhone 4G or 3G, and even rarer still a complete page load will occur. However the AJAX on the page does not work as the connection doesn't seem to persist.
Here is an extremely rare complete page load via iPhone in the iCab browser set to send a request header with "Mozilla" as the user agent. Not sure if this is related?
Very confusing... the page loads complete with css and javascript and all images, but the Ajax doesn't work at all as the connection goes dead right after the page load.
I'm noticing the failed requests don't actually increment the request count... what does this mean?
Thanks for your time and advice!!!
So what would prevent the
Is this the correct way to address the issue? Because the page now works, AJAX and all on my iPhone 4G. Haven't tested with 3G or iPods yet.
Cheers
If you have a device on the network broadcasting and ARP packet, and no response that is strange. Try changing your Spinneret's MAC and rebooting everything on the network including the router, if you haven't already.
So having a longer retry wait fixed the iPhone issue - sweet. That's good to know.