Receive Data From Ethernet Module
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2007
    Posts
    62

    Default Receive Data From Ethernet Module

    BACKGROUND:

    I'm using a 18F6520 PIC and a USRIOT Ethernet module (USR-TCP232-T2). This is a nice little module that seems to work very well and is inexpensive ~$12. I've been using this for a couple months successfully sending data from the PIC to the module (in TCP Client mode).

    The only pins I'm connecting are the +5v, +3v, gnd, TX and RX.

    Now I want to receive data sent from a computer to the module and to the PIC. I'm now running the module in TCP Server mode(only way I could ping the port and get the module to receive data). I am listening on HSERIN2, I have a usb connection on HSERIN/OUT1.

    CURRENT CONDITION:

    I am monitoring the Ethernet Module via it's IP address and embedded web page so I can see what's getting to it and I have the PIC outputting anything it gets on HSEROUT1 to the PBP serial monitor.

    When I send the first packet to the module, it goes all the way through to the PIC and life is good. All subsequent packets make it to the Ethernet module but never get passed to the PIC.

    I am guessing that I need to send the Ethernet module some sort of confirmation, reset, okay to receive again, thank you note, salute, acknowledgement signal? But I canít find anything on this. Iím wondering if this is a normal/standard thing with PIC to Ethernet Module communications or if someone has cracked this nut before?

    REFERENCE:
    Module: https://www.usriot.com/products/seri...et-module.html
    Manual for module: https://www.usriot.com/support/downl...er-manual.html

    Thanks for joining me down this rabbit hole!

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,215

    Default Re: Receive Data From Ethernet Module

    Without looking at the details of the module, it seems to be a buffer-clear issue to me.
    May be the first packet is filling the buffer, then all incoming packets afterwards, may be lost or ignored by the module.
    Just a guess.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Sep 2007
    Posts
    62

    Default Re: Receive Data From Ethernet Module

    Sayzer,

    Yes another user recommended I add "DEFINE HSER2_CLROERR 1" which seems to fix the one and done issue.

    My issue now appears that the TCP packet is a larger box with my data packet inside. So my command is
    hserin2 [dec2 VAR1, skip 1, dec2 VAR2, skip 1, bin8 VAR3, skip 1, bin8 VAR4]
    The first data packet is correct. However, I then get 4 more incorrect, then correct with each data packet sent.

    So I'm going to do some more testing and try using Wireshark to better see the full data packet. This is progress so I am hopeful.
    Thanks.

  4. #4
    Join Date
    Sep 2007
    Posts
    62

    Default Re: Receive Data From Ethernet Module

    Final Update just to close out the thread. I hate dangling threads.

    Messed around with a lot of different things today and I ended up using Hyperterminal so I could send random data to the module. For whatever reason, I couldn't get the module suppliers VCOM software to work. Hyperterminal transfers the data packet a little different than our program, although both are TCP/IP connections. Nonetheless, it works so we are changing the other program to use a Hyperterminal style TCP/IP data pass.

Similar Threads

  1. Serial over Ethernet module selection
    By xapmanis in forum Ethernet
    Replies: 13
    Last Post: - 15th January 2014, 12:27
  2. Re: Easy Serial to Ethernet module
    By amaanraisel in forum Adverts
    Replies: 0
    Last Post: - 17th December 2012, 07:06
  3. Easy Serial to Ethernet module
    By isaac in forum Ethernet
    Replies: 6
    Last Post: - 9th March 2012, 19:56
  4. yet another new ethernet module
    By dhouston in forum Ethernet
    Replies: 2
    Last Post: - 1st October 2011, 12:59
  5. A programmable Ethernet-to-serial module
    By dhouston in forum Documentation
    Replies: 5
    Last Post: - 26th June 2006, 10:02

Members who have read this thread : 17

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts