OUR NETWORK:TechLore Sling Community MyOpenRouter MediaSmart home Pogoplugged See all... About UsAdvertiseContact Us

 
Learn about scoring Forum's Raw Score: 3345960.0
January 6, 2010 07:42 AM

Categories: RS Media

Member Avatar

Helibot

  Member
Joined: 03/12/2009

Hi all,    I have started looking at USB Networking for RSMedia (again.)

I have been looking at how I think Wowwee intended it to be used. I think I have worked most of it out but there is a piece of the puzzle missing :-(.

In short , I dont know what USB drivers should be used (on the PC side) Frown

BUT if anyone has a version 2 RSMedia (with USBNET menu option) AND the serial hack AND a Windows PC then I can tell you how to test PPP networking over the serial port.

So please let me know if anyone can help!! (The testing will actually be pretty easy todo...)

If we can get networking over serial port working then getting networking over USB will be easier.

Hope someone can help!!

Cheers

  Helibot

Discussion:    Add a Comment | Comments 1-25 of 113 | Latest Comment | 1 2 3 4 5 Next »

January 6, 2010 7:54 AM

For anyone interested here is some more info about what I know of the networking for RSMedia (Its going to get technical prettry quickly, so skip it if you are not interested):-

1) In RSMedia version 2 robots there is a USBNET menu item in media mode. The version2 robots also have networking built into the linux kernel and some extra network related files in the root filesystem.

2) When USBNET is activated it loads a usb-serial driver into the Linux kernel (instead of the USB mass storage driver). It also loads a ppp program that tries to create a 'ppp' connection over the /dev/ttyUSB device. Once the USB cable is connected to the PC the ppp program should send 'ppp' negotiation packets out the USB port to the PC.

3) Windows (or Linux) can be setup to connect to other devices via PPP (usually it done over serial and parallel ports)


So my best guess is that the whole thing should work like this :-

1) USBNET is activated (usbserial module is loaded and PPP program sends packets to the PC)
2) USB cable is plugged into the PC
3) PC recognises the USB device and loads drivers.
4) Driver should make the USB device appear as a virtual serial or parallel or (network?) port.
5) The windows PPP server should be listening to the serial or parallel (or network?) port and should then receive the PPP packets from RSMedia.
6) Windows PPP server should exchange packets with RSMedia ppp program and negotiate the link parameters (IP address,subnet mask,gateway etc)
7) Once negotiated then Rsmedia ppp program and windows ppp server will setup the networking interfaces in the linux kernel and Windows OS respectively.
8) Connection is complete - RSMedia should be able to ping and connect to network services on the PC.

I think that steps 1& 2 are working.
I know how to setup Windows to listen for a PPP connection (used in step 5)
Steps 6 & 7 should work OK - although there is a good chance we will have to configure some ppp stuff in Linux or Windows to make the negotiation successful.

So the missing piece is step 4 - We don't have a USB driver for the PC that will recognise the RSMedia USBserial device and make it appear as a virtual serial port or parallel port. I have no idea what Wowwee intended here. As far as I am aware they never supplied a USB driver for the PC for the usb-serial functionality.

So where to go from here?
I have four ideas -

1) Use a Version 2 RSMedia robot with a serial hack done, then change the PPP setup on the RSMedia to use the serial port instead of the USB device. The PPP setup packets should go out the serial port and be received by Windows PPP server ( which I do know how to setup for a serial device). But my bot is not a V2 bot :-( Does anyone out there have a V2 bot with the serial hack done?

2) Create a USB driver for Windows that makes a virtual serial port. (Similar to what I did for the USBconsole work). From a quick investigtion there doesnt seem to be any opensource drivers :-(

3) Create/find a USB driver for Linux that makes a virtual serial port. There sshould already be many drivers supported (with source of course!)

4) Find an existing USB2serial converter driver and install it into Windows, hack the usbserial driver in RSMedia to report itself as a supported device. Plug in RSMedia and see if it recognises the device and successfully installs it as a com port. (I have tried this once with the FTDI driver, it detected the device and started installing driver, but never finished).

I will try one more Windows USB2serial converter driver (from a real USB2serial converter I have) , if this fails I think I will give up on windows and try with linux (full source is available and I maybe able to use a 'generic USB2serial converter' type driver. This probably has more chance of working than an existing windows driver.) If this fails we are back to writing/modifying a driver from scratch :-(.

Also at this point I am assuming that the RSMedia mx1_ads-usbserial.o device supplied by Wowwee actually works OK. I tried using this for the USBConsole work, but couldnt make it work.....so this is a risk. If it doesnt work then we maybe able to use the version created for USBConsole (although it doesnt support large packet sizes properly).

Also one last point - Linux supports a thing called "USBNET" which is networking over USB, I am not sure that it is supported in the RSMedia Linux Kernel. Also it usually doesnt use ppp but RSMedia definitely comes with ppp support. So I decided to investagte down the 'ppp' path first , maybe we can look more at USBNET if ppp cant be made to work.

Wow this turned out to be a really long post (actually I wrote most of it to help collect my thoughts on PPP, but then decided to post it.... so sorry for my ramblings....hope its interesting to someone!!)

Cheers

Helibot

January 6, 2010 12:43 PM updated: January 6, 2010 12:58 PM

I can test it. I have an RSM with USB NET option in menu and serial port implemented (in fact it is Parallax PropClip USB-to-Serial module). So my RSM have a 2 mini-USB connectors: one - standard (mass-storage) and another - additional (console).

Also I run a Windows PC (XP Pro) an do know what TCP/IP and PPP is Wink.

But my knowledge in Linux is not deep.

Ready to help you.

January 6, 2010 9:40 PM

Hi Shai Alyt NEMO,
   Fantastic. This could be a great help.  Like you picture - Good job on the serial hack  (mine still has a wire and plug hanging out the side!!).

For the testing I suggest you have this setup:-
-RSMedia Serial port connected to PC and PC running Hyperterminal (or other Terminal package eg Teraterm)
-RSMedia USB console setup and working.
The advantage of this setup is that during the test the serial port will be unavailable for linux commands...but USB console will still have access (and will see any error messages generated)

So I will assume that you have the above setup. (If you cant get the USB console to work then let me know and we can do the testing in another way)

First a simple test to check that PPP commands on the robot work and that data gets to the PC.
From the USB console issue these commands
$cd /usr/bin/robot/ppp
$./pppd /dev/ttyMX0 115200 local nodetach noauth 10.0.0.2:10.0.0.1 &

This chould cause the ppp driver to connect via the serail port and I think it should start sending packets to the serial port. So have a look at Serail terminal on the PC and see if anything comes out (I think it should send "CLINET" or "SERVER" and a bunch of binary numbers?. Have a look at the response from the USB console. Are any errors output?
If you could post the output of the serial and USB console back to this thread that would be great.

I guess the pppd program will timeout after awhile and finish (becuase it will get no response)....thats OK for the moment.


Next part is to setup and install the PPP server on Windows:-
Here is a step by step instructions. You can also see a briefer example at this website.( It also lists some of the data and setup that can be done for Windows<->Linux PPP).

Close Hypertermial/Teratrem (so the Com port is not open)
Open Control panel
Open Network connections
Select "Create New Connection"
A wizard starts
  Select Next
  Select  "Set up an advanced Connection" and Next
  Select "Connect Directly to another computer" and Next
  Select "Host" and Next
  Select the comport that RSMedia will be connected on and select Next
  The next screen shows permissions, select the users you want to allow to connect (I guess you should choose at least Guest and Administrator and your usual login (if you have one).)
  Select Finish
Look at the Network connections folder again and you should see a new connection called 'Incoming Connections'.
Double click on it and the properties will open.
  Select the Comport in the General TAB and press the properties button.
    Set PortSpeed = 115200
    Set Flow Control = XOn/Xoff  (If things dont work you could also try "none")
 Select OK
  Select the Users TAB.
    Tick the box "Allways allow directly connected devices ... to connect without password"
  Select the Networking TAB. 
    Select the Internet Protocol (TCP/IP) and select Properties
    Ensure that "Specify TCP/IP addresses" is checked.
    Enter From 10.0.0.1 to 10.0.0.2
    Tick "Allow calling computer to specify its own IP address"
    Click OK
Thats it -The PC is all setup!
Note that the serial port is now held open by the Widnows PPP server, so you cant open it to use the serial port (via Hyperterminal or Teramterm.)   If you want to stop the PPP server and switch back to serial terminal then just open the 'incoming connections' network connection and untick the com port. You can now open it with Hyperterminal. (But remember to tick it again when you want to try PPP again!)

Go back to the USB console and issue the PPP command again.  If all goes well it should connect. In reality I expect that some more packets are exchanged and some errors will be generated.
From the USB console you may be able todo:
$cat /var/log/ppp/log

$dmesg   and look at the end of the output

$./ifconfig -a
  
If everything has worked fine you can of course try:-
$./ping <You PC IP address>


To see what is happening at the windows end the web article (from above) listed a program "Free serial monitor" http://www.serial-port-monitor.com/index.html
I installed it OK, and it seemed to work well. It will allow you to see all the data being sent and received by the serial port.

   So thats it.  I hope it works!! Post any interesting output back to this thread. And I will PM you an email address if there are any big logs you need to send!!

I really look forward to hearing how it goes!!
   Cheers
    Helibot

January 7, 2010 2:54 PM

Sorry, I will read your message completely tomorrow. Please wait!

Here, in Ukraine we have a Christmas today. And I just returned home from cinema after viewing Cameron's "Avatar" in IMAX 3D ;)

January 7, 2010 3:28 PM

Hello Shai Alyt NEMO,
OK , no problem, Hope you have a Happy Christmas. I saw Avatar in 3D as well....what an awsome movie. I was really impressed with the 3D.

By the way I think that to connect to windows PPP server we need some more setttings on the pppd command line. I think we may need
./pppd /dev/ttyMX0 115200 local nodetach noauth 10.0.0.2:10.0.0.1 connect 'chat -v -f /sd/mnt/ppp/winclient.chat' &

and need to add the file /mnt/sd/winclient.chat to the sd card. The file should contain:-
TIMEOUT 3600
CLIENT CLIENTSERVER\c

or maybe
TIMEOUT 10
CLIENTSERVER CLIENT\dCLIENT\c
"" "\c"

Tonight I will try and connect a linux VM to my windows XP box via PPP over a serial null modem. From this I hope I can work out the exact settings needed for the RSMedia end. So I'll post again with my results.

BTW it seems that connecting PPP to linux (instead of windows) should be easier (shoudlnt need all the connect 'chat....' stuff.) So if we cant get windows happening then we can try linux?.

Cheers
Helibot

January 8, 2010 3:46 AM updated: January 8, 2010 3:46 AM

Hello, Helibot!

Glad, you enjoyed the world of Pandora too! Wink BTW, the rumors are that Cameron may produce a trilogy if the first movie will prove successfull... 

But let's return to Earth...


As a happy owner of a serial port hack, I did not paid much attention to that "USB-console" add-on before.

Can you save my time by pointing me to some HOWTO install that thing along with the link for downloading it?

>>BTW it seems that connecting PPP to linux (instead of windows) should be easier (shoudlnt need all the connect 'chat....' stuff.) So if we cant get windows happening then we can try linux?.

Theoretically, we can, but I will need more detailed instructions from you. I have some Linux (DreamLinux, Debian-based "desktop" distributive) on my PC too.

January 8, 2010 5:23 AM

Hi,
   The USB console can be found at sourceforge here.

I have made a bit more progress - I have got a linux machine to connect to a windows PPP server. It does require the "connect 'chat -v -f /sd/mnt/ppp/winclient.chat' " and I am just working out the easiest contents for the /sd/mnt/ppp/winclient.chat file.  But there will be a problem on the bot....we dont have a executable for the 'chat' program.  I can probably compile one up if needed, but I want to try something easier first.

So if you like you can get the USB console setup and try the PPP commands (but I dont think it will connect successfully).  I will continue to investigate and post an update later (either some new instructions or a binary for char (and some instructions!).

Cheers

   Helibot

January 8, 2010 7:00 AM

Hi again,
All right I think I have worked out how to connect to windows....the extra bit that Windows seems to need is an inital string of CLIENT{pause}CLIENT{PAUSE} then it will respond with CLIENTSERVER and the normal PPP negoiations can then occur. But I found we can send 'CLIENT' pause 'CLIENT' over the serial port with needing to use the chat program. It can be done with this command
echo -n CLIENT > /dev/ttyS0 ;sleep 1;echo -n CLIENT > /dev/ttyS0
Then we can start pppd and it should work.
So all up I think we can put it in a script like this

echo -n CLIENT > /dev/ttMX0
sleep 1
echo -n CLIENT > /dev/ttMX0
/usr/bin/robot/pppd /dev/ttyMX0 115200 local nodetach noauth 10.0.0.2:10.0.0.1 debug &

So please put the above in a file called ppp_ser.sh (Remember to use an editor that saves in unix format).
And put the file on the SD card /Applications directory.
Boot the robot and then run it with
cd /mnt/sd/Applications
./ppp_ser.sh

And lets see what the output is. I found that using the "Free serial monitor" from http://www.serial-port-monitor.com/index.html on my windows machine worked really well to see all the messages happening over the serial port.

Cheers
Helibot

January 8, 2010 7:37 AM

I need help on USB Console.

I have installed all according to your README.
I see the root prompt (#) in TeraTerm, but that's all. Console is dead.
And each my keypress in TeraTerm produces this string in black window of usb2tcp.exe:

USBWrite error (-22)

January 8, 2010 8:43 AM updated: January 8, 2010 8:53 AM

OK. At least in Media Mode it works.
I think, it SHOULD be mentioned in the README.

But there is another trouble. The ENTER, pressed in TeraTerm produces only LF without a CR so text is displayed in staircase-like pattern.

January 8, 2010 3:46 PM

Hi Shai Alt nemo,
I should work in any mode, not just media mode. I havent seen that problem before?

About the LF only, I have previously had the same problem. You can get around it by going to Setup:Terminal:Newline and try chaneing the setting here.
I think that I fixed the problem for good by deleting my computers teraterm.ini file and using the one from the USBConole archive.

When you start getting "USBWrite error (-22)" you generally have to close down teraterm & the dos window and start it again. If it still doesnt work try rebooting the robot as well.

Hope this helps
Helibot

January 10, 2010 5:42 AM updated: January 10, 2010 5:44 AM

OK. Now I have all, needed to test set up and working.

First test.

From USB console:

# cd /usr/bin/robot/ppp
#
# ./pppd /dev/ttyMX0 115200 local nodetach noauth 10.0.0.2:10.0.0.1 &

Returns on serial console:

~}#@!}!}!} }4}"}&} } } } }%}&øNdQ}'}"}(}"g ~~}#@!}!}!} }4}"}&} } } } }%}&øNdQ

Last test.

BTW, you have a few mistypes in your ppp_ser.sh example:

echo -n CLIENT > /dev/ttMX0
sleep 1
echo -n CLIENT > /dev/ttMX0
/usr/bin/robot/pppd /dev/ttyMX0 115200 local nodetach noauth 10.0.0.2:10.0.0.1 debug &

 

I think it was intended to be 

echo -n CLIENT > /dev/ttyMX0
sleep 1
echo -n CLIENT > /dev/ttyMX0
/usr/bin/robot/ppp/pppd /dev/ttyMX0 115200 local nodetach noauth 10.0.0.2:10.0.0.1 debug &

I have set up "Incoming Connections" in Windows as you described, but nothing happens.

And "Free Serial Port Monitor" does not report anything. It reports OK (HYPERTERM.EXE), when I start Hyperterminal to see the serial console. But it say nothing when I run ppp_ser.sh on RSM.

I think Windows PPP server is somehow not hearing for COM3 (in my case). Maybe, configuration of "Incoming Connections" is incorrect?

January 10, 2010 7:58 AM

Great to see some progress!!- Not as far as I hoped but a few steps forward!!

>Returns on serial console:
>~.}#@!}!}!} }4}"}&} } } } }%}&øNdQ}'}"}(}"g ~~}#@!}!}!} }4}"}&} } } } }%}&øNdQ
This is what I expected. It shows that pppd can send correct PPP data out the RSM serial port.

You corrections are correct. It should have been /dev/ttyMX0 (not ttMX0). Sorry about that!

>I think Windows PPP server is somehow not hearing for COM3 (in my case).
>Maybe, configuration of "Incoming Connections" is incorrect?
I think you are correct. Lets confirm it with these tests:-
1) If I disable the com port in incoming connections (ie just untick the com port) then run "FreeSerialMonitor" (FSM) and reenable the com port in "incoming connections". FSM should report something like "Port opened by process "svchost.exe" (PID: 1860)". This indicates it has opened the com port.
Do you get this?  ( BTW I also get "Port opened by process "ttermpro.exe" (PID: 2712)" when teraterm openes it).

2) You can try to run ppp_ser.sh when you have FSM and Hyperterminal running.
You should see this is FSM and Hyperterminal.
CLIENTCLIENT~}#@!}!}!} }4}"}&} } } } }%}&øNdQ}'}"}(}"g ....

