USBNet Feature Demystified! Developmental Driver Available!

51 posts / 0 new
Last post
TikaC
TikaC's picture

Know what, Freddy? You have an idea there! :) Maybe after the release (hopefully in a few more days), you can use the Dev kit to work on that? :)

Helibot
Helibot's picture

crmfghtr said: Yes just how far will we be able to go with this?

I think that the most important point here is that RSMedia is built on linux- which means that he can be a very powerful little guy. The amount of programs and services available for linux OS is amazing.  But so far efficeint access to his linux heart has only been via the console via a serial hack.  The USB console should allow anyone to access RSMedia linux.

 So here are some things that could be made easier with the USB console (they wont all work straight away- some need some more work):-
1) PPP networking - this is where a TCP/IP connection is made over a serail link to a remote device. Effectively it can mean that RSMedia can get an IP address and access a local network or the internet (just like any linux machine). So he could have a web server installed on him and serve webpages to anywhere!.  Or as FredyA wants the RSMedia could connect to a NTP time server on the internet and set the time/date correctly every time he powers up.

2) Writing custom programs - Programs can be written in C/C++ , scripts (possibily java) etc. The USB console means you can run programs, at anytime and see the results and error messages immediately.

3) If other people have written custom programs for RSMedia you should be able to configure and run them more easily on your own RSMedia.  (For example (sometime soonish??)  I hope to release a program to turn RSMedia into an Alarm clock.  Using the USBconsole , you could set the current time and date , edit a file with a list of alarms and music files to play then run the alarm clock program).

3) It should be possible to edit and save files on RSMedia  (the RSMedia linux comes with vi- But note that vi doesnt work over USB console (yet!!))

4) Porting other linux based programs to RSMedia is easier to install and test them. Things like voice recognition, voice generation, image processing, AI programs etc are all possible.

Cheers
   Helibot

TikaC
TikaC's picture

Do you remember who it was at CMU you wrote to? I wrote to a professor there too and I think it was the one currently doing the robotics course they use the RS Media for. It was before the major breakthrough though but I let him know of the Dev Kit and our progress with USBNet (at the time all we had was a driver). I never did hear back though.

I might try again. I wrote under my old email address. :-/

FreddyA
FreddyA's picture

ohh boy, video skype for RSMedia; something more for robodance 5.1

xanxion
xanxion's picture

Any news regarding this project?

xanxion
xanxion's picture

By the way, isnt theere some way to acess withought the USNnet feature?
I am missing that feature on my RS Media :/

TikaC
TikaC's picture

The latest news can be found elsewhere in this forum. Look for threads regarding the RS Media Development Kit. Whenever there's more news it'll be posted in this forum and on the RS Media Lab web site.

Even if you do not have the USBnet feature in your RS Media, you can still use the serial console program in the RS Media Development Kit (link below) to access the linux system. It is not dependant on whether or not you have USBnet on your RSMedia.

You can get the dev kit here:
http://bytebin.net/robotics/rsmedia/files/index.html

xanxion
xanxion's picture

Thanks for the answer TikaC.
I just thought the usbnet, had to be in there in order to use the usb access.

Thanks :-)

Lightman
Lightman's picture

Helibot said:
I thought it would be easier to make a linux only version (since libusb-win32 is also available for linux).

Are you working on that? If yes can i contribute?

 Virtually, being libusb linux native, usb2tcp could be compiled on linux? I think a port is needed due you use <windows.h>.

Great job guys! 

Helibot
Helibot's picture

Hi Lightman,
I am planning to get back to some USB Console work soon (after I get another SDCard!). But porting to linux wasnt going to be my first job...so I would be more than happy for you to contribute. I havent tried to port/compile for linux, I expect that usb2tcp.c and usb.c will port fairly easily, but tcp.c and bridge.c will be harder (may need to do the sockets stuff in a more generic way?)
Also I seem to remember that the libusb for linux has progressed further than windows version and had changed the API? (So we need to change to the new API or find an older version of libusb fro linux?) I'm not really sure on this...I'm going on memory!!

Cheers
Helibot

Lightman
Lightman's picture

I found something. Using python and pyusb module i succeful connected with the two endpoints of rsmedia (in and out). BUT, when i send something (a string with a command) i only receive back series of numbers. How should i interpret these numbers? what kind of connection rs media expects(bulk isosyncrhounous etc...)?

