Networking over serial with Webserver and Telnet

133 posts / 0 new
Last post
Helibot
Helibot's picture

Hi Freddy,
I think that tftp and ftp are different protocols so that maybe causing a problem (or did jfileupload have an option for tftp?).
I will see if I can get a true ftp server for RSMedia going....stay tuned.
Cheers
Helibot

Helibot
Helibot's picture

Hey Freddy,
Great great news - I found a FTP server for RSMedia and it WILL let you DRAG AND DROP files from windows to RSMedia :-)

I finally found a ftp server that would works on RSMedia (I looked at lots but most had too many dependencies to compile or run successfully for RSMedia).

The one I found is called tinyftp. I got it from http://sourceforge.net/projects/tinyftp/
I compiled it using the Arm compiler and I have emailed you the binary.

Its very simple but works great.

Start your serial/USB networking then use telent to start the server by the command
./tinytftp –c /tmp &

Then from windows command prompt you can do
C:\>ftp -A 10.0.0.2
Connected to 10.0.0.2.
220 Service ready for new user.
331 Anonymous login okay, send your complete email as your password.
230 User logged in, proceed.
Anonymous login succeeded for xxxx@xxx
ftp>

then use normal ftp commands to get and put files to/from the RSMedia.

BUT for something even cooler just open an explorer window (or goto My Computer) and type ftp://10.0.0.2 into the address bar and shazam you see the contents of the Robots /tmp directory AND you can drag and drop files to/from it!!! This is going to make development/testing so much easier, when I want to transfer a file I can just drag it onto the FTP direcory window!! This should work from Linux as well.

So I think this will certainly work with the jfileupload as well.
A few last comments
- tinytftp only supports annonymous login (no user/passwords or secure logins).
- I did see tinytfp crash twice on the robot, not sure why? Maybe with big files (eg >200kb?) or if the file to get or put doesnt exist at the source or already exists at the destination.

Cheers
Helibot

Vader
Vader's picture

Can we use this to browse and transfer files from the root filesystem over FTP? I know we would only be able to transfer files to writable locations, but it'd still be pretty handy, especially for development purposes. Hopefully I'll be able to set this up on my Mac and test it out.

Vader
Vader's picture

I managed to get it working on Mac OS X (already)!
Here's how to do it:
- Start "System Preferences".
- Choose "Sharing" under "Internet & Wireless".
- Choose "Internet Sharing" and tick any of the boxes under the "To computers using" section. (I used ethernet).
- Tick the box next to "Internet Sharing" and click Start.
- Open up a Terminal and enter in the following command: sudo pppd /dev/tty.linvor-DevB 115200 local nodetach noauth xonxoff :10.0.0.2 & (Where /dev/tty.linvor-DevB is your serial device, 115200 is your baud rate and 10.0.0.2 is the IP address given to your RS Media).
- Finally, enter this command into Terminal: sudo ifconfig ppp0 up

Hopefully you be all ready to go by this point. I tested telnet, ping and the web server, which all worked. Here's my ping output if anyone's interested:

PING 10.0.0.2 (10.0.0.2): 56 data bytes
64 bytes from 10.0.0.2: icmp_seq=0 ttl=255 time=225.773 ms
64 bytes from 10.0.0.2: icmp_seq=1 ttl=255 time=69.702 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=255 time=74.716 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=255 time=95.611 ms
^C
--- 10.0.0.2 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 69.702/116.451/225.773/63.861 ms

FreddyA
FreddyA's picture

Hi helibot, great job, worked perfectly!

As far as thebjava one, it was http but did have a ftp version. No matter anyhow, this is much better.  Super job Helibot.

Vader, so you've managed networking on osx, that is definitely a first. Well Done!

Helibot
Helibot's picture

Vader said: Can we use this to browse and transfer files from the root filesystem over FTP? I know we would only be able to transfer files to writable locations, but it'd still be pretty handy, especially for development purposes. Hopefully I'll be able to set this up on my Mac and test it out.

Well done on getting serial networking going on the Mac Laughing.  Maybe you can try connecting two RSMedias at the same time (Freddy and I cant get this to work for Windows :-( )

Regarding transfering files to the root filesystem. The answer is no for two reasons - the kernal and root filesystem are CRAMFS which is compressed readonly filesystem, They juast cant be written to in place on the robot. Secondly the tinyftp has issues seeing some of the root filesystem - I assume the problem is file permission based??  It works great to /tmp and some other directories. But I couldnt make it see or transfer files to/from the SD card directories (even if SD card is writable).

Cheers

  Helibot

Helibot
Helibot's picture

FreddyA said: Hi helibot, great job, worked perfectly!  As far as thebjava one, it was http but did have a ftp version. No matter anyhow, this is much better.  Super job Helibot. Vader, so you've managed networking on osx, that is definitely a first. Well Done!

Hi Freddy,  Great that it worked for you (and in Windows 7 as well - I only tested in Windows XP).

The java upload moduile could be good if someone wants to integrate filetransfer into their PC program (like RSMedia Control station or RSMedia Manager) but I suppose their program needs to be written in java to easily use it?  But I guess there are other modules/plugins that will allow C/C++/Java programs to upload a file to an FTP server.

Cheers

   Helibot

FreddyA
FreddyA's picture

Helibot said: But I couldnt make it see or transfer files to/from the SD card directories (even if SD card is writable).

I was able to make the sd writable and get to browse and put files to the SD with no problem

Vader
Vader's picture

I was able to get the root filesystem (and SD) browsable over FTP:

Helibot
Helibot's picture

Hi Freddy,
Cool, did you navigate to /mnt/sd directory using windows FTP explorer or did you start tinyftp with -c /mnt/sd ? Or another way.

Hi Vader,
Actually thats what I saw as well....but you will notice that the /mnt and /bin and a few other directories are missing!!

Cheers
Helibot

Vader
Vader's picture

If you use a command-line FTP client you can actually cd to those directories, however ls just returns a blank result when used on them.

FreddyA
FreddyA's picture

Hi helibot, I start ./tinyftp -c then I do ftp://10.0.0.2 in win explorer. I go to make sd writable in console and I can drop files into the sd.

Freddy

Helibot
Helibot's picture

FreddyA said: Hi helibot, I start ./tinyftp -c then I do ftp://10.0.0.2 in win explorer. I go to make sd writable in console and I can drop files into the sd. Freddy

Hey Freddy,
   Ahh I get it, tinyftp will use its current directory as the starting directory, which since you probably put in it /mnt/sd then this is visibale. Cool, I will have to try that.

  Cheers Helibot

FreddyA
FreddyA's picture

Yep Helibot, on the sd root. I added the command to the rsupdateapp just after starting the webs server and mapped a network folder on win7 makes life fun'r except still need to remember to send sd writable in console. Would be cool to automate the put method in a custom drag n drop windows console. (hint to gerber read you're working on one). Things keep getting better for rsm, lucky robots.
Freddy

gerber
gerber's picture

Hi Freddy

Hint taken. Already working on it, but at the moment I have been concentrating on the on making a terminal console using the standard com connection. That is almost done and I now need to incoperate it into the multibot software. It's quite basic but it works which is thje main thing and I can improve and expand on it later.

I have also created a terminal console which can be connected via IP address and I was able to connected to a 0S9 machine at work without a hitch so I should be able to convert this without to much difficulty. I haven't connected the robot much with the PPP recently as I have been mainly just do everything with the comport connection. I did try to connect again last night to the RSM with the PPP connection but for some reason it failed to connect. I'll have another go then I will convert the terminal program I made at work for the robot.

Cheers
Gerber

FreddyA
FreddyA's picture

Hi gerber, that is great. Good to hear the console will support IP.
Freddy

gerber
gerber's picture

Hi

Cheers Freddy for helping me on MSN to get my RSM work on PPP again I really think I need to make some notes for myself, so I don't forget for next time(Or maybe I could just remember to read the notes already in this thread on page 1 and 2 Hee Hee).

Helibot you are a God the TinyFTP program is great.

I am now going to test my IP terminal console program and will let you now how I get on.

Cheers
Gerber

FreddyA
FreddyA's picture

No problem gerber, good to see you graduate to the wireless networked status. the rsm has come a long way from the serial hack and lots more to come.

Freddy

gerber
gerber's picture

Hi freddy

I am still but just a beginner and have much to still learn from the masters.

Thankyou for all the help tonight much apprieciated. It has given me a great leap forward.

I will do my best to get the terminal console using IP done by the end of the weekend.

cheers
Gerber

gerber
gerber's picture

Hi

I managed to write the Terminal console software today to communicate to the RSM via IP and Serial comport. I have started the following thread which tell you more about it.

http://www.robocommunity.com/forum/thread/18426/RS-Media-Command-Console...

Cheers
Gerber

Curtainmaker
Curtainmaker's picture