(BTW I have been running the DataView visualiser in FSM.)

So if Test 1 fails but Test 2 works then "incoming conenctions" is not opening the com port correctly.
If test 1 and test 2 fail then it would indicate that the ppp_ser.sh is not executing correctly.

I have seen one issue with "incoming connections"- Once I have seen it get locked up and hold the comport open forever, but not send or receive anything. So if I ticked and unticked the comport, it would seem to work but not actualy reply- I had to reboot the PC to recover. (But when it is in this state neither FSM or teraterm could open the port).

>Maybe, configuration of "Incoming Connections" is incorrect?
You can check that the comport speed is set to 115200 and that Flowcontrol is None or Xon/Xoff.

BTW on my RSMV1 robot I can run ppp_ser.sh, On FSM I see CLIENTCLIENT and and the response CLIENTSERVER. The pppd is run in rsm - but it crashes because my bot doesnt have the right /dev/ppp device and kernel parts for ppp and networking, so I dont see any of the "~}#@!}!}!} }4}"}&} } } } " type ppp packet data.  So it should all work on your bot!!

Cheers
   Helibot

January 10, 2010 10:33 AM updated: January 10, 2010 10:39 AM

Test 2.

I think, successful.

After firing ppp_ser.sh, I can see in Hyperterminal:

# 2 part copy p1=1, p2=0
CLIENTCLIENT~}#@!}!}!} }4}"}&} } } } }%}&z1YÙ}'}"}(}"ów~~}#@!}!}!} }4}"}&} } ~


And upon launch of Hyperterminal, FSM says:

 

Port opened by process "HYPERTRM.EXE" (PID: 3228)

 

Here is a dump of COM3 from FSM:

0D 0A 23 20 32 20 70 61 72 74 20 63 6F 70 79 20 ..# 2 part copy 70 31 3D 31 2C 20 70 32 3D 30 0A 0D 43 4C 49 45 p1=1, p2=0..CLIE 4E 54 43 4C 49 45 4E 54 7E FF 7D 23 C0 21 7D 21 NTCLIENT~ÿ}#À!}! 7D 21 7D 20 7D 34 7D 22 7D 26 7D 20 7D 20 7D 20 }!} }4}"}&} } } 7D 20 7D 25 7D 26 7A B1 D9 EA 7D 27 7D 22 7D 28 } }%}&z±Ùê}'}"}( 7D 22 F9 77 7E 7E FF 7D 23 C0 21 7D 21 7D 21 7D }"ùw~~ÿ}#À!}!}!} 20 7D 34 7D 22 7D 26 7D 20 7D 20 7D 20 7D 20 7D }4}"}&} } } } } 25 7D 26 7A B1 D9 EA 7D 27 7D 22 7D 28 7D 22 F9 %}&z±Ùê}'}"}(}"ù 77 7E 7E FF 7D 23 C0 21 7D 21 7D 21 7D 20 7D 34 w~~ÿ}#À!}!}!} }4 7D 22 7D 26 7D 20 7D 20 7D 20 7D 20 7D 25 7D 26 }"}&} } } } }%}& 7A B1 D9 EA 7D 27 7D 22 7D 28 7D 22 F9 77 7E 7E z±Ùê}'}"}(}"ùw~~ FF 7D 23 C0 21 7D 21 7D 21 7D 20 7D 34 7D 22 7D ÿ}#À!}!}!} }4}"} 26 7D 20 7D 20 7D 20 7D 20 7D 25 7D 26 7A B1 D9 &} } } } }%}&z±Ù EA 7D 27 7D 22 7D 28 7D 22 F9 77 7E 7E FF 7D 23 ê}'}"}(}"ùw~~ÿ}# C0 21 7D 21 7D 21 7D 20 7D 34 7D 22 7D 26 7D 20 À!}!}!} }4}"}&} 7D 20 7D 20 7D 20 7D 25 7D 26 7A B1 D9 EA 7D 27 } } } }%}&z±Ùê}' 7D 22 7D 28 7D 22 F9 77 7E 7E FF 7D 23 C0 21 7D }"}(}"ùw~~ÿ}#À!} 21 7D 21 7D 20 7D 34 7D 22 7D 26 7D 20 7D 20 7D !}!} }4}"}&} } } 20 7D 20 7D 25 7D 26 7A B1 D9 EA 7D 27 7D 22 7D } }%}&z±Ùê}'}"} 28 7D 22 F9 77 7E 7E FF 7D 23 C0 21 7D 21 7D 21 (}"ùw~~ÿ}#À!}!}! 7D 20 7D 34 7D 22 7D 26 7D 20 7D 20 7D 20 7D 20 } }4}"}&} } } } 7D 25 7D 26 7A B1 D9 EA 7D 27 7D 22 7D 28 7D 22 }%}&z±Ùê}'}"}(}" F9 77 7E 7E FF 7D 23 C0 21 7D 21 7D 21 7D 20 7D ùw~~ÿ}#À!}!}!} } 34 7D 22 7D 26 7D 20 7D 20 7D 20 7D 20 7D 25 7D 4}"}&} } } } }%} 26 7A B1 D9 EA 7D 27 7D 22 7D 28 7D 22 F9 77 7E &z±Ùê}'}"}(}"ùw~ 7E FF 7D 23 C0 21 7D 21 7D 21 7D 20 7D 34 7D 22 ~ÿ}#À!}!}!} }4}" 7D 26 7D 20 7D 20 7D 20 7D 20 7D 25 7D 26 7A B1 }&} } } } }%}&z± D9 EA 7D 27 7D 22 7D 28 7D 22 F9 77 7E 7E FF 7D Ùê}'}"}(}"ùw~~ÿ} 23 C0 21 7D 21 7D 21 7D 20 7D 34 7D 22 7D 26 7D #À!}!}!} }4}"}&} 20 7D 20 7D 20 7D 20 7D 25 7D 26 7A B1 D9 EA 7D } } } }%}&z±Ùê} 27 7D 22 7D 28 7D 22 F9 77 7E '}"}(}"ùw~




 

