Recommendation for Prop to Ethernet Interface?
ManAtWork
Posts: 2,176
Hi,
I'm searching for an easy way to interface a propeller to ethernet. I don't need any complicated stuff like HTML server or DHCP. I only need a serial stream of bytes to replace the current serial communication using RS232 or VCP via FTDI chip. For reliability (automatic retransmit of lost packets) and compatibility reasons a TCP/IP stack would be good but is not absolutely necessary.
I've seen that there are obex projects for the W5100/W5200 and ENC28J60 chips. What are the pros and cons of both solutions? Has anyone experience with any of them and can recommend one? The ENC28J60 is a bit cheaper but has no built in TCP/IP so the propeller software has to be more complex, I think.
I'm searching for an easy way to interface a propeller to ethernet. I don't need any complicated stuff like HTML server or DHCP. I only need a serial stream of bytes to replace the current serial communication using RS232 or VCP via FTDI chip. For reliability (automatic retransmit of lost packets) and compatibility reasons a TCP/IP stack would be good but is not absolutely necessary.
I've seen that there are obex projects for the W5100/W5200 and ENC28J60 chips. What are the pros and cons of both solutions? Has anyone experience with any of them and can recommend one? The ENC28J60 is a bit cheaper but has no built in TCP/IP so the propeller software has to be more complex, I think.
Comments
I've been using the WIZ820io. It works great and It's easy to connect.
the reference design is some .1 uf caps and aan rj45 adapter pretty basic to build. the enc is very popular the arduino ethernet sheild uses it so you will be able to take your reference design to any mcu and there should be drivers.
www.propellerpowered.com has an encj reference board for 9 bucks if u dont wanna hassle with samples and soldeiring irons
The ENC28J60 is SPI but it's not "serial to ethernet" because it doesn't implement TCP; it's strictly an ethernet hardware layer device and you have to do your own software TCP stack. As blittled mentions this has been done and the code is out there, but it takes a pretty hefty chunk of Hub RAM for the code. The WizNet products implement the TCP stack so there's very little code on the Prop other than requesting or accepting connection on a port and sending and receiving serial data.
In addition to the ENC28J60 chip itself you need the jack and a few passives. There are numerous breakout boards available, including this cute li'l guy from Sparkfun: https://www.sparkfun.com/products/765? I like the ENC28J60 myself because you can get down and dirty with the protocol; if the WizNet doesn't do quite what you want there's not much you can do about that. But if you wanted to, for example, implement a SD card file system in the same application as the Ethernet TCP stack you wouldn't have much room left for other functions.
that sparkfun board is sure nicce but why not supoort our forum memmbers for soooo much cheaper!
http://propellerpowered.com/shop/?page_id=513
like i said the enc is a little more work takes more prop space but u can sample it or buy a board for 9 bucks if you hate it try the more exspensive solutions.
Yeah, yeah, I know a lot of people are fed up with hearing about Raspberry Pi, but it's cheap and it works. Unless you have a constraint on size it seems fine.
Go lang on the RPi and propforth on the prop is my fav. The prop thinks it has 9 cores and OS services, and the Pi thinks it has lots of deterministic software configurable peripherals. Sort of. Of course its all bleeding edge and none of the tutorials and demos are set up yet, but someone of your ability doesn't need those anyway.
Not with a single Prop over SPI, of course. But in some cases I might have more than one connected to the same ethernet and also an IP camera consuming a lot of bandwidth. Please forgive me for my ignorance but isn't it the same with ethernet and USB that a single low speed device can slow down all other devices connected to the same hub? Or will an ethernet switch translate the 10Mbit packets to 100Mbit and interleave them with other data on the common line to the PC?
Thanks for the hint. I will try it out if I have enough time and hub ram left over.
Heater and prof_braino, yes I know, the raspberry seems to be an intersting thing to play with, but it's definitely too expensive, too big and too power hungry. With a prop, wiznet chip, RJ45 jack, voltage regulator, PCB and some passives I plan to stay below $15 per unit, 2"² of PCB area and 1W power consumption.
I must admit it's a shame how little I know about thing I use every day. Long time ago when I was at the university, ethernet had no switches at all but a single coax cable backbone...
The WizNet isn't much more expensive than the ENC28J60 -- I think Parallax was a bit surprised to find this out, and it solved an integration problem for them to adopt it for their Prop-Eth solution. I still tend to favor the ENC28J60 mainly because of the control you can take. All of these small stacks exist at the bleeding edge of what TCP/IP permits; they tend not to re-order packets that arrive outof sequence, depending instead on re-requesting out of order packets as if they went missing, and some networks don't like that. Harrison did some big-time tuning of his own stack for Thumper.to smoothly play and record music, and with the WizNet you're kind of stuck with the decisions they made on that level. If it works it's really easy to use, but if it doesn't there's not much you can do about it. With the ENC28J60, you can roll your own protocol if you want.
Another option (cheaper, around $12 in China, and only consuming 0.5W with WIFI or 0.4W without) would be to use a TP-link wr703N with openwrt (http://wiki.openwrt.org/toh/tp-link/tl-wr703n) and socat (http://gertverdemme.nl/howto/arduino_serial_over_tcp_openwrt, even works directly with the serial port on teh 703 ) This gives you ethernet and wifi
I'll be in China in 2 weeks and have ordered another 4 of them (they are about 50% more expensive here in Taiwan). The two I have here are doing AP duty at the moment and I don't think my kids will like it when I remove them
Can not promise quick reply though as my new job involves strange working hours and a lot of coding (which is making me a bit less eager to play at home).
Maybe we should hint to Parallax that low-quantity valid MAC addresses might be a product worth offering. How cool would it be to have Parallax come up as the vendor of your Eth hardware?
It also looks like there is a range set aside for XEN for virtualization purposes.
I don't know what can be considered low or high volume. I plan to sell 1000+ a year. It will run in industrial environment and I can't forsee what else will be connected to the network, so it would be best if it's compliant to the rules.
I searched the internet a bit. I'm a bit scared buying MAC addresses directly from the IEEE. Although it might be not as expensive as expected I don't like bureaucracy. There are MAC address ROMs available from microchip like the 24AA02E48T for example. They don't cost much, around $0.20 for quantities >100. So a combination of the ENC28J60 and 24AA02E48T would still be cheaper than the Wiznet chip. The big advantage is that I don't need to change the spin code for every unit I program. The P&P machine can do the job. And I could use the unique number as a license key (dongle) for my PC software. It's easy to hack for the clever programmer so it's no real copy protection but at least a "childlock". Unfortunatelly, the 24AA02E48T has only 8kbit of EEPROM space, not enough for the propeller code, so I still need the 24C256.
ENC28J60: $2.32
24AA02E48: $0.20
ENC624J600: $3.22
W5200: $4.34
So the ENC28J60+24AA02E48 combination offers the lowest price. It's even lower than that of the FTDI USB chip (without magjack). The TCP/IP stack of the Thumper internet radio seems to be well documented and tested. It is said that it is very robust against lost packages and other network problems. The chip packages (SSOP28 and SOT23-5) have small size but are still well solderable (0.65mm pitch). Speed (10 vs. 100Mbit) is no issue. So I think the decision is clear, finally.
(* 100+ pieces, source: microchip direct, mouser)
I understand hating bureaucracy but to me the process appeared pretty well automated, not so different than buying a high-ticket bit of merchandise online. The MAC address ROMs are a solution obviously, but they turn software into hardware and, since they can't support a Spin image, an extra part. (You could eliminate the extra part by programming your Spin PROMs first, then overflashing with the MAC address in some high area not used by your program or even going to a 24C512, but then you end up with a pile of PROMs that were used to transmit safe MAC addresses to you, which seems ridiculously wasteful.)
But many thanks for your help!
http://tibbo.com/products/?form_filter=yes&wclass_set=out&type%5B%5D=module&type%5B%5D=add-on&class%5B%5D=programmable
I suggest you the EM500, is enough for your needs. With the optional GA1000 module beside the wired Ethernet you gain also the WiFi. You can use both the connections at the same time. Upgradable and programmable through ethernet, can be used as serial server (ethernet to serial, have virtual COM drivers for windows ad Linux). The development IDE is free, is programmable in basic and you can offload many tasks from the prop. You can use it as a web server also giving thus a nice interface to the prop. You can upgrade the prop firmware with it (some tricks are needed but works through the wired and wireless IF).
Some features/capabilities: MySQL client, FTP server/client, WEB server/client, SMTP, SNTP, PPPoE, DHCP, DNS, NBNS... WPA/2-PSK ... I2C, SPI, ModbusRTU ... very easy to program
The only week point was that you can program it freely without any password request7protection over ethernet. But this has been solved.
If you need more than 8 IOs you can go to EM1206(17), EM1202(32), EM1000(54)
Anyway, it might be interesting to others who read this. If you only need a single or few unit(s) then development time is more important than saving some $, of course.
BTW, does somebody know a source for cheap magjacks (vertical inlet preferred)? I found some without LEDs for around $2 but the ones with LEDs seem to be at least twice as expensive. I could add discrete LEDs but this would require custom case/panel cutouts.