Sweet Jeebus! I cannot make my network test work!
KamPutty
Posts: 48
Hi all,
Well, I'm about to give up and sell everything I own and move to the middle of the desert and open a Kodak drive thru processing store.
I've been trying to get a stupid network "hello world" working and I cannot make it work! I had a nic board from FutureTek and could not make it work, so thinking that it was defective, I ordered a nic board from uController, soldered it all up and still no go! BLA!
All I want to do is connect to a web site and display the contents (raw html) to the tv. I took the examples in the object exchange and changed only the "main" file to this
From the command line, if I do a "telnet 74.125.19.104 80" and press "x" and <cr>, I get back an error html string. Thats all I'm trying to do in the code
I'm sure my network settings are fine; doing a "ipconfig /all" I get the following (from my laptop - same network)
My wiring looks sound - was the same setup on both nic boards...
It just sits at the "waiting to connect" loop and never gets to the rest of the program...also, I picked "1234" as my local port, I changed this to make different values, but no luck!
Any thoughts?
~Kam The Sad
Well, I'm about to give up and sell everything I own and move to the middle of the desert and open a Kodak drive thru processing store.
I've been trying to get a stupid network "hello world" working and I cannot make it work! I had a nic board from FutureTek and could not make it work, so thinking that it was defective, I ordered a nic board from uController, soldered it all up and still no go! BLA!
All I want to do is connect to a web site and display the contents (raw html) to the tv. I took the examples in the object exchange and changed only the "main" file to this
' simple ethernet test CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 OBJ term : "TV_Text" settings : "settings" nic : "driver_socket" DAT long 0 ' long alignment for addresses, don't remove MAC BYTE $10, $00, $00, $00, $00, $01 IP BYTE 10, 200, 1, 166 MASK BYTE 255, 255, 255, 0 GATEWAY BYTE 10, 200, 1, 1 DNS BYTE 10, 0, 0, 1 REMOTEIP BYTE 74, 125, 19, 104 ' www.google.com VAR long stack[noparse][[/noparse]100] long handle byte rxChar PUB init | i settings.start settings.setData(settings#NET_MAC_ADDR,@MAC,6) ' set MAC settings.setData(settings#NET_IPv4_ADDR,@IP,4) ' set MY IP settings.setData(settings#NET_IPv4_MASK,@MASK,4) ' set MASK settings.setData(settings#NET_IPv4_GATE,@GATEWAY,4) ' set Gateway settings.setData(settings#NET_IPv4_DNS,@DNS,4) ' set DNS ' Start the TV Terminal term.startWithMode(12,term#MODE_NTSC) ' lets start the nic services ' p0 = cs ' p1 = sck ' p2 = si ' p3 = so ' p4 = int if not \nic.start(0, 1, 2, 3, 4, -1) ' -1 = use external clock term.str(string("Unable to start networking!")) waitcnt(clkfreq*10000 + cnt) reboot term.str(string("Connecting to http server...")) term.out(13) handle:=nic.connect(@REMOTEIP, 80, 1234) term.str(string("Handle = ")) term.dec(handle) term.out(13) ' wait to connect term.str(string("Waiting to connect...")) term.out(13) repeat until nic.isConnected(handle) term.str(string("Sending dummy character...")) term.out(13) nic.writeByte(handle, 65) nic.writeByte(handle, 10) nic.writeByte(handle, 13) ' read in all the chars forever repeat rxChar:=nic.readByte(handle) term.out(rxChar)
From the command line, if I do a "telnet 74.125.19.104 80" and press "x" and <cr>, I get back an error html string. Thats all I'm trying to do in the code
I'm sure my network settings are fine; doing a "ipconfig /all" I get the following (from my laptop - same network)
IP Address. . . . . . . . . . . . : 10.200.1.103 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.200.1.1 DHCP Server . . . . . . . . . . . : 10.200.1.1 DNS Servers . . . . . . . . . . . : 10.0.0.1
My wiring looks sound - was the same setup on both nic boards...
It just sits at the "waiting to connect" loop and never gets to the rest of the program...also, I picked "1234" as my local port, I changed this to make different values, but no luck!
Any thoughts?
~Kam The Sad
Comments
Wish I could help more, but can't now. Where's Harrison?
Normally local port is a pid number ... seems like non-zero should be fine. Seems you don't check for handle < 0 before using it. Connect returns -1 on error.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The handle comes back as "1"...I'm using the Prop Demo Board.
~Kam (^8*
have been in the crosover-hell a few times here. [noparse]:)[/noparse]
I sure the cable is fine, I can take the *same* cable and plug it in my laptop and no issue getting IP...
~Kam The Sad
·
"...I sure the cable is fine, I can take the *same* cable and plug it in my laptop and no issue getting IP..."
·
Some·10/100/100 Ethernet cards can automatically detect the polarity of the cable and make the proper adjustments.· The fact that your laptop "works" may not be a true test because it can detect and compensate if the polarity happens to be reversed.· Check and see if you are using a network cable that swaps the polarity or if it is a straight through connection... sometimes it will say on the cable itself.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
The cable says "Patch Cable"...I tried 2 others, same result. Grrrr!
For those people where the NIC *does* work, can you take my test program (in thread), and only change the IP info, can you make it work? Same program, different IP info. All it does it hit google, and google will return an error that I will capture...
Thanks all for helping, this is driving me crazy!
~Kam The Super Sad
I've looked at this today, and I can get a connection using the steps in your code with static IP and DHCP addresses. For some reason I can't get page data though :<
Looking at your configuration, it is unlikely that 10.xx.xx.xx is a normal IP address. You might have better luck if you try using DHCP.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
So do this (note the long align is after the MAC address):
Also, what board / eeprom are you using? I believe the ybox2's settings object requires a 64KB eeprom in order to store / load settings. It looks like you can change one constant in settings.spin to make it work with a 32KB eeprom. This will only affect you if you call settings.commit.
You should also try pinging your device to see if the driver is working. ICMP is way easier to get working than TCP across the internet.
Post Edited (Harrison.) : 8/17/2008 7:52:17 PM GMT
I've attached some code that works which is a variation of the ybox2 stuff. If you set useDHCP <> 0 it will negotiate an IP address for you, otherwise you will have to change settings by hand. Don't forget to change the ENC start driver pin settings (mine are very different). Also, I'm testing this by loading RAM ... I'm pretty sure saving to EEPROM will not work.
Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Sorry for not letting ya'all know the results, and the result is....
It's still a no go. Even using DHCP it just will not talk on the network. I'm wondering if the Demo Board is bad, as in a bad output pin.
I've used different cables, different hugs/routers/switches....nada.
I guess the next step is to put a LED on each pin and just make sure that they are functional...
I'm just not sure where to go from here...very frustrating!
I cannot even get ybox2's widgets to work...nothing!...I do get nice TV display!!!
Anyone in the San Jose area that can help? I'll buy pizza+beer!
Maybe the first "San Jose Prop Get Together" event will be "Get Kams Stupid Network Working"
Well, back to work hell (client wants to add last minute functionality to the DVR product we're building for them! )
Take care all,
~Kam The No Network Sad Guy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio - the modular Development system for the Propeller
PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!
SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
http://forums.parallax.com/showthread.php?p=606048
Space is tight with the ybox2 code, but you might be able to squeeze it in. I'm in San Jose, but not sure if we could find a good location for "Propellers and Beer" [noparse]:)[/noparse] Don't drink and spin [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
I don't think it's your module, the same happens with the FutureTec board...
What would be the best way of checking/validating that it works? I do have a logic analyzer, so it might be time to verify pins etc...
Bandwidth is tight this week...stupid work.
"Propellers and Beer" [noparse]:)[/noparse] Don't drink and spin <-- I love that!
Okay, no beer then, just food!
~Kam The Feeling Better But Still Sad