January 10, 2010 10:38 AM updated: January 10, 2010 10:40 AM

Test 1.
Negative.
When I remove the checkmark from "Communications cable between two computers (COM3)"
in "Incoming connections" then run FSM then re-enable COM3 link in "Incoming connections",
FSM reports NOTHING
 

January 10, 2010 10:43 AM updated: January 10, 2010 10:44 AM

>> You can check that the comport speed is set to 115200 and that Flowcontrol is None or Xon/Xoff.

Yes, I tried both variants. No difference.

"Incoming connections" for some reason don't open COM3.

January 10, 2010 3:26 PM

Test2 results are correct. The CLIENTCLIENT and then 10 x ppp negoiat packets (sent once every 6secs, then timeout because no response is seen.)

Test 1 results show that Incoming connections is indeed not opening the port :-(. It seems to work fine with my XP and com1.

One more test you can try- When "Incoming connections" (IC) has Com3 ticked , can you open com3 with Hyperterminal or Teraterm? I guess that you can. (you shouldnt be able to open it if IC has it opened.)

Out of interest why are you using com3? Why not com1 or 2? Is Com3 a std comport? Can you try com 1 or com 2?

If you have another com port and a serial cable (null modem) you could try running FSM on com1, IC on com1 , use the serial cable to connect from com1 to com3, open com 3 with Hyperterminal and paste (no type) in "CLIENT" ,pause 1 sec, then paste "CLIENT" again. If it works you should see CLINECLIENT on FSM and IC should reply with CLIENTSERVER.
If this works then it would seem that IC doesnt like com3?

Dont you hate this - we finially get RSM PPP stuff worked out and now its good ole Microst that stops us now!!

Cheers
Helibot

January 11, 2010 3:32 AM updated: January 11, 2010 3:39 AM

Helibot said:  It seems to work fine with my XP and com1. One more test you can try- When "Incoming connections" (IC) has Com3 ticked , can you open com3 with Hyperterminal or Teraterm? I guess that you can. (you shouldnt be able to open it if IC has it opened.)  

Strange! And yes, I can open it freely. So, it is not locked by "Incoming Connections". BTW, do you use a USB-to-Serial adapter like me, or somehow connect RSM's serial port directly to your PC's COM1?

Helibot said: Out of interest why are you using com3? Why not com1 or 2? Is Com3 a std comport? Can you try com 1 or com 2?  

Because I use this "old-style" motherboard with both standard COM1 and COM2 hardware ports implemented (quite a rare case for modern "legacy-free" PC's). And I do think, it's a correct way. The place for any additional or virtual ports like Parallax PropClip USB-to-Serial adapter etc. is on COM3-COMXX. In my case, COM3 is assigned to PropClip automatically by it's driver setup routine. Theoretically, I can try COM1 or COM2 by disabling the hardware ports in CMOS Setup, then reinstalling the Parallax driver, but for now, I'm a bit lazy to do so just to do it back. I don't think it will make any difference. Maybe, if any else will fail... 

Helibot said: If you have another com port and a serial cable (null modem) you could try running FSM on com1, IC on com1 , use the serial cable to connect from com1 to com3 

Impossible, because COM3 (serial side of Parallax PropClip) is hardwired to RSM's Media Board. And it have a 3v logical levels. So even theoretically it will need a level converter to connect to 12v COM-port of PC like COM1.

Helibot said:  Dont you hate this - we finially get RSM PPP stuff worked out and now its good ole Microst that stops us now!! Cheers Helibot

Indeed, inscrutable are the ways of Microsoft ;) But to state so, we have to exclude the possibility of our failure.

I will play with it more this evening after work if time permits. 

P.S. You mentoned before the possibility of testing PPP connection under Linux on PC side. Theoretically, possible, but we will need to make Parallax PropClip work under Linux first...

January 11, 2010 3:57 AM

Shai Alyt NEMO said:  In my case, COM3 is assigned to PropClip automatically by it's driver setup routine.

I just got an idea! This virtual COM3 is not present in system permanently. It appears after USB cable from PropClip insertion and disappears when cable unplugged. Can it be a source of troubles with PPP?

January 11, 2010 6:47 AM

Shai Alyt NEMO said:

Strange! And yes, I can open it freely. So, it is not locked by "Incoming Connections". BTW, do you use a USB-to-Serial adapter like me, or somehow connect RSM's serial port directly to your PC's COM1?

I have a 3v to RS323 level converter so I can connect RSM to any comport. 

Shai Alyt NEMO said:

Theoretically, I can try COM1 or COM2 by disabling the hardware ports in CMOS Setup, then reinstalling the Parallax driver, but for now, I'm a bit lazy to do so just to do it back. I don't think it will make any difference. Maybe, if any else will fail... 

I dont think that disabling com1 and 2 (so you com3 becomes com1) will help.
(But it is possible that using a real com1 or com2 may help, but it seems that this isnt an option for you).

You could do one other test - start FSM on com 1, start IC on com 1 and see if FSM detects that IC grabs the port.
If it does then the problem is related to com3.
If it does not then then the problem would seem to be that IC cant start on any port.

One hint I saw on the net for Windows IC was to

Goto ControlPanel:Administratitive Tools:Computer Management:ServicesAndApplications:Services and
make sure that the "Remote Access and Connection Manager Service" is not disabled (and try stop/start/restarting it).   I have no idea if this will help....but you never know!

Shai Alyt NEMO said:

P.S. You mentoned before the possibility of testing PPP connection under Linux on PC side. Theoretically, possible, but we will need to make Parallax PropClip work under Linux first... 

I think that the Prop Clip is a FTDI USB-to-serial converter. And this is supported by linux. So it may just work, or maybe it has different VID/PID numbers. But I think there is a way to make it work......so this maynot be impossible.

Shai Alyt NEMO said:

I just got an idea! This virtual COM3 is not present in system permanently. It appears after USB cable from PropClip insertion and disappears when cable unplugged. Can it be a source of troubles with PPP?

I would have thought a virtual comport should work the same as a real com port. But having said that I just tried a USB-to-serial device (comport 8) on my laptop and IC doesnt evenshow it as a valid port to use.!  I will try it on another computer see if I can verify if this should work.

Cheers
   Helibot

January 13, 2010 8:25 AM

Hi Shai Alyt Nemo,
I had trouble getting teh USB-toSerial to work on other computer (its VERY old and buggy).
But I have found 2 'TCP-to-Virtual serial port' drivers.
1) http://www.eterlogic.com/Products.VSPE.html
2) http://www.hw-group.com/products/hw_vsp/index_en.html
I tried loading 2) but again IC wont list it in the available ports (but Teraterm finds it OK). I am not sure if this is just a problem on my computer or a 'feature' (read 'bug') of IC?

