Shop OBEX P1 Docs P2 Docs Learn Events
WIZNET W5200 for QuickStart SerialToEthernet.spin — Parallax Forums

WIZNET W5200 for QuickStart SerialToEthernet.spin

rubergdrubergd Posts: 11
edited 2014-06-22 05:08 in Accessories
Hi, I downloaded "UdpSerialToEthernet.spin" from Google Code propeller-w5200-driver (R198) and can't get it to compile. It's slightly different from the version that is included in the product page download (which does run). When the compiler hits the "pst.RxCheck" in "SerialHandler", I get an "expected a subroutine name" compile error. Prior calls to the pst object seemed to be ok. The only changes I made were to the mac and ip addresses. I'm using Prop Tool 1.3.2. Any ideas? Thanks in advance!

Comments

  • Mike GMike G Posts: 2,702
    edited 2014-06-09 14:39
    Make sure the method "RxCheck" in the Parallax Serial Terminal object is designated as PUBlic. I believe the original state is PRIvate.
  • rubergdrubergd Posts: 11
    edited 2014-06-10 14:31
    That fixed it. Thanks for the fast response (and your demo code), Mike! .....Don
  • harootharoot Posts: 5
    edited 2014-06-17 11:42
    hey I have the SerialToEthernet.spin loaded and when I run my software I wrote it linux that sends "C0 06 00 00 00 00 00 00" to the serial port
    in the Parallax Serial Terminal I see

    00 01 02 03 ...
    --- ---- ----
    0000 C0 06 00

    Start: 80 Len: 2

    I need to be able to send this data over the TX and RX pins labeled underneath my quickstart.
    My setup is a Quickstart with a W5200

    my test setup is a wiznet wiz110sr it works fine with my command

    sudo socat -d -d PTY,raw,echo=0 udp-connect:$1:5000 &
    then I run ./indyreader /dev/pts/x -s to send it serial commands
  • Mike GMike G Posts: 2,702
    edited 2014-06-17 12:11
    I have no idea what your asking. I have to assume something is not working...

    The firmware simply forwards (ASCII if I remember correctly) data received on the serial port (PST or FullDuplex) directly to the W5200 chip over SPI.

    Do you have any source code or a schematic? Anything?
  • harootharoot Posts: 5
    edited 2014-06-17 12:51
    sorry I am new to this. I am trying to replace a wiznet wiz110sr with this unit, since it has poe support. Currently I have the wiz110sr acting as a serial to ethernet gateway:

    A) so I send Serial data to it in linux with socat over Ethernet
    B) it returns serial data back over Ethernet which contains RAW Packets

    so far I'm able to send serial data but only the first 3 hex pairs are showing C0 06 00 but i'm sending alot more than that
  • Mike GMike G Posts: 2,702
    edited 2014-06-17 12:58
    I took a look at the source and the comments definitely refer to ASCII strings. If your goal is to send actual values C0 06 00 00 00 00 00 00 and NOT "C0 06 00 00 00 00 00 00" then you'll need to modify the source code to suite you needs.

    Edit: see the serial to Ethernet Binary archive at http://forums.parallax.com/showthread.php/146054-Serial-to-Ethernet-and-Back?p=1164375&viewfull=1#post1164375
  • harootharoot Posts: 5
    edited 2014-06-17 13:46
    Rx.Flush is the function that does so, I tried commenting it out but I'm still only getting the first 3 hex pairs, I know my software works fine because i've tested this with a different module
  • Mike GMike G Posts: 2,702
    edited 2014-06-17 15:07
    Like I said... the code expects to send string messages not values. If you want to send actual values like the number zero you must change the code as outlined in post #7

    Sounds like you need me to update the code for you...?
  • harootharoot Posts: 5
    edited 2014-06-17 15:49
    Can you please message me? Thank you. There is pay involved or a job. I do understand its working with chars hence 13 is ascii so inreality its 0D. Not to mention the Source code has 0x13 all over the place which is a big no no because they mean decimal 13 not Hex 13 which is 19
  • Mike GMike G Posts: 2,702
    edited 2014-06-17 16:48
    Can you please message me? Thank you. There is pay involved or a job. I do understand its working with chars hence 13 is ascii so inreality its 0D. Not to mention the Source code has 0x13 all over the place which is a big no no because they mean decimal 13 not Hex 13 which is 19
    You are correct there is one 0x13 typo in the code comments. Thanks for pointing that out. However, the CONstant, CR, is correct as well as the comments that follow. You are correct again, the code does have 13 all over the place, not 0x13 though. 13 decimal is 0x0D and is perfectly fine in SPIN like all other languages.

    In SPIN, however, HEX is designated by a dollar sign $0D.

    Anyway, the CR ends a string which tells SerialHandler to send the buffered string - nothing fancy.

    For sending values, I'd have to figure out a way to send the data in one UDP message. To do that - I need to know the data length otherwise the data will end up in several UDP messages. Should I assume the 6 in C0 06 00 00 00 00 00 00 is the length byte in the data packet?
  • harootharoot Posts: 5
    edited 2014-06-17 17:05
    thanks i was wondering if that $ was a pointer now I know. All I can tell you is my C code sends hex strings XX XX XX XX XX XX XX XX and then the data is output to virtual device /dev/pts/x , I know the length of the packet and what it looks like but I would like to discuss further details over email haroot(A.T.)senitron(D0T)net thank you
  • Mike GMike G Posts: 2,702
    edited 2014-06-22 05:08
    All I can tell you is my C code sends hex strings XX XX XX XX XX XX XX XX and then the data is output to virtual device /dev/pts/x , I know the length of the packet and what it looks like but I would like to discuss further details over email..
    Sadly, the email correspondence had no more information than what was already posted here. I prefer to discuss openly publish code on the forum not PMs or email as the discussion may benefit others.

    The serial to Ethernet is refactored and the new archive is attached to http://forums.parallax.com/showthread.php/146054-Serial-to-Ethernet-and-Back. The latest version, as always, can be found on the code repo. https://code.google.com/p/propeller-w5200-driver/source/browse/trunk/#trunk%2F%20propeller-w5200-driver
Sign In or Register to comment.