ps: libusb has arrived to 1.0 in 2008, the win one is stopped to 0.1 from 2004. BUT, libusb 1.0 has a wrapper with use the same api of 0.1. see here

EDIT: watching at mx1ads_usbserial source i found the transfermode for various ep. But i still don't know how to interpret the "numbers"...

Helibot
Helibot's picture

I'm not sure what the numbers would be...depends on where the pyusb is outputing the data from. I would expect that it should just say x bytes and they would be the same number of bytes that were sent from RSMedia.
What is an example of the numbers? Are they always the same? Or do they vary depening on how many times you run the command? Do they vary depending on the data you send?
I had a mx1ads_usbserial.o that does a loop back of any characters received. PM me an email address and I will try to send you a copy (assuming I can find it!!)
Cheers
Helibot

Lightman
Lightman's picture

Numbers are from 0 to 200 (more or less). I obtain that whit the function that should read from rs' ednpoint. When i send anything (string) i receive a vector full of these numbers every time different. I'll send you a demo program.

Helibot
Helibot's picture

Hi Lightman, I got your PM.
I have found a C progarm that can run on the RSmedia that will open the /tmp/ttyUSB device and loop anything received back to the device.
To run it change the line in rsupdate or Body con (depeneding on how you start the USB console ) from
/tmp/redirect /tmp/ttyUSB 2 to
./usbserapp &
(and copy the usbserapp binary I emailed you to the bodycon or rsupdate directory.)

So when you boot it will load the mx1ads_usbserial module then run the program. The program will send the string "RSMEDIA Says Hello via USB" to the USB Console then any characters received from the port will be echoed back to the port. There is no way to stop the program once it is running.
Hope this helps.
Cheers
Helibot

Lightman
Lightman's picture

I did it! Now linux and rs media can communicate. This could never be without Helibot's work, thanks Helibot. Now i will not release a specific program because i don't think it is usefull for anyone, i will put this feature into a bigger automation program that i'm working on. Maybe i'll release program to sync the time with the pc. If someone is interested please let me know.

FreddyA
FreddyA's picture

Hello Lightman, FYI I'm sure Jamie and Vader can give you some input on this as they have made a time sync available. Also, can we try out your automation program in beta?

Helibot
Helibot's picture

Very cool Lightman. What does you program do at the moment? Receive bytes & send bytes to RSM over the usb? I hope so!!
I would be very keen to see if we can find an easy way to 'connect' its input/output to a serial port under linux like /dev/ttyS0 (then we could use minicom or other programs to connect). I think that doing this sort of thing is easier in linux than windows. I would like to avoid using the tcp if possible - it over complictaed things in windows! Any ideas?
Cheers
Helibot

Lightman
Lightman's picture

my program is already connected to the shell of rs media. I send shell commands and receive their ouput. I should work on i/o formatting and make a user friendly graphic interface, there is no need of other programs that use a serial port. At this moment i'm very busy preparing a talk for "linux day".

edit: of course the way of a serial port and a program like minicom is possible. instead that recreate a client my program could connect usb to a virtual serial port (aka bridge). But while i can do the first, the second way needs many thinking and learning, i never do something like that but it should not be impossible...

Helibot
Helibot's picture

Hey Lightman,
The reason I like the idea of using minicom is that it will take care of all sorts of things like , i/o formatting, backspace, cursor movement, colours, resizing. There is actually quite a bit todo all that. Also I would love to be able todo zmodem transfer (to send files down to the robot)- minicom can do that as well.
But the other way is also useable - a basic program that allows typing and shows results would still be really useful to many people.

>Instead that recreate a client my program could connect usb to a virtual serial port (aka bridge)
I hope that making a program that pretends to be a serial port in linux is not too hard - I will think about it, maybe I find some example code.
Cheers
Helibot

Helibot
Helibot's picture

Hey lightman,
Any progress on you linux usb consle access?
Be interested to know how its going, in this thread we are discussing about how to transfer a file by usb console. Doe syou program allow you to transfer lots of bytes to the robot easily?
Using USB2TCP under windows we can transfer lots of data from the Robot to the PC, but only 16 or 32 bytes at a time from PC to RSMedia)
(I am guessing your work will have the same isse, because I think the problem is in the RSM USB serial driver :-( ....but thought I would ask anyway.)
Cheers
Helibot

Pages