Anyway I will keep trying and let you know the results.
Any progress from your side?
Cheers
Helibot

January 13, 2010 8:54 AM

Quick update - I CAN successfully connect my usb2tcp program to the virtual serial port (created after I installed and ran the 'hw_vsp' driver - it made com3 for me) and I can then use teraterm to open com3 and send receive commands to RSMEdia (just like with USBConsole.)
And I found that if I deleted the IC and re-added it then I do see Com3. So we could test PPP this way. But its very late now (and I have to work tomorrow :-( ). So I'll stop here for now. Tomorrow I can create some instructions on how to install/run all the bits and then others with USBConsole and RSMv2 could also try a PPP test!
I dont think it will work straight off, so having the serial port for console access would still be very useful.
Regards
Helibot

January 13, 2010 12:20 PM

Sorry for not paying much attention.

I'm quite short on free time now.
I think, I will be able to continue at weekend.

January 13, 2010 3:14 PM

Hi Shai Alyt NEMO,
  No problem.  I have that 'no freetime' probelm too, its annoying when real life interfers with robottime!! Wink.
Cheers Helibot

January 14, 2010 8:39 AM updated: January 15, 2010 5:08 PM

Hello all,
   OK, Freddy has also done some testing with USB console for me has confirmed that PPP packets are successfully sent across the USB and received on the PC. AND I have found a way to use a virtual serial port driver to get the ppp packets from the PC USB driver to the Windows PPP server.
  So since Nemo can't get the serial PPP to work, lets try and get the whole PPP over USB to go!!.  The setup is a little bit harder, but I am fairly confident that this should work (at least to get into/past the PPP negoiation stage).

So here is another really long post with full instructions on how to set it all up.

Note :  Anyone with RSMEDIA V2 and USBConsole and WindowsXP should be able to try this out.  (I know that FreddyA will probably try it and I hope that Shai Alyt NEMO will try cos if anything goes wrong the serial console is going to be really useful to figure out why!!) ANyone else is also welcome to try and let me know the reuslts!!

OK here we go :-

Instructions to test with RSM V2 + Wowwee mx1ads PPP driver + usb2tcp + hw_vsp2+ Windows "Incoming connections"
What do the parts do:-

  • Wowwee mx1ads_usbserial driver - Allows RSM to send data written to /dev/ttyUSB to teh PC via the USB cable
  • pppd  - Runs on the robot - starts a PPP session negoiation by sending packets to /dev/ttyUSB
  • usb2tcp - Runs on the PC - receives data from the USB and sends it to a TCP port (part of USBConsole program)
  • hw_vsp2 - Runs on the PC and creates a virtual serial port , receives data from the usb2tcp and sends it to the virtual serial port.
  • Windows "Incoming connections" - This is windows PPP server - it will listen on the virtual serial port and recive data.

OK , I know, this is quite complex to setup.
Its also not the best solution - (Eventually we should be able to do without the hw_vsp driver  (myself or someone needs to rewrites usb2tcp to make a usb2serial driver instead) But this setup should work and let us prove that USB Networking is possible.

So here we go. The sequence of setting things up is quite important so follow the steps. So I suggest to follow the steps in order1.

Setup step:-
  I will assume that you have USBconsole setup already on the PC and the bot.
1) download and install hw_vsp3 from http://new.hwg.cz/download/sw/version/hw-vsp3-single_3-1-0.exe . Install the standalone or custom version if you get asked.

2) run it .
    Goto the "Virtual Serial Port" tab
     -Set the port  to 222 set the IP address to  'localhost' (Or you could enter your computers IP address )
     -Untick the box "external NVT commands"
     -Click the "Create Com" button (It will create the port - dont worry if the LAN Status reports 'Error')
     -(Remember the number of the comport shown in the 'Port Name' box. For me it was COM3)
   Goto the Settings Tab
     -Tick the box "Create VSP Port When HW VSP S..."
     -Tick the box "Connect to Device even if Virtual COM"
     -Untick the box "NVT Enable"
     -***Press the "Save Settigs to Ini File"****
