Shop OBEX P1 Docs P2 Docs Learn Events
Propeller and ethernet - please lessen the confusion — Parallax Forums

Propeller and ethernet - please lessen the confusion

pacmanpacman Posts: 327
edited 2010-03-07 04:35 in Propeller 1
I've searched (and searched) for my original thread on this, but I can't find them {I'm sure someone smarter than me will find it first go}

I need to generate a magic packet for a remote laptop (this idea was dead for a while, but now it's 'required' again).

Magic packets are 'carried' over UPD. Basically the prop would be powered up, wait 5? seconds, send the magic packet (perhaps three times to make sure the laptop wakes up) then goes to sleep until next power cycle. The prop and the laptop would be the only two items on this network.

What is the current state of play with Ethernet drivers (that will allow the noob {me} easily send a UDP packet)? I'm very lost....

I've had a quick look at Harrisons object (V5.0) but can not see a SendUDPMessage type of function. Am I missing it, is it not there, should I be doing it another way {and call you tell me what that is please}?

Should I be using a different object {which one?}


Additionally if you have designed/built/sell a board that has all the Ethernet/propeller/eprom stuff on it (and could survive in a 55 degree C environment for a long time) then please drop me a line.

Thanks in advance.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
=================
The future is in our hands.
Which way to the future?
=================

Comments

  • RossHRossH Posts: 5,519
    edited 2010-02-19 08:45
    Pacman,

    I'm trying to figure out what your application is. All I can think of is some kind of warning system to stop people dozing off while using their laptops in a sauna.

    Am I close?

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • Nick McClickNick McClick Posts: 1,003
    edited 2010-02-19 09:03
    I remember reading about someone else doing stuff with magic packets. If I recall correctly, you could just bit-bang out a magic packet. I'll have to find the tread - I could be wrong, though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Forums RSS Feed!

    Gadget Gangster - Share your Electronic Projects
  • pacmanpacman Posts: 327
    edited 2010-02-19 09:21
    @RossH

    If I tell you, I'll have no chance of making my millions....


    These laptops run some specialist data logging software - unfortunately they are in remote locations (mostly underground in flameproof enclosures). No PC (even the expensive industrial ones) has survived for more than a couple of weeks - heat/vibration. In the end the decision was made to just use cheap laptops and just replace them every couple of months.

    Being underground the laptops can't use batteries.

    Power frequently gets turned off.

    But the laptops don't autmagically turn back on, hence the reason to wake then up.

    A dedicated - easy to use magic packet generator could be used in many areas of my industry.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    =================
    The future is in our hands.
    Which way to the future?
    =================
  • AleAle Posts: 2,363
    edited 2010-02-19 09:38
    You mean using wake-on-lan. That is quite smart. I can sadly do not add anything. You may bit-bang it or you could use a ENC28J60 and a transformer or socket with transformer inside.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
    pPropellerSim - A propeller simulator for ASM development sourceforge.net/projects/ppropellersim
  • TonyWaiteTonyWaite Posts: 219
    edited 2010-02-19 10:28
    Hi Pacman,

    At last a thread that I know something about, so that I can contribute to the forum!

    It shouldn't be too hard to solve the problems here.

    The temperature is not extreme; dissipating the heat in a confined space is a well-known art;
    smart power monitoring/backup for controlled startup/shutdown is pretty standard for many applications, eg
    transport or infrastructure.

    (I scrape a living designing rugged computers/peripherals, mainly for things like CCTV on trains/trams; number-plate
    recognition sytems over motorways etc. Others then multiply the prices by big numbers and drive fast cars.)

    These kind of harsh environment problems are more mechanical than anything else and it's
    straightforward to apply standard 'rugged' solutions. Design/small-batch manufacture of reliable PC's for things
    like the military/offshore oil/mining etc is in itself relatively inexpensive.

    Tell us more ...

    Regards,

    T o n y

    Post Edited (TonyWaite) : 2/19/2010 10:38:48 AM GMT
  • jeromelabjeromelab Posts: 31
    edited 2010-02-19 11:29
    Some laptops and all mini-itx industrial PCs can "automagically" start after power failure, you have to look in your Bios under Power management. I am using VIA pico ATX industrial PCs (and some Atom Intel mini itx boards) in very humid, dusty and cold environment, I spray some PCB silicon conformal coating over the motherboards and I use CompactFlash as HDD, I secure everything with Hot glue and power these boards with 12V DC (power supply is Class I, IP67, installed in a separate box) they are installed in IP67 aluminium boxes (for heat dissipation). I have had no failures since 2 years.
  • pacmanpacman Posts: 327
    edited 2010-02-19 13:01
    One install is on a BSL unit on a longwall face - it gets the sh_t shaken out of it. We have tried some of the industrial pc over the years, but find a laptop lasts just as long at a fraction of the price.

    The software used is _old_ it runs on XP (with much persuading). Vista = forget it.

    In order to communicate with some of the other pieces of gear we use a dedicated (and expensive) PCMCIA card. Whilst I wish we could move to a newer platform the expense (last costed @ 46K AUD just for the software) kinda meant we have sought other methods.

    Hence my idea.

    One other 'reason' is that I can see a need for this with some home users - Imagine a {guess} $30 kit available from Sparkfun or Gadget Gangster. I personally think they would sell more than a few a year. Yes some of the newer hardware automatically re-powers, but there are quite a few older pieces of kit in the home /very small business that might find such a beasty useful. I have priced a commercial magic packet generator device and I just about fell off my chair when quoted over $3K (for something I reckon the Prop could do standing on it's ear).

    I did have a working pro type working on a PIC 4520 on an Olimex board, but that was before I found the Prop.

    One other (the biggest?) reason for doing it with a prop - I want to prove it can be done. And when I need to prove it can be done.....well 'logic' may not play a real big part..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    =================
    The future is in our hands.
    Which way to the future?
    =================
  • Harrison.Harrison. Posts: 484
    edited 2010-02-19 16:09
    Magic packets are very easy to create and do not require a TCP/IP stack. This means you can simply use a raw packet driver to send the required magic packet. In fact, it is so simple you should be able to use a very underpowered and inexpensive microcontroller (a Propeller would be major overkill).

    Also, Magic Packets do not require UDP. People tend to use UDP because it is much easier to gain access to UDP sockets than it is to get RAW sockets (RAW sockets generally require root or administrator access on platforms that support it). UDP is also required if you need your packets to be routed between different networks (such as the internet).

    Post Edited (Harrison.) : 2/19/2010 4:16:10 PM GMT
  • LeonLeon Posts: 7,620
    edited 2010-02-19 16:34
    There are PICs with Ethernet on chip, like the PIC18F66J60 ($4.22 each). All you will need is the magnetic interface.

    www.microchip.com/wwwproducts/Devices.aspx?dDocName=en026447

    A little PIC and ENC28J60 might cost less, but will probably cost more by the time they are put on a PCB. Software development will be harder, as well.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM

    Post Edited (Leon) : 2/19/2010 5:10:12 PM GMT
  • Chip CoxChip Cox Posts: 73
    edited 2010-02-19 22:21
    Ok, let me preface this with a note that this is not about generating a magic packet but looking at you overall problem instead.

    I may get thrown out of here for this, but, you might want to look at the Lantronix Xport Pro line of embedded ethernet devices. They cost a good bit but they have a linux os built into them and are about the size of your thumb. They also have two exposed serial pins that could be used to integrate with other sensors like a usb port or something. Couple that with a memory stick or card and you have a nice data capture device at the linux level.
  • tonyp12tonyp12 Posts: 1,951
    edited 2010-02-20 00:25
    1: Instead of fragaile laptop, can a custom made solution using nano-itx mobo (with linux) as solition be used instead?

    2: Most bios do have the option to wake-up after power-failure, maybe less common in laptop bios.

    3: How about ps2 port, and sending the key code for unsleep button?
  • pacmanpacman Posts: 327
    edited 2010-02-20 04:56
    Guys,

    You mostly seem to be missing one important line in my third? post.

    I want to do it with a prop.

    There may be other "better" methods using all sorts of off the shelf / custom developed solutions, but I don't want to use those.

    if long term, I can get this working (most people I have spoken too seem to think the 'concept' is an excellent idea {without going into the implementation}) then someone else _might_ just decide they need one and actually want to make their own / copy the design / improve the design 110%.

    If that then leads them to the Prop then I will actually feel like _I_ have helped the community grow in some small way. If they start with the concept and then move to AVR/PIC/whatever then at least I've contributed.

    I'll definitely learn stuff on the way. Someone else might learn stuff along the way..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    =================
    The future is in our hands.
    Which way to the future?
    =================

    Post Edited (pacman) : 2/22/2010 8:30:51 PM GMT
  • pacmanpacman Posts: 327
    edited 2010-02-21 22:36
    Harrison. said...
    Magic packets are very easy to create and do not require a TCP/IP stack. This means you can simply use a raw packet driver to send the required magic packet. In fact, it is so simple you should be able to use a very underpowered and inexpensive microcontroller (a Propeller would be major overkill).

    Also, Magic Packets do not require UDP. People tend to use UDP because it is much easier to gain access to UDP sockets than it is to get RAW sockets (RAW sockets generally require root or administrator access on platforms that support it). UDP is also required if you need your packets to be routed between different networks (such as the internet).


    Thanks for that info - I did not know that UDP was optional. I'm not doing any routing so raw packet driver might work.


    Which leads me onto another question - What object in the OBEX allow me raw packet generation? (I'm so not clever enough to do it myself). Is their a good example I can use as a staring point in some demo code somewhere?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    =================
    The future is in our hands.
    Which way to the future?
    =================
  • Tired2Tired2 Posts: 29
    edited 2010-02-23 16:50
    pacman,

    You might have a look at some of the example code using other uC's:

    http://rototron.info/default.aspx?Page=WOL/WOL.aspx

    At the bottom of that link is his source code. He pretty much opened up his design if you wanted to just get the device up and running (maybe for testing). I'm all for doing things with the propeller, since it leaves plenty of headroom for other features of a board...

    I have a few questions, which are pretty much getting worn out here...

    1) Why not place a propeller (or pic, picaxe, etc) in with the laptop to short the power button when the power comes back on? It could use the power LED as an input to know if the machine was off.

    2) Have you checked the bios as mentioned by jeromelab? Most computers have a power setting to return to "OFF, ON, or LAST" after power is returned to the unit. The presence of that option would make the WOL system obsolete and obscure by any customer's standards.

    3) Can you have the propeller replace the computer as a data logger? If you have a prop with web enabled access, why not make it a datalogger in itself and use a computer to parse out the data for display? Harrison's AJAX enabled web server shows random numbers, but can easily be modified to show variables that are read from real world sensors. It is fine in harsh conditions (more so than laptops), and can probably be leveraged to put out a pretty web page with graphs and whatnot using off-site hosted php graphing utils...

    Anyway, good luck with your project. I respect that your journey is your destination... many of my projects are like that.
  • lonesocklonesock Posts: 917
    edited 2010-02-23 17:10
    Maybe check out etherCog?

    http://forums.parallax.com/showthread.php?p=744035

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2010-02-23 23:54
    Pacman -

    I'll throw out a couple suggestions. One potential hardware solution, at least for making a proof of concept, is to get a Propeller Platform from Gadget Gangster and to get the PropNET module PCB from me (Gadget Gangster will be carrying the PCB soon as well as kits). The PropNET Module attaches to the Propeller Platform and hosts a WIZnet module for ethernet communication. There are options to add some other goodies to the PropNET module such as an SD card or 1-Wire temp sensor, etc. You could also use the PropNET module with a Prop Protoboard or development board, it just requires some wiring for the I/O. You can read more about PropNET here: http://forums.parallax.com/showthread.php?p=877210

    Another potential hardware solution is to use the Hydra EtherX card and one of my Hydra Expansion Card breakout modules to attach the Hydra Card to non-Hydra hardware for prototyping purposes.

    As for the driver - there is a solid TCP/UDP SPI based driver for the W5100 that was developed for the Hydra EtherX card. This driver, with modification for the pinout, can be used on the PropNET Module. There is a great chapter in the new Propeller Customizing/Programming book related to ethernet, W5100 and the Propeller. The chapter is a detailed review of the Hydra EtherX driver and includes samples for TCP and UDP. You might want to browse the chapter's code for free on-line.

    Soon I hope to have a SPI and a parallel interface driver to release. Both drivers will hopefully implement all they can in ASM, which will make it faster than the current Hydra EtherX card. Of course I may run into some memory constraints, but I will have to figure that out if I get to that point.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2010-02-24 02:03
    Somebody said...
    These laptops run some specialist data logging software - unfortunately they are in remote locations (mostly underground in flameproof enclosures). No PC (even the expensive industrial ones) has survived for more than a couple of weeks - heat/vibration. In the end the decision was made to just use cheap laptops and just replace them every couple of months.
    Being underground the laptops can't use batteries.
    Power frequently gets turned off.
    But the laptops don't autmagically turn back on, hence the reason to wake then up.

    If all you need to do is restart/wakeup the laptop after a shutdown, why don't you use to the prop to watch the data flow and power LED on the laptop. If either of those goes OTL then hold the power button 'down' for the requisite restart period. You might have to make a special connector modification for the power button to the mother board but if you use an ACER 'cheap laptop' the power LED and button contact are on the same connector.

    Too simple?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Signature space for rent!
    Send $1 to CannibalRobotics.com.
  • dMajodMajo Posts: 855
    edited 2010-02-28 01:35
    Pacman, if you want this done with the prop and oly the prop and on ethernet then IIRC Hippy has done some 10M ethernet tx/rx just with the prop: search the forum

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · Propeller Object Exchange (last Publications / Updates);·· Vaati's custom search
  • dMajodMajo Posts: 855
    edited 2010-02-28 01:42
    Pacman, loo here: http://forums.parallax.com/showthread.php?p=682147

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · Propeller Object Exchange (last Publications / Updates);·· Vaati's custom search
  • hippyhippy Posts: 1,981
    edited 2010-03-06 16:51
    Thanks dMajo. I couldn't find the link myself - is search.parallax.com still working or just not for me ?

    Where I came unstuck was in interfacing the pins from the Propeller to the RJ45. If anyone solves that using RJ45 with magnetics built-in - or preferably an RJ45 without magnetics - I'd be very grateful as using a Prop alone to generate WOL is something I'd like to have working.
  • localrogerlocalroger Posts: 3,452
    edited 2010-03-06 19:50
    hippy, you will need a dedicated NIC chip and magnetics. There is simply no other way to do it. The Prop is not fast enough to keep up with traffic on even a 10baseT ethernet subnet (the controller must keep up with everything, even stuff that isn't its business, in order to sort out the stuff that is). And the magnetics are the interface between silicon voltage levels and the twisted pair. Your best bet is an ENC28J60; you can get everything necessary for about $35, either as a kit from ucontroller.com or in much smaller pre-assembled SMD form from sparkfun. The ENC28J60 gives you about the lowest level control over ethernet comms that is possible with the Prop.
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-03-06 21:36
    I would just put a propeller and something like a PIC18F66J60 on the same small board.

    I have had good results when combining the prop with another controller....mostly I have
    done it to get the benefit of the props video generators and precision timing.

    Perhaps just use a propeller to sense when the laptop is powered down and power it back up.
    That would be very easy and the prop can stand incredible temperatures...I saw that video
    where they baked it in an oven and it kept on running smile.gif Just bring the pwr switch leads of
    the laptop out to the prop board so it can control it...a quick project.

    You said the laptops had no batteries to use during pwr failure? Why not?
    I'd use a low power mobo from a netbook and add extra heat sinking and fans where needed and
    charge a battery to keep it on.

    It would be a simple matter to keep the prop board on a LONG time using a tiny battery...just have
    it sense when the ac dies and slow it down to a crawl while occasionally checking for the ac to
    come back up...then have it reboot the pc.

    I am wondering why the laptop is not remote from the hot underground site.... what sort of sites are these anyway????
    I'm so curious.
  • pacmanpacman Posts: 327
    edited 2010-03-06 22:14
    HollyMinkowski said...

    I am wondering why the laptop is not remote from the hot underground site.... what sort of sites are these anyway????
    I'm so curious.

    Coal Mining. No batteries allowed (that are capable of generating enough energy to _create_ a spark) in any are that might be hazardous. Methane gas is flammable between 5% ->15%. Sparks in an explosive environment are _bad_.

    In addition the ambient temperature increases by about 1 deg C for every 10m depth. Its not uncommon for the ambient temperature to be 30+, especially in dead headings (headings without ventilation).

    The Laptops are in electrical panels that are frequently located in dead headings (so as they are out of the way). Theses panels often control {or have near them} BIG transformers (11KV down to 3K3V down to 1KV) or big pumps. suffice to say you only need to be in these areas VERY briefly to feel sweat on your brow.

    The panels themselves are flame-proof (sealed so no air in/out) and thus must rely on convection cooling with the surrounding atmosphere. This means they _could_ have batteries in them, but if any of the panels were opened (a time consuming process) underground then they can't have batteries. Taking a 2+ Ton panel to the surface is a day long process.

    As a test once we put a thermometer in one of the panels and it got to over 65degC.

    Other panels ALSO get the advantage of being on moving equipment and they get the added _special_ of having the sh_t shaken (whats bigger than a shake?) out of them.


    So it's a hot, no batteries, explosion possible, and vibration intense environment. Fun


    We have found that our $600 laptop solution survive just as long (or longer) than many of the commercial solutions that cost 10x the price.

    Hope that helps...


    A $50 Magic packet generator would do nicely... and I _want_ to do with a prop...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    =================
    The future is in our hands.
    Which way to the future?
    =================
  • w8anw8an Posts: 176
    edited 2010-03-06 23:09
    Has anyone mentioned the Wiznet W5100? There are a couple of cheap modules available for about $20 each (WIZ811MJ for example).
    http://forums.parallax.com/showthread.php?p=851153
  • LawsonLawson Posts: 870
    edited 2010-03-06 23:32
    hippy said...
    Thanks dMajo. I couldn't find the link myself - is search.parallax.com still working or just not for me ?

    Where I came unstuck was in interfacing the pins from the Propeller to the RJ45. If anyone solves that using RJ45 with magnetics built-in - or preferably an RJ45 without magnetics - I'd be very grateful as using a Prop alone to generate WOL is something I'd like to have working.

    you wouldn't happen to have electrical specifications for ethernet signals and the RJ45 magnetics? Best I could find was www.interfacebus.com/Design_Connector_Ethernet.html (near the bottom) Assuming the jack has a 1:1 transformer and ethernet is source impedance terminated, a resistor divider of 200ohm and 200ohm driving the TX+ pin (TX- pin grounded, divides 3.3v to 1.6v with a 100ohm impedance at the jack) should work. Assuming termination at the RX side, I'd switch the resistors to like 33 ohms. Or you could just go red-neck and hook the pin strait to TX+ and over drive the cable. May work out just fine. If the jack transformer is unhappy with 1.6vdc going through it, a large ceramic capacitor could be added between TX- and ground to block the DC component.

    And Packman, good luck with the magic packet generator. I can see very good reasons to stick with the Propeller for this even though it's overkill.

    Lawson

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-03-07 04:35
    Thanks for the detailed explanation pacman smile.gif

    I can see now how difficult a problem that project is.

    I'm not an expert on ethernet protocols and signals but would it be possible to send the packet
    you require from another pc and somehow monitor the ethernet signal lines and record the data.
    Then play the data back using the prop... not a real ethernet capability...just a dumb recording
    that it would play back several times. Maybe this would be enough??? This would be a kind of
    cheat... but who would care as long as it worked.

    Maybe you could encapsulate the prop circuit in plastic resin along with a battery.... to eliminate
    the chance of a spark from the battery? or perhaps immerse it all in a non-conductive liquid like
    mineral oil? ..in fact you could immerse the laptop mobo as well...it might help cool it down if the oil
    was circulated to an external radiator of some sort.
Sign In or Register to comment.