Announcement

Collapse
No announcement yet.

Receiving data from Matchport's RS-232 via network

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Receiving data from Matchport's RS-232 via network

    Hi. Out team is making a system of remote robot control using Matchport b\g to wirelessly communicate with it. It is assumed that robot management will be realized by laptop via WiFi connection, where matchport will be an Access Point. PIC mcu, connected to Matchport's channel 2 (RS-232) will transmit some data collected by robot sensors.


    The question is: how to redirect the data, coming from PIC to Ethernet or WiFi to obtain it on Laptop? Or this occurs automatically with some settings in
    'Serial Settings' and 'Connection' sections?




    Below is appropriate schema of this connection:





    After serfing this forum we have accepted as solution to make Java applet to communicate with matchport. We configured Serial Settings such as Baud Rate,Parity and other the same as PIC's UART ones. At the 'Connection' section was defined 'Active connect' as 'with any character' and 'Local port' as '4444'.
    Matchport and Laptop have static local ip addresses (192.168.1.1-254) and are in the same subnet (ping passes succesfully).

    So, after connecting PIC to Rx and GND pins to matchport's we need to redirect data send by PIC to laptop via network. Laptop's applet is written and runned in Eclipse and implements TCP connection with matchport's socket (IP+local port, defined above) and reading data stream from it.

    The problem is that data, accepted on Laptop side don't correspond to transmitted one and look like :
    __________________________________________________ _
    f4a347fa or
    ? or
    a????? or
    <random set of characters in HEX range (0-9, a-f)>
    __________________________________________________ _

    and may different every time we run applet.



    1) I must admit that we accept it only when connection succesfully established without any errors (connection refused, socket error, etc).
    2) Changint port (the one we try to connect to on matchport side) in applet code to another, that differents from matchport's configured, result to connection errors.
    3) In a case of disconnecting PIC from matchport's serial port an incoming data stream stops.

    These facts (1-3) say about next: applet communicates with matchport in right way, but data accepted on Laptot side are not valid and readable (even corresponding to ASCII or UTF character table).

    So, after all i want to ask you, are actions, described above enough to implement our goal (receive data from matchport's serial on laptop via network) or we are missing something or some wrong settings? How to parse incoming data?




    Tips and criticism are welcome. Thanks in advance for any help.
    P.S.I will provide any additional information if it will be needed.

  • #2
    You do not need to do any programming to do what you want. You just need to setup the parameters in the Tunnel page of the Lantronix

    First you will need to set the serial settings to match the settings of your PCI serial port.

    The you will need to setup the accept mode. Make sure the Mode is set to always, which means that the Lantronix will accept incoming connections. Then note (or change) the Local Port number.

    Now on your PC you need to run a telnet session, and set the IP to the IP of your Lantronix, and match the port number with the accept port number.

    Now anything you type on the telnet will be transferred to you PIC through the Lantronix serial port.

    Comment


    • #3
      Thx for your reply, malaugh.

      I read your post and realized that i should add some explanation. You wrote how to receive data on PIC-side (as it's shown on the schema).

      This direction (PC-to-PIC) is also needed in our work, but right now transmission PIC-to-PC (backward to one, you described above) has higher priority for us, because we must handle very this connection to reach the goal below:

      anything is sent to the Lantronix from PIC microcontroller through RS-232 will be transferred to our PC via Lantronix's WiFi or Ethernet connection.

      As for your advice in the post, we:
      1) configured serial settings to match PIC's mcu serial settings;

      2) set 'Accept incoming' to 'yes',
      'Active connection' to 'With any character' (it means : Attempts to
      connect when any character is received from the serial port),
      noted local port for further use in socket connection

      Point that there is no program written by us on lantronix side, we only configured its settings. Also say that there is a program on PC-side, that opens Socket connection with lantronix (local port), and successfully get data from there. the only reason we search for help is that data is invalid, almost forget, its not applet, its a simple console application.

      Comment


      • #4
        You show RS-232 between the PIC mcu and the MatchPort. Are you using RS232 drivers and voltage levels? The MatchPort is only for TTL (3.3V/5V) level signals unless you use an external RS232 converter.

        Make sure you have Telnet Com Port Control disabled and load firmware V6.7.

        Ed

        Comment


        • #5
          edlandell
          no, we don't use RS232 drivers because our PIC mcu works from 3.3V power line,so it's UART (which we use to communicate through RS232) also generates 3.3V level signals, that are sent directly to MatchPort Serial port.

          So, we don't use an external RS232 converter.
          I will check 'Telnet Com Port Control' option and firmware version.

          Are these actions required to obtain data, sent to MatchPort's serial port on it's network side as i mentioned above? Maybe you can give me a clue how do it?

          Comment


          • #6
            So, our team still need advice about this question.

            Any suggestions? We'll appreciate it very much!

            Comment


            • #7
              Make sure you are making the configuration changes to channel 2 if that's the channel connected to the PIC.

              You may also want to enable a flush of the receive queue in the configuration for passive connections. This should be found under Channel 2 - Serial Settings in the bottom section.

              Be sure that your baud rate, data size, and parity all match the PIC settings.

              Ed

              Comment

              Working...
              X