2.1) (Optional step) - Use the ControlPanel:System:DeviceManager to check that the new virtual comport exists.
2.2) Close HW_VSP program - the virtual com port will disappear.

3) Open a dos window and goto the directory where the USBConsole files are installed
    (Usually this will be C:\Documents and Settings\\My Documents\My RS Media\USBNet)
    -Power up RSM robot and start the USBconsole on the robot  (but NOT the PC end).
    -Plug in the USB cable to the PC
    -On the command line run usb2tcp.exe
      You shoudl see something like:-
 Using Tcp port 222
 Using USB Vid 425
 Using USB Pid a0
 use 'usb2tcp.exe -- help' for help
 Starting - Press Ctrl+C to stop program
 bridge.c: StartTcpSocket() succeeded
 usb_sub_async: returned 0
 ...

    -Run HW_VSP again.
      This time it should create the serial port automatically.
      The LAN:Status should show connected
      AND in the USB2TCP window it should show :-
 bridge.c: Accepted connection from 127.0.0.1

  3.1) [Optional test]
          -Open hypertermial or terra term and select connect to the Virtual Serial Port (The name of it should be the one you rememberd in step 2 above. For me it was COM3)
          -Once opened you should be able to type commands to the RSMedia USB console, and see the responses.!!
          -Close hyperterimal/Terra term

  3.2) Next we need to setup the Windows PPP server
           I have already posted instructions for this in a previous above (but they have changed very slightly so I have reincluded them below). If you have done the previous setup then I suggest that you delete the IC connection and reinstall it (otherwise IC may not show you the new virtual com port).

Here are step by step instructions. You can also see a briefer example at this website.( It also lists some of the data and setup that can be done for Windows<->Linux PPP).

Open Control panel
Open Network connections
Select "Create New Connection"
A wizard starts
  Select Next
  Select  "Set up an advanced Connection" and Next
  Select "Connect Directly to another computer" and Next
  Select "Host" and Next
  Select the virtual comport that we setup in step 2 above. Select Next
  The next screen shows permissions, select the users you want to allow to connect (I guess you should choose at least Guest and Administrator and your usual login (if you have one).)
  Select Finish
Look at the Network connections folder again and you should see a new connection called 'Incoming Connections'.
Double click on it and the properties will open.
  Select the Comport in the General TAB and press the properties button.
    Set PortSpeed = 115200  (although this probably doesnt really matter for a virtual port!!)
    Set Flow Control = XOn/Xoff  (If things dont work you could also try "none" or "hardware")
 Select OK
  Select the Users TAB.
    Tick the box "Allways allow directly connected devices ... to connect without password"
  Select the Networking TAB.
    Select the Internet Protocol (TCP/IP) and select Properties
    Ensure that "Specify TCP/IP addresses" is checked.
    Enter From 10.0.0.1 to 10.0.0.2
    Tick "Allow calling computer to specify its own IP address"
    Click OK
Thats it -The PC is now all setup!
Note that the serial port is now held open by the Widnows PPP server, so you cant open it to use the serial port (via Hyperterminal or Teramterm.)   If you want to stop the PPP server and switch back to serial terminal then just open the 'incoming connections' network connection and untick the com port. You can now open it with Hyperterminal. (But remember to tick it again when you want to try PPP again!)

3.3 [Optional] To see what is happening at the windows end the web article (from above) listed a program "Free serial monitor" http://www.serial-port-monitor.com/index.html
I installed it OK, and it seemed to work very well. It will allow you to see all the data being sent and received by the virtual serial port.

4 Now we need to use a different setup on the robot.
   Currently the USBconsole setup runs my mx1ads_usbserial.o module and redirects the console to /tmp/ttyUSB. We dont want this. Instead we want to run Wowwees setup file in  /usr/bin/robot/scripts/enter1.sh  and then run a new ppp start up script.
   Create a new file and directory on the SD card root called /ppp
  create a new text file called /ppp/ppp_go.sh
   Add these commands (and remember to save it with Unix Linefeeds):-
echo -n CLIENT > /dev/ttyUSB
sleep 1
echo -n CLIENT > /dev/ttyUSB
/usr/bin/robot/ppp/pppd /dev/ttyUSB 115200 local nodetach noauth 10.0.0.2:10.0.0.1 debug &

5.0 FINIALLY we can try an actual PPP connection from RSM to Windows PPP server!!!!!!
So if you have the serial hack then use this sequence:-
5.1) Close all the programs setup above. Power up the robot
5.2) run /usr/bin/robot/scripts/enter1.sh   (This will load the Wowwee mx1ads_usbserial.o)
5.3) plug the USB cable into the PC, wait for it to detect the USB device.
5.4) On the PC command line run usb2tcp.exe
5.5) On the PC start the hw_vsp program from the menu
5.6) (optional)On the PC run Free Serial Monitor on the virtual com port
5.7) On the PC open IC and enable/tick the virtual comport  (you should see 'Port opened by process "svshosts.exe"' if you are running FSM).
5.8) On RSM run /mnt/sd/ppp/ppp_go.sh
        This should start the PPP connection negoiation off. In FSM you should see the read window has CLIENTCLIENT and some  "~}#@!}!}!} }4}" type packets. The write window should have CLIENTSERVER and also some "~}#@!}!}!} }4}" type packets. If all goes well there should be upto 20 packets going between the client and server, it should all happen within a few seconds.  If possible get a copy of the packets in FSM and post them or email them to me.

If you dont have the serial hack then you can setup RSMAppMenu to do the commands at 5.2 and 5.8.
Set the config.ini file to contain :-
[menuitem10] 
#Try to start USBConsole with Wowwee USBSerial Driver
text = "USB-Wowwee"
action = "/usr/bin/robot/scripts/enter1.sh"
enabled=Y

[menuitem11] 
#Start PPP
text = "Start PPP-Wowwee"
action = "/mnt/sd/ppp/ppp_go.sh"
enabled=Y

At 5.2 above run the "USB-Wowwee" comand
At 5.8 above run the "PPP-Wowwee" comand

Good luck - I REALLY hope this works!!

From my testing (with RSM V1) I can see that the CLIENTCLIENT and CLIENTSERVER data is passed , (but my bot wont run the pppd so this is as far as I can test. I hope you get further!!)

Notes:-
*I did find that the windows PPP server seems to lock up if it sends CLIENTSERVER and never receives any further packets, to get it working I usually have to untick the virtual comport and retick it again (but I hope you wont see this porblem cos pppd will send some real packets).
*I guess that this setup is not very robust , if anything stops working, then you will likely need to restart it all.......:-(
*Once you have done step 5.2 above , you probably shouldnt try to go back and run the USBonsole. It will probably crash the robot and you will have to reboot him.
*One last tip, to check that connectivity is still working you can Untick the comport in IC, and open the virtual comport with Teraterm/Hyperterminal. From the serial port you can run echo SOMETEXT > /dev/ttyUSB. This should cause to be received by the virtual comport.

Cheers
   Helibot

Discussion:    Add a Comment | Back to Top | Comments 1-25 of 113 | Latest Comment | 1 2 3 4 5 Next »

Add Your Reply

(will not be displayed)

Email me when comments are added to this thread

 
 

Please log in or register to participate in this community!

Log In

Remember

Not a member? Sign up!

Did you forget your password?

You can also log in using OpenID.

close this window
close this window