PDA

View Full Version : PropNIC Good Code Examples needed



mctrivia
05-27-2010, 03:38 AM
ucontroller.com has a great little nic card for $29.99 but some code examples are really needed.

1) How to aquire a Dynamic IP from the local DHCP server
2) How to download a xml/text file from a web server
3) How to send get/post commands to a web server

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lots of propeller based products in stock at affordable prices. (http://propmodule.com/catalog/ref.php?refid=c81e728d9d4c2f632)

StefanL38
05-27-2010, 04:09 AM
search the obex for tcp (http://obex.parallax.com/objects/search/?q=tcp)

best regards

Stefan

mctrivia
05-27-2010, 04:13 AM
ok but can someone provide a sample code to download a xml file using this?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lots of propeller based products in stock at affordable prices. (http://propmodule.com/catalog/ref.php?refid=c81e728d9d4c2f632)

Microcontrolled
05-27-2010, 07:17 AM
Yes, I second this, PLEASE someone tell how to download a text webpage!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!! (http://microcontrolled.propmodule.com/home.html)

Use the Propeller icon!! http://www.proptools.org/images/Propeller.gif

Follow me on Twitter! Search "Microcontrolled"

WBA Consulting
05-27-2010, 10:49 PM
I will third that request, especially if it will lead me into ways to strip data from a XML formatted gpx file downloaded from GeoCaching.com. I would like to be able to pull Lat,Long, etc from the attached file for a current project I am working on.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andrew Williams
WBA Consulting
WBA-TH1M Sensirion SHT11 Module (http://www.aestheticacoustics.com/sht11_01.htm)
My Prop projects: Reverse Geo-Cache Box (http://forums.parallax.com/showthread.php?p=869153), Custom Metronome (http://forums.parallax.com/showthread.php?p=906277), Micro Plunge Logger (http://forums.parallax.com/showthread.php?p=875698)

parts-man73
05-28-2010, 01:16 AM
I've used the programs written for the Ybox2 with a PropNIC/SpinStudio or PropNIC/Demo Board setup and it all works good with minor changes for peripherals on different IO pins, etc.

svn.deepdarc.com/code/ybox2/trunk/firmware/ (http://svn.deepdarc.com/code/ybox2/trunk/firmware/)

look particularly at "infowidget.spin" it retrieves and parses weather information. This sound similar to what you are looking to do.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian

uController.com (http://uController.com) - home of SpinStudio - the modular Development system for the Propeller

PropNIC (http://uController.com) - Add ethernet ability to your Propeller! PropJoy (http://uController.com) - Plug in a joystick and play some games!

SD card Adapter (http://uController.com) - mass storage for the masses Audio/Video adapter (http://uController.com) add composite video and sound to your Proto Board

Microcontrolled
05-28-2010, 07:24 AM
I still don't get it. What part of that code is just downloading the webpage?? Sorry to be so difficult, but can we (the 3 of us) have a straightforward-no-bells-or-whisles example of how to JUST start the PropNIC and download the webpage code???

Thanks,
Micro

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!! (http://microcontrolled.propmodule.com/home.html)

Use the Propeller icon!! http://www.proptools.org/images/Propeller.gif

Follow me on Twitter! Search "Microcontrolled"

mctrivia
05-28-2010, 08:56 AM
that code may be helpful but the lack of notes makes it very difficult to follow.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lots of propeller based products in stock at affordable prices. (http://propmodule.com/catalog/ref.php?refid=c81e728d9d4c2f632)

localroger
05-29-2010, 05:30 AM
Part of the problem is the Prop really doesn't have enough RAM to do tcp 'right' and leave room for anything else (especially a SD card). Harrison's stack (which is the engine in the YBOX2) is about the only thing out there, and there are several versions of it floating around. It doesn't do DHCP and the closest I know of to a web browser (as opposed to server) example is the ybox2 infowidget mentioned by Brian. I've given up on my attempts to make it work in Spin to pursue a system for executing larger business logic codebases from external storage, which will make it a lot easier to do file system, ethernet, and significant other stuff all at the same time.