Shop OBEX P1 Docs P2 Docs Learn Events
Telnet Server test complete, thanks all — Parallax Forums

Telnet Server test complete, thanks all

prof_brainoprof_braino Posts: 4,313
edited 2010-11-12 22:00 in Propeller 1
EDIT: Test completed successful, thanks all
EDIT: telnet server is still up if you want to play with
EDIT: FORTH on the prop over the internet

test: telnet to

99 7 4 73 port 23

Test was to confirm it works on the internal network, and the external internet access.

Its not the spinneret, but it is a wiznet w5100 on the wiznet811mj which should be similar.

You should see a forth prompt, execute the word "words" to do a forth
dictionary dump, and execute other forth commands

ports 22 23 24 25 should also be running prompts on different cogs.

If the port is already occupied you won't be able to connect, but it times out after inactivity, so it should be available again in a couple minutes.

Thanks to those that posted, please play with this and post your result or PM me.

Thanks!
«1

Comments

  • jazzedjazzed Posts: 11,803
    edited 2010-11-06 12:40
    Trying 99.7.4.73...
    Connected to 99.7.4.73.
    Escape character is '^]'.
    braino PF v3.5c 20101104 22:38 1

    Cog1 ok
  • Cole LoganCole Logan Posts: 196
    edited 2010-11-06 13:15
    heres what I got

    braino PF v3.5c 20101004 22:38 1

    cog 1 ok

    cog 1 ok
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-11-06 13:17
    $ telnet 99.7.4.73 23
    Trying 99.7.4.73...
    
    

    No response for me.
    Would somebody please try to telnet to

    99 7 4 73 port 23

    and see if you get a response

    I have propforth running a telnet server, and it works on the internal network, but I haven't been able to confirm the external internet access.

    Its not the spinneret, but it is a wiznet w5100 on the wiznet811mj which should be similar.

    You should see a forth prompt, execute the word "words" to do a forth
    dictionary dump, and execute other forth commands

    ports 22 23 24 25 should also be running prompts on different cogs.

    If the port is already occupied you won't be able to connect, but it times out after inactivity, so it should be available again in a couple minutes.

    Please post your result or PM me.

    Thanks!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-11-06 13:28
    I got
    Trying 99.7.4.73...
    Connected to 99.7.4.73.
    Escape character is '^]'.
    braino PF v3.5c 20101104 22:38 1
    
    then, after every Enter,
    Cog1 ok
    
    and, upon hitting ctrl-],
    telnet>
    
    after which I typed q to quit the session.

    -Phil
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-06 13:35
    thanks guys!

    When you see
    cog1 OK
    
    Then you have the forth prompt, if you wish you can see the forth words with
    words
    
    7 2 + .
    9 
    cog1 ok
    

    etc.

    It works!
  • jazzedjazzed Posts: 11,803
    edited 2010-11-06 13:42
    People who like forth should be pleased with this :)

    So, how many clients are possible at one time? Maybe Bill should try again?
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-11-06 14:16
    I am in!

    That is a LOT of defined words...

    VERY COOL
    jazzed wrote: »
    People who like forth should be pleased with this :)

    So, how many clients are possible at one time? Maybe Bill should try again?
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-06 15:41
    jazzed wrote: »
    People who like forth should be pleased with this :)

    So, how many clients are possible at one time? Maybe Bill should try again?

    Up to four sessions at once:

    Port 22
    Port 23
    Port 24
    Port 25

    There seem to be several folks testing it, but the timer reboots after 2 minutes of inactivity, it it will clear old sessions and become available again.

    If you have two running, lefts say Port 22 on cog0 and Port 25 on cog4,

    you can enter from cog4

    c" words" 0 cogx

    This send the "words" command to the input area of cog0, and it begins executing.
  • jazzedjazzed Posts: 11,803
    edited 2010-11-06 16:07
    Up to four sessions at once:

    Port 22
    Port 23
    Port 24
    Port 25

    Sure. But by convention "telnet" uses port 23. See this page for "well-known" server ports: http://www.iana.org/assignments/port-numbers ... of course nothing is wrong with re-purposing ports temporarily until the multi-threaded software can be written to allow N clients on port 23 the way it should be.

    Good luck with forth - I'm not a user but I know it has a dedicated following.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-06 18:34
    jazzed wrote: »
    Sure. But by convention "telnet" uses port 23. See this page for "well-known" server ports: http://www.iana.org/assignments/port-numbers ... of course nothing is wrong with re-purposing ports temporarily until the multi-threaded software can be written to allow N clients on port 23 the way it should be.

    So, does this violate some law or regulation if it uses other than port 23? I almost got in trouble when I started my first DNS server, it started assigning address for my internet provider instead of my internal network, apparently some touchy people get really mad about such small things.

    Could you give me a hint about how to allow N clients on port 23? I thought I was lucky just to get one client one one port, I didn't know ports could be shared. Can this be among four users at four different IP addresses, or do they all have to go to the same IP address?
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-06 18:47
    jazzed wrote: »
    Good luck with forth - I'm not a user but I know it has a dedicated following.

    Hey, thanks for that; and good luck to the Bulgarians with their "Bulgarian". It also has a small but dedicated following; apparently it too is useful, on occasion. Personally, I'm not dedicated, just too lazy to learn another language.
  • MacGeek117MacGeek117 Posts: 747
    edited 2010-11-06 19:09
    Works for me....
    MG117
  • caskazcaskaz Posts: 957
    edited 2010-11-06 19:34
    Hi prof_braino.

    I don't understand as well.
    Only person that have Hive can try this test?
  • SexieWASDSexieWASD Posts: 41
    edited 2010-11-06 19:40
    sexiewasd@WASD:~$ telnet 99.7.4.73
    Trying 99.7.4.73...
    Connected to 99.7.4.73.
    Escape character is '^]'.
    braino PF v3.5c 20101104 22:38 1

    Cog1 ok

    telnet> q
    Connection closed.
    sexiewasd@WASD:~$
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-06 19:42
    I am in!

    That is a LOT of defined words...

    VERY COOL

    Thanks! Coming from you, that's extra nice.

    It's pretty much what's needed for a kernel on the prop. The assembler and disassembler, and the software logic analyzer, are added as extensions, but are added to individual cogs to keep the dictionary as small as possible.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-06 19:52
    caskaz wrote: »
    Hi prof_braino.

    I don't understand as well.
    Only person that have Hive can try this test?

    Sorry I was unclear.

    This is running on a Prop Demo Board.

    Anything that can run a telnet client should be able to connect to it.

    The Demo Board is running propforth 3.5 or 3.6 and with IPserver.f added.

    This uses the wiznet811mj for ethernet, which is similar to the spinneret part that is coming out on Monday. The Hive configuration uses a different part for ethernet, and Sal has not done that implementation yet, he's still doing the multi-prop serial interface.

    Please try to access the experiement using any telnet client you have avaialbe. I have used TeraTerm and windows Hyperterm successfully, and some of the others have use linux by the looks of it. Your linux should have no problems.

    I was able to access a device in Vancouver from Chicago and define and execute words with no apparent difference in response time from the unit in my lab.

    If you have trouble connecting, there could be somebody already connected; please try changing the port from 23 to 22, 24, or 25
  • kuronekokuroneko Posts: 3,623
    edited 2010-11-06 20:01
    Works for me. Well done.
  • jazzedjazzed Posts: 11,803
    edited 2010-11-06 23:11
    So, does this violate some law or regulation if it uses other than port 23? I almost got in trouble when I started my first DNS server, it started assigning address for my internet provider instead of my internal network, apparently some touchy people get really mad about such small things.
    I think you answered your own question.
    Could you give me a hint about how to allow N clients on port 23? I thought I was lucky just to get one client one one port, I didn't know ports could be shared. Can this be among four users at four different IP addresses, or do they all have to go to the same IP address?
    In other languages where the "sockets" interface is used, the port is just a server connection ID starting point. Once the IP address is "bound" other not "well-known" ports (usually > 16000) are used to maintain the connection between the client/server in conjunction with the user's IP address. Of course a new thread would be required for each connection.

    If I ever have a good reason to visit Bulgaria for an extended stay, I might invest significant effort to learn the language. Until then I'll be happy with all the others I already know or can easily learn that follow similar form without risking getting stuck in Bulgaria ;-)
  • Heater.Heater. Posts: 21,230
    edited 2010-11-06 23:34
    prof_braino:
    So, does this violate some law or regulation if it uses other than port 23?

    No. On our own machine you can use whatever port numbers you like for anything. I guess there is the possibiliyt your network provider does not let all ports in to you though.

    People will be a bit more touchy about DNS, if you start assigning addresses to your private machines that clash with those of the public internet or your ISP and then those private machines try to speak across the internet.

    But then again I would have thought your ISPs routing would be smart enough to drop all such addresses.

    I don't think you will get multiple connections to the same port unless your interface supports creating sockets, listening for connections and accepting those connections.

    Jazzed, It is not necessary to use threads in order to make use of multiple socket connections. You can use select() in a loop to find out from which file descriptors you program needs to read data.
  • jazzedjazzed Posts: 11,803
    edited 2010-11-06 23:52
    Heater. wrote: »
    You can use select() in a loop to find out from which file descriptors you program needs to read data.
    Of course you can use select().
    That's fine for a super simple case where resources can be hogged by users.
    Giving a user their own pid/shell is a different story.
  • Heater.Heater. Posts: 21,230
    edited 2010-11-07 00:03
    True enough.

    I just imagining one day logging into another of Humanoidos's "Towering Inferno" creations that has 1000 Prop IIs each with some hundreds of megabytes of SDRAM.

    In which case PID becomes "Propeller ID":)
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-07 06:55
    Thanks guys. Right now its just low level: one cog, one port, one one command line.

    The software multi-tasking one a single cog could handle all sessions as separate threads, but that is more application level and might not make it on the task list for a while. At least until there is a specific need for it. Is "each telnet port on a separate thread" critical to some higher function?

    Multiple threads (in software rather than hardware using separate cogs) might come up again in creating the web page server, but I don't know much about that either, it might also be a ways away.

    Unless somebody wants to help on the web server part for the spinneret project? should i move this part of the conversation to the spinneret threads?
  • hinvhinv Posts: 1,255
    edited 2010-11-07 09:31
    This IS cool!
    I think I like forth, but I don't know where to start.

    What are the other cogs doing?
    How deep is the stack?
    Is there a way to get the calculation output and input in decimal?

    Anybody have a similar thing using an ENC28J60?

    Take Care,
    Doug
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-08 16:02
    hinv wrote: »
    This IS cool!
    I think I like forth, but I don't know where to start.

    What are the other cogs doing?
    How deep is the stack?
    Is there a way to get the calculation output and input in decimal?

    Anybody have a similar thing using an ENC28J60?

    Take Care,
    Doug

    ENC28J60 is on the Hive hardware, Sal has not gotten around to it since he's busy with multi-prop serial. But the Wiz811MJ code should work OK on the spineret, since they are both w5100, although we won't know till we receive the parts.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-08 18:06
    hinv wrote: »
    This IS cool!
    I think I like forth, but I don't know where to start.

    What are the other cogs doing?
    How deep is the stack?
    Is there a way to get the calculation output and input in decimal?

    Anybody have a similar thing using an ENC28J60?

    Take Care,
    Doug

    1) other tasks (terminals on other ports, serial comm, apps)
    2) default is 32 elements, this is excessive, but there's plenty of room so why not
    3) type in
    decimal
    st?
    
    and tpye
    hex
    st? 
    
    to change it back

    posting forth references page per request
  • Brian RileyBrian Riley Posts: 626
    edited 2010-11-09 14:31
    ...

    Please try to access the experiment using any telnet client you have available. I have used TeraTerm and windows Hyperterm successfully, and some of the others have use linux by the looks of it. Your linux should have no problems.

    I opened a Terminal window in Mac OSX (Snow Leopard) and used 'telnet'
    Zeus:~ brianbr$ telnet 99.7.4.73
    Trying 99.7.4.73...
    Connected to 99-7-4-73.lightspeed.cicril.sbcglobal.net.
    Escape character is '^]'.
    braino PF v3.5c 20101104 22:38 1
    
    Cog1 ok
    
    Cog1 ok
    words
    NFA (Forth/Asm Immediate eXecute) Name
    5148 F   fl                   50D2 F   onreset7             5072 F   onreset6             5066 F   onboot               
    505A F   onboot               5022 F   fled                 4F66 F   ipinit               4F52 F   ipinitialized        
    
    ... rest of list deleted ...
    

    I closed the connection and reconnected right away and hung, unresponsive, at the 'braino' line. I escaped and closed the connection and waited 5 minutes and this time all OK again
    Zeus:~ brianbr$ telnet 99.7.4.73
    Trying 99.7.4.73...
    Connected to 99-7-4-73.lightspeed.cicril.sbcglobal.net.
    Escape character is '^]'.
    braino PF v3.5c 20101104 22:38 1
    
    Cog1 ok
    1 2 + .
    3 Cog1 ok
    
    

    Neat .... nice job

    cheers ... BBR
  • richaj45richaj45 Posts: 179
    edited 2010-11-09 17:56
    Just did it.

    That is so cool.
    Was this telnet server written in spin?

    So much with so little.

    rich
  • hinvhinv Posts: 1,255
    edited 2010-11-09 18:56
    Yeah, this is really neat.
    It is like a forth evangelism tool.

    I still havent gotten it do display in decimal though. Could you please supply a complete command line to add 8 and 9 and display it in decimal instead of hex?
    If I could get it to do floating point decimal, I could use it as my calculator instead of bc.

    Thanks,
    Doug
  • kuronekokuroneko Posts: 3,623
    edited 2010-11-09 19:01
    hinv wrote: »
    I still havent gotten it do display in decimal though. Could you please supply a complete command line to add 8 and 9 and display it in decimal instead of hex?

    decimal
    8 9 + .


    Numeric mode is then decimal until changed again.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-09 19:31
    richaj45 wrote: »
    Was this telnet server written in spin?

    The original "primitive" forth kernel (memory read, memory write, primitive dictionary structure) was written in spin. This was used to create the initial simple kernel. This was used to make a forth program that converts the forth code back into spin. The spin was used to define more forth which was used to define more spin, until the present kernel was reached.

    Now PropForth.spin defines the full forth kernel. This is done so that the proptool can be used to resolve forward references. [Normally the forth kernel simply re-creates itself with no outside PC, OS, or programming language; but since its here and it works and its pretty good, we may as well take advantage of it]

    This telnet server as well as all the rest of the propforth stuff was written in high level forth, and optimized into assembler using the forth assembler.

    If you want to use and of the forth stuff with spin or catalina or propbasic (I think) you can call it as assembler routines, but the interface stuff is not standardized until version 4 in December.
Sign In or Register to comment.