Hi helibot
Now that I have got my serial hack done and I can use the RSM console from gerber with ease, I now focusing on trying to get the web server going through my bot. and I hate to be a pain evertime I try and get something on the forums to work, but I seem to fail completely in getting things to go cause they seem so straight forward. I have setup the new network setup as per your instructions and when i check on the Putty program i get the client client coming up but I don't get the connected network showing up in my networks. Do i need to have the internet going for this to work.
I have copied all your files onto the sd card as you have stated.
Regards Curtainmaker

gerber
gerber's picture

Hi Curtainmaker

>Do i need to have the internet going for this to work.

No you don't have to have the internet running to get this working.

When I 1st setup this connection I dn't have much joy as I was doing everything right but was doing things in the wrong order which caused me loads of frustration and caused me not to be able to esablish a connection. With a help from freddy on MSN eventually I was able to get the estable as stable connection to the robot via IP address everytime without a hitch so far.

Mine connection is done using Windows 7.

Have you upgraded your bot to Firmware V2 as you need this to get the web server working from the bot? If your bot is on version 2 there will be a menu on your robot in the Media mode in the option menu called USBNET.

Have you setup an in incoming connection on your computer for you comport? (You will need this to connect to the robot with IP address.

I find it takes between 30seconds to 1minute each time I switch on my robot before the connection is found to the robot using the incoming connection so it’s worth being really patient.

Cheers
Gerber

Curtainmaker
Curtainmaker's picture

Hi Gerber. No I havn't upgraded my Bot from V1 to V2. I did look at this when i first tried to use your program but was warned against it as if i di it wrong I could end up with a brick and it wasn't neccassary for your program.
So my bot is still a MARK 1. so I will have to scrap this idea as a web server for my bot for now.
Regards Curtainmaker

Vader
Vader's picture

There's practically no chance of bricking if you follow the instructions correctly. I've done it myself and haven't had any trouble at all. The only thing you really have to watch is the bootloader, since the rest is easily recoverable.
If you do somehow end up with a brick though, you can always bootstrap the CPU and reload the bootloader (This method requires soldering though).

gerber
gerber's picture

Hi Curtainmaker

 Yeah you can brick your robot if it is not upgrading correctly, but you can always restore a bricked robot as helibot and freddy have done.

 When I upgraded mine it took me a month before plucked up the courage to do the upgrade as I also feared the worse and that I may end up  bricking my RSM. When I eventually deside to take the plunge and do the upgrade I was really nervous. I started the procedure and had some spare underwear at the ready incase of an accidentLaughing. I don’t know why I worried so much as it was pretty easy to do and nothing went wrong. I am planning on doing the other bots I have as I think the benefits out way the risks. Below are a list of the benifits I have found but I am sure there are more:

1)You can run multiply terminal sessions for the bot

2)You can run webpages from you robot which can control your robot (I know this would be ideal for you as you are a web deign and would be able to make an awesome web interface for the robot)

3)File transfer with helibot TINYFTP program is a lot quicker and easy than with the standard serial communication. 

4)Running downloaded Java programs on the bot work now in V2(I found when I was on v1 firmware I wasn't able to running any java programs other than the preinstall games on the bot)

If you do decide to do the upgrade remember to read the upgrade instruction first before starting.

Cheers
Gerber

gerber
gerber's picture

Vader and me must have posting at the same time and I totally agree with him, as alone you follow helibots instructions there is very little chance of anything going wrong.

Cheers
Gerber

Helibot
Helibot's picture

Hi Curtainmaker,
For the USBConsole or Serial Hack you do not need V2 Robot. But to use networking (telnet, webserver, ftp, ping etc) you must have V2 Robot firmware (because only the V2 firmware has networking compiled into the Linux kernel.)

And I agree with everyone else - the advantage of networking outweighs the risk for the upgrade. (Especially since Freddy and I have both recovered from brick state so we have proved its not that hard ;-)
Once you have done the upgrade you realise that its actually not that hard!!
Cheers
Helibot

Curtainmaker
Curtainmaker's picture

Hi guys, So i have taken the first step in doing the serial hack, so i suppose it is now time i have to do the upgrade. I do want he most out of my bot. so i use the program upgradeV1torsmV2_rev1.01 to do this

Curtainmaker

gerber
gerber's picture

Go for it Curtainmaker it totally worth it.

Curtainmaker
Curtainmaker's picture

Ok gerber. you will here from me next and I will have either a V2 bot or a large paperweight.

Pages