Ethernet help

jmumby

Senior Member
Hi,

I guess everyone that has Ethernet on their project uses the same methods to communicate. Specifically with the internet, maybe twitter updates or getting data.

So maybe you can help get my head around my current problem. I have a serial to Ethernet module that supports ARP, UDP, TCP, ICMP, Telnet, TFTP, AutoIP, DHCP, HTTP, and SNMP. I want the module to read a web age and parse it. I can't get past the first step of connecting to a sever and pulling down a page!

Do you have sample code from simple lan or xport you can share?

chrs
 

Anobium

Senior Member
I may be able to provide you a toolkit to support your needs.

I have just completed a project (see http://www.picaxeforum.co.uk/showpost.php?p=146046&postcount=9) for a high level architecture.

It essentially takes data (XML but it really could be data in any format) to/from the serial port of the Picaxe via then Telnet interface then via a web service for presentation to your browser. I can now access my devices from anywhere on the web! Sad but true.

You have some choices from my limited experience for the component the Serial to Ethernet, they are (I am sure other will add more, I have tested all these options).

1. If you have computer local to the Picaxe and the computer has a serial port then you can interface the Picaxe via the local computer.
2. If you have a computer available but with an RS423 operating distance then this computer can be used.
3. If your XPort device provides telnet access then you can use this device.( used the WIZ107R Ethernet Adapter but the principle of Telnet access would remain the same.


Whatever option is chosen, you end up with an data stream then can be easily transformed via the web service. From the kit I have built it should be easily possible to extend the data, change the HTML pages, add Twitter etc as all the major hurdles (from my perspective, I guess :) ) have been resolved.

So, all that said. What are you trying to do? I am willing to build a kit that can be re-used.

Anobium
________
Ipad cases
 
Last edited:

jmumby

Senior Member
I have a wiport hooked up to a picaxe, I just want to be able to pull data from a website using GET or submit data using POST. At the moment I can't get anything out of it. I think this is just a lack of understanding, or the wiport connection is not configured correctlly.
 

Anobium

Senior Member
OK.

Which Picaxe device? Please the code you have, and post any diagrams that will help us understand the environment you are building.

Do you have a link for the wiport? A pdf? a link to the instructions?

:)
________
VAPORIZER AFFILIATE
 
Last edited:

hippy

Technical Support
Staff member
@ jmumby : I think you have to approach getting help on this in a different way. I doubt many people have used ethernet with PICAXE, fewer in the way you are seeking to, and will likely not have a clue how it would be done. Basically you probably have more knowledge than any other PICAXE user.

You therefore need to get people on-board to help you to achieve what you want, buy into what you are doing, something like -

I've got one of these ...
The datasheet ( here, on page X ) says I need to configure it like this ...
My configuration is ...
It's in a setup which looks like this ...
I've done this, that and the other and that all works / doesn't work
I'm trying to do this ...
The datasheet ( here, on page X ) says I need to do it this way ...
My code is like this ...
It doesn't work, the result I get is ...

The first set the background, bring people into your world, lets them get an understanding of what they are unfamiliar with and also a feeling for where you are with what you've done. The last four are the problem you need help with.

It's much easier to do an analysis, 'when this is done, this should happen, but this is what happens' than to answer a much more open ended question; "my car does not start; why" ? At least with a car people can make guesses ( flat battery, didn't turn ignition on, no fuel ), but with something they don't know they won't know what could be wrong, could be anything.

You'll do much better in getting people to 'look at this code, look at page X of the datasheet; does that look right' ? It makes it seem relatively a straight-forward task and more people are likely to step forward in trying to help.
 

jmumby

Senior Member
I have a 20X2 hooked up to a Lantronix wiport. The lantronix wiport is a serial to wifi module. It has two serial ports a wifi radio as well as wired ethernet. It supports supports ARP, UDP, TCP, ICMP, Telnet, TFTP, AutoIP, DHCP, HTTP, and SNMP protocols.

If I were to make a telnet connection in cmd (windows command prompt) like

Code:
telnet servername.com 80
it would make a connection that server, if I were to issue the following command

Code:
GET http://servername.com/index.html
I would get the contents of that page within my cmd screen. This is essentially what I want to be able to achive with my wiport so I can parse a web page. Picaxe ability to parse the data is not in question here as index.html will be constructed in such a fashion that it will be easy to parse.

The bottom of page 47 in this http://www.lantronix.com/pdf/WiPort_UG.pdf guide demostrates how to make a connecton. Which I have tried with...


Code:
SEROUT WIPORT_TX,t9600_16,("Cservername.com/80",13,10)
then followed this up with.

Code:
SEROUT WIPORT_TX,t9600_16,(13,10,"GET /test.txt HTTP/1.1",13,10,"HOST: servername.com",13,10,"USER-AGENT: WIPORT",13,10,13,10)
Servername is actually just my desktop running a webserver. I am using wireshark to sniff the packets coming into my desktop and it shows no traffic what so ever from the wiport.

I know the picaxe and wiport are talking to each other as I can put the wiport into config mode using the picaxe.

Hopefully this is a bit more specific. Once again I may just have a fundamnetal flaw in my thinking here
 

hippy

Technical Support
Staff member
Thanks, that really does help.

Does your webserver actually have a domain name ( ie "servername.com" ), and is the PC running a DNS server with that domain name in it, linked to your PC's IP address, responding to DNS lookups ? Are there any firewalls etc blocking or intercepting DNS requests ?

I'd try using just the dotted IP address so no DNS would be required, disconnect from the outside world, turn off all firewalls, and use a directly wired connection into the server PC.

Also, if there's an ability to ping a dotted IP address, I'd start with that. Can you get the module to ping your desktop ? Plus can your deskop ping the module ?

I'd personally add a second network card to my PC with a static IP address so no confusion about addresses ( 10.0.0.* or 172.16.0.* rather than 192.168.*.* ) and connect the module directly to that, give it a static IP address on the same sub-network. Make sure the Network Mask on both is the same (255.255.255.0); Windows seems to get a bit confused if there's a mis-match though in theory it shouldn't.
 

hippy

Technical Support
Staff member
Actually, first thing before getting the module to work ...

Get another PC/laptop configured as the module is, make sure that can telnet into the web server etc.
 

jmumby

Senior Member
I just used 'servername' as an example, I actually use the IP of my desktop. I can ping the wiport, if I browse to the wiport via firefox I can setup the wiport config and wireshark shows all this packet data. I may have to connect to the spare serial port on the wiport via another computer and see if I can simulate what I want the picaxe to do.
 

hippy

Technical Support
Staff member
Maybe an example of your code showing exactly what you do send may help :)

Though "/" and ":" are allowed for port specifier, I'd suggest getting into the habit of using ":" as IP/something will confuse most readers into thinking that's a network mask rather than a port.

Having realised wiport is Wi-Fi the wired-stuff won't really help you. Can you telnet from a laptop over wireless and get your HTML pages from the desktop server ? Proving the desktop is handing out to a remote is as crucial as the desktop seeing the remote.
 

jmumby

Senior Member
This looks like a wiport issue. I can get the wiport to automaically connect to the desktop but I can't force a connection. This probably wouldn't be so bad if I could use servernames but so far it looks like IP only. So now I can pull data using GET, atleast the concept is good.
 
Top