Shop OBEX P1 Docs P2 Docs Learn Events
Xport Direct and communicating through web, telnet and other methods — Parallax Forums

Xport Direct and communicating through web, telnet and other methods

metron9metron9 Posts: 1,100
edited 2010-05-14 05:50 in General Discussion
I finally connected an xport direct from Lantronix up that had been sitting in my drawer for 2 years.

I understand how to connect using a telnet program. Using a BS2 I just did a serial output loop with some text.

Link to pictures http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=93325

How do i connect to this through the web from outside my lan? Do I need to set up a service provider?

For interactive programming monitoring etc..., what programming language should I use to interface with it? Java? or C#? Other interactive telnet solutions?

Can one xport direct telnet to another xport direct to communicate between devices?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!

Comments

  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-09 13:43
    The N8VEM group did this last year and I'm trying to remember all the bits. The next step might be to look at http://www.dyndns.com/ Unless you are paying for a business grade ISP connection, the IP address will change quite often. Sometimes several times a day. dyndns creates a permanent connection that you can address with something like n8vem.homedns.org port 23 (this is not active at the moment) Originally I had a program that dyndns give you that ran on the PC and periodically checked to see if the ISP had changed the address. More recently, I found that my Belkin router can do this automatically, so now it works even if the PC is off.

    I'm not sure of the step after that. We had people logging in using a simple terminal program like Hyperterminal. However, it is more complex to do the connection in the other direction.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • metron9metron9 Posts: 1,100
    edited 2010-05-09 22:35
    Ok i am going to try and make this as simple as I can.

    i can connect to the xport direct internally using the attached hyperterminal ip address 192.168.1.11 and using port 10001

    I have port forwarding set in my linksys router port 10001 start end 10001 TCP IP 192.168.1.11

    I will leave the device running, can anyone attach to it using hyperterminal or a telnet program?

    Do you need the routers external IP 64.122.59.80

    So you connect to the external router address and specify port 10001 and then that links you to the xportdirect device?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
    449 x 37 - 4K
    449 x 37 - 4K
  • kf4ixmkf4ixm Posts: 529
    edited 2010-05-09 23:06
    i can connect to it, the page keeps refreshing and filling up the page with this:


    115. Hello lantronix Xport Direct World! 116. Hello lantronix Xport Direct World! 117. Hello lantronix Xport Direct World! 118. Hello lantronix Xport Direct World! 119. Hello lantronix Xport Direct World! 120. Hello lantronix Xport Direct World! 121. Hello lantronix Xport Direct World! 122. Hello lantronix Xport Direct World! 123. Hello lantronix Xport Direct World! 124. Hello lantronix Xport Direct World! 125. Hello lantronix Xport Direct World! 126. Hello lantronix Xport Direct World! 127. Hello lantronix Xport Direct World! 128. Hello lantronix Xport Direct World! 129. Hello lantronix Xport Direct World! 130. Hello lantronix Xport Direct World! 131. Hello lantronix Xport Direct World! 132. Hello lantronix Xport Direct World! 133. Hello lantronix Xport Direct World! 134. Hello lantronix Xport Direct World! 135. Hello lantronix Xport Direct World! 136. Hello lantronix Xport Direct World! 137. Hello lantronix Xport Direct World! 138. Hello lantronix Xport Direct World! 139. Hello lantronix Xport Direct World! 140. Hello lantronix Xport Direct World! 141. Hello lantronix Xport Direct World! 142. Hello lantronix Xport Direct World! 143. Hello lantronix Xport Direct World! 144. Hello lantronix Xport Direct World! 145. Hello lantronix Xport Direct World! 146. Hello lantronix Xport Direct World! 147. Hello lantronix Xport Direct World! 148. Hello lantronix Xport Direct World! 149. Hello lantronix Xport Direct World! 150. Hello lantronix Xport Direct World! 151. Hello lantronix Xport Direct World! 152. Hello lantronix Xport Direct World! 153. Hello lantronix Xport Direct World! 154. Hello lantronix Xport Direct World! 155. Hello lantronix Xport Direct World! 156. Hello lantronix Xport Direct World! 157. Hello lantronix Xport Direct World! 158. Hello lantronix Xport Direct World! 159. Hello lantronix Xport Direct World! 160. Hello lantronix Xport Direct World! 161. Hello lantronix Xport Direct World! 162. Hello lantronix Xport Direct World! 163. Hello lantronix Xport Dire2. Hello lantronix Xport Direct World! 3. Hello lantronix Xport Direct World! 4. Hello lantronix Xport Direct World! 5. Hello lantronix Xport Direct World! 6. Hello lantronix Xport Direct World! 7. Hello lantronix Xport Direct World! 8. Hello lantronix Xport Direct World! 9. Hello lantronix Xport Direct World! 10. Hello lantronix Xport Direct World!

    using the address http://64.122.59.80:10001

    you use the :xxxx after the ip address to specify what port to connect to.

    Post Edited (kf4ixm) : 5/9/2010 11:11:35 PM GMT
  • metron9metron9 Posts: 1,100
    edited 2010-05-09 23:25
    Yep i found that out, i went to my neighbors and tested it.

    Now i have signed up at DYN.COM and the port address has a name xporthome.ath.cx but putting a colon and port does not work. I can't find a place to put a specific port number to use the DYN server name service.

    Very cool though so far. I plan to write a full application server to allow full avr control via the network, I will interface this to a stamp as well since the stamp does not have interrupts the avr will buffer the data and allow the stamp to request data at it's pace.

    Not sure now if the xport allows only one attachment or more than one. What happens if one is connected and another tries to connect, Perhaps the port increments to 10002 and then 10003 as users access, not sure....


    Hyperterminal shows the line feeds and Carrage returns, not sure what to send if it's a browser page.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 5/9/2010 11:32:21 PM GMT
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-09 23:51
    I'm kicking myself here a bit as this is extremely complicated and I should have written it up as a "xport for dummies" writeup. The answers are all out there on the internet but they are hidden in amongst technical jargon and (? deliberate) obfuscation.

    In simple terms, the devices have addresses 192.168.1.10:3001 and 109.168.1.11:3001 etc

    You might have lots of those on your local network.

    Then there is your router and that probably has a dynamic IP address. I know that dyndns is a critical part of the system. This links external requests to your computer to each of those internal IP addresses. But for the life of me I can't remember how it links to each one, especially when you have multiple devices on your local network. I'm going through some old emails trying to find the day I worked this out last year. I am hoping that it was some setting that came up in the dyndns setup.

    The devices we had used different IP addresses but the port number was fixed at 3001. But I think that got attached to a different port number going out onto the internet.

    Addit: I just tested Teraterm and logged in and it works fine. Getting that Hello message back over and over. So it looks like you have a lot working already.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller

    Post Edited (Dr_Acula) : 5/10/2010 12:19:31 AM GMT
    668 x 340 - 35K
  • kf4ixmkf4ixm Posts: 529
    edited 2010-05-10 00:30
    i believe you setup dyndns to forward to your ip address, then on your router you setup port forwarding for anything that requests a webpage, default port 80, to be forwarded to your server ip address with the port 10001 or whatever port you have it set up with.
  • metron9metron9 Posts: 1,100
    edited 2010-05-10 00:39
    Ok, yes we have the port forwarding worked out. We can connect and the device is sending.

    I just installed tera term and used the DYN address xporthome.ath.cx and put the port address 10001 as did Dr Acula

    I installed an led on the OUTPUT pin of the xport and when I type on the keyboard the led flickers so the PC is sending data.

    If the stamp stops sending data however the typing I do does not seem to get to the device (led does not flicker) it seems to still be connected as i again put the serial wire back on the stamp and the data flows to the PC and when I type there is led flickering.

    Perhaps there is a necessary data byte to be sent to keep the connection alive or something.

    My goal now is to have the device echo what you type via the web. I am reprogramming the stamp to do this, I will post when ready in a few minutes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • metron9metron9 Posts: 1,100
    edited 2010-05-10 01:11
    Just set up input and output
    Connect and type on your keyboard, it will echo the ascii codes you type

    Oh, I have the stamp sending debug codes to my monitor so i can see if you type anything

    Hmmm, just made a twitter gizmo i think...
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' {$PORT COM1}
    
    i VAR Byte
    
    main:
    SERIN  1, 84 ,2000,timeout, [i]
    IF i<>0  THEN
     SEROUT 15, 84, [noparse][[/noparse]"Received ", DEC i,CR,LF]
    
     DEBUG "Received ", DEC i,CR,LFbb
    
    ENDIF
    
    
    GOTO main
    
    timeout:
    
    SEROUT 15,84, [noparse][[/noparse]"No DATA in 2 seconds timeout",CR,LF]
    GOTO main
    [/i]
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 5/10/2010 1:20:32 AM GMT
    720 x 540 - 97K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-10 02:01
    I got a "connection refused". Of course, only one person can connect at any one time and someone else is probably connected. I'll try again in a moment. This is mighty impressive what you have done so far.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • metron9metron9 Posts: 1,100
    edited 2010-05-10 02:14
    Yep I did too, someone had typed some stuff and now they are off, I connected and disconnected. i will have to read up on timing it out.
    Next step i will make a password code, and read up on resetting. I will check back in a few.

    I changed my debug output to see the letters so you could write a message when you connect i will post the , ohhh you are typing now.

    Here is the screenshot

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 5/10/2010 2:23:06 AM GMT
    355 x 322 - 13K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-10 02:20
    I sent you a message. It echos the ascii value as expected. Need to type slightly slower otherwise misses a few characters, but you can work around that in code if needed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • metron9metron9 Posts: 1,100
    edited 2010-05-10 02:25
    Ha i posted before you did!

    Yes the stamp is reading serial input, when i program up the AVR it will have full interrupt background receive and transmit. It is only at 9600 baud now and that can go faster as well.

    Now the next step is finding a way to automate or program a telnet connection so one can monitor a device output and perform tasks, like read a sensor and take action like emailing you or sending you a text message "Your house is 40 degrees the heater must be off!" or whatever.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-10 02:57
    I've just been off reading www.lantronix.com/device-networking/external-device-servers/uds-10.html

    Looking at ways of linking two devices with a serial tunnel. This is the UDS10, and for the N8VEM we were using the MSS100 and you are using a more recent device, but they are all from the same company so should work in similar ways.

    So now you need a 'terminal' program in your favourite language.

    Hmm, I used something like that over on the propeller group. Maybe it might be useful to you?

    This is vb.net code and I needed to talk to a program that only would talk via TCP/IP. It was on the same machine, but the nice thing about Telnet etc is that it doesn't really care if it is a local or remote machine. So you can send and receive bytes

    'http://dimac.net/default3.asp?M=FreeDownloads/Menu.asp&P=FreeDownloads/FreeDownloadsstart.asp
    ' Get the free download called w3sockets half way down the page
    ' put the sockets.dll file in c:\windows\system32
    ' run the SocketReg program
    'Your application needs to be aware of the socket.dll file, I accomplished this as follows:
    '1. Click on the 'Project' menu and select 'Add reference...'
    '2. Click on the 'Browse' tab
    '3. Navigate to where you have socket.dll installed on the HD
    '4. Select this file and click 'OK'
    Private WithEvents w3sock As Socket.TCP ' at beginning of frmMain

    start it with

    w3sock = New Socket.TCP

    This is a cut and paste from some code

    w3sock.TimeOut = 5000 ' long enough to do a compile for a big program?
    w3sock.DoTelnetEmulation = True
    w3sock.TelnetEmulation = "TTY"
    w3sock.Host = "Localhost:23"
    w3sock.Open()
    w3sock.WaitFor(">")
    w3sock.SendText("D:" + vbCrLf) ' change to drive D where sbasic is
    Sleep(200)
    w3sock.WaitFor(">")
    w3sock.SendText("R " + Filename1 + ".BAS" + vbCrLf) ' copy to the simh from pc directory
    Sleep(200)
    w3sock.WaitFor(">")
    w3sock.SendText("SBASIC " + Filename1 + vbCrLf) ' run sbasic
    Sleep(100) ' will take longer than this
    w3sock.WaitFor("D>") ' wait for the D> prompt to come back
    w3sock.Close() ' close the socket

    In your case you would use your dyndns address instead of Localhost, and port 10001 instead of port 23

    I found adding in little delays made things work a lot easier.

    You should be able to rewrite this to talk to your chip from anywhere in the world. Just need a simple sort of protocol.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • metron9metron9 Posts: 1,100
    edited 2010-05-10 18:09
    I think this might be a solution to the PC side, makes telnetting available for any program that can access a com port, com port redirector. I will play with it tonight.

    http://www.lantronix.com/device-network ... ector.html

    Dr. Acula
    It still seems complicated as they have various versions, sdk's etc.. download and get it ready,
    I will hook the device up tonight and see if you can get it working from your end.

    Someone could perhaps take the debug output or serial data from the stamp and redirect it to a redirected port to communicate through the web via basic stamps for example.

    I know some of you folks have made VB programs to communicate with a stamp through USB and or serial ports. Just add the redirector and you have a solution to read and write to an xport direct from your microcontroller connected to a PC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • metron9metron9 Posts: 1,100
    edited 2010-05-10 18:28
    After reading some about the lantronix redirector I found this site. Looks like a simple solution but 90 bucks is the cost. Free trial though.

    http://pcmicro.com/netserial/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • metron9metron9 Posts: 1,100
    edited 2010-05-10 18:44
    This one allows you to send data in one com port (like the stamp debug command) and redirects it to a different com port that can also be a virtual com port. So communicating from the basic stamp using debug you could send commands to an exportdirect lantronix device.

    http://advanced-com-port-redirector.software.informer.com/4.0/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • metron9metron9 Posts: 1,100
    edited 2010-05-11 04:39
    I think I am all set now, I found Real Software a cross platform Visual basic type compiler that can directly access TCPIP sockets udp and other stuff i have no idea about.

    Here is the link, so far I made a program i can open the connection, put test in a bos, hit the send key, and then press a close connection box. The stamp reads the data and outputs on debug screen.

    I think i am going to buy this program, forum has lot's of action and my questions were answered very fast.

    http://forums.realsoftware.com/viewtopic.php?f=10&t=33733&p=187529#p187529

    Very soon i will be building things like this me thinks.

    http://www.controlanything.com/Relay/Device/NWR165PROXR

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-11 09:06
    That sounds very interesting. Can your software 'dial out', ie connect somehow from a chip to the wider internet - even if it is to request a web page which it could not possibly display, but might be able to grab a few select bytes? Or are you looking at virtual connections?

    I'm working on a wireless mesh at the moment. Code is almost written, and the aim is to have data packets that can go via many different paths so it doesn't matter if certain nodes are down. It would be interesting to see if such a mesh could interface with your system.

    How much are the modules, and are there cheaper ways of doing things? I think there are some solutions with the propeller that can talk to the internet, though I'm not entirely sure how they work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • metron9metron9 Posts: 1,100
    edited 2010-05-11 13:48
    THE Real Studio (formerly Real basic) first tutorial is making your own browser. It has built in HTTP display windows you just drag and drop. So yes the RB running on the PC can receive web pages , parse the and send data to the xport if you need that.


    Lantronix.com has tons of web enabled devices Mouser is a distributor, between 40 and 60 bucks each. There are so many listed on mouser it makes my head spin why there are so many different kinds though.

    I have an old xport direct that has been replaced with xport direct+ they added the + sign.

    The xport pro has internal web page you can upload web pages, it is a tiny web server. You could access with any browser a page that would allow you to control anything you want. i will have to order one of these to try it out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 5/11/2010 1:56:48 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-05-11 20:40
    metron9,

    This is kind of a side-note to your current thread. I have to say, after looking at your picture above I am surprised the device responds at all. My XPORT has been sitting in a drawer for probably as long as yours, however my memories were that it consumes a lot of current and the 9V battery you have shouldn't be able to power it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
  • metron9metron9 Posts: 1,100
    edited 2010-05-11 20:57
    Hi Chris. The xport is being powered by my bench supply and an adjustable regulator with a heat sink. You just can't see the wires i don't think in the picture.

    Yes, 220ma makes a bit of heat on that regulator lm317T 1.5Amp

    Then I have a 3.0V zener diode clamp on the input line to keep the 5V of the stamp pin under 3.3VDC. The receive is connected directly so the stamp sees 3.3 as a high from the xport.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 5/11/2010 9:57:12 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-05-11 21:46
    Makes me want to dig mine out...but I must restrain myself as I am behind in just about everything. So many projects...So little time...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
  • metron9metron9 Posts: 1,100
    edited 2010-05-11 21:58
    I know what you mean, at least I don't have to make any money on my projects since it is a hobby, and it seems like all I really care about is learning something I don't know, then when I know how to do it I try and find something else I don't know and study that.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-05-11 22:04
    Yeah, it used to be my job as an independant contractor (designer) and I work for Parallax now, but on my website I still try to promote the whole share concept with anything that I can. I think my XPort is going to be the first prize give-away on the Savage Circuits website.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
  • kf4ixmkf4ixm Posts: 529
    edited 2010-05-11 22:14
    wow, i just remembered i have an old mss100 in a box somewhere... dang it, another project! [noparse]:)[/noparse]
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-14 05:50
    Here is a cross link to a thread on the Vintage Computer forum www.vintage-computer.com/vcforum/showthread.php?14712-Bulletin-board-and-Modem-question

    Some input there from a number of people getting these links working. We never quite got it working but it was getting close.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
Sign In or Register to comment.