Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » How to internet enable a serial device
How to internet enable a serial device [message #32601] Fri, 27 May 2011 08:43 Go to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

I have been searching for ways to connect a micro-controller board to the internet and found various ways that people do this.

What I am trying to do is connect the board via serial comm port to a PC that is connected to the internet so that the board can be controlled from any other pc on the internet.

I read something about people using telnet to make the board accessible to the internet maybe the other way around. I'm not too familiar with internet technologies, so I am here to seek help.

Can anyone suggest appropriate material that I can use to learn how to do this?

For the moment, I have created a No-ip account, but I am not sure if it is any help to my mission.

Thanks for your attention

PS : I found this website http://www.societyofrobots.com/robotforum/index.php?topic=93 8.0 that makes me think it maybe achievable with the Web package of U++. Especially the post by Dunk

[Updated on: Fri, 27 May 2011 09:57]

Report message to a moderator

Re: How to internet enable a serial device [message #32603 is a reply to message #32601] Fri, 27 May 2011 10:55 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hello,

How will you control your MC board ? I think that there is 2 ways :
- The MC Board can be a client for some protocol (telnet, ssh etc.) and receive directly the commands through a gateway, in your case the PC where it is connected, but the PC has to transmit the internet frames to the MC board.
- The MC board cannot be a client and must receive the commands from the PC. In this case, the PC must be client of the choosen protocol (telnet, ssh etc.), interpret the commands received from internet and transmit them to the MC board.

About the protocol, telnet is the most known and will probably do the job. However, it is an old and unsecured protocol, and generally we prefer ssh.

I know some good sites about internet and the protocols, but they are all in french... You will find good explanations googling for telnet and ssh, and from them have other interresting links to complete your needs. You can also look at Wikipedia : it has already good pages about telnet and ssh, with related RFCs and interresting links.

You could also write to Christian Caleca, who has a very good site : I'm sure that he could read your mail in english and advice you about english sites like his. I think that you will find a way to contact him on his site.

You can also use google translate to read his site...
Re: How to internet enable a serial device [message #32604 is a reply to message #32603] Fri, 27 May 2011 11:49 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hello Jibe

Thanks for your reply and the helpful tips. I have no issues with French and I think I will follow up on your links.

From my viewpoint, this is what I think I need to do
- Micro-controller talks to PC via Serial RS232 port using a simple serial protocol.
- Application on PC acts as a client/maybe a web-server to serve up the pages of information that can be populated with information from the micro-controller board.
- Internet browser on some remote PC can access this webpage and modify/view status of the board.(interact with webserver app above)

This is the exact type of thing I'd like to learn how to do.
http://www.kmitl.ac.th/~kswichit/Ajay4/index.html

Regards
Jerson

[Updated on: Fri, 27 May 2011 13:21]

Report message to a moderator

Re: How to internet enable a serial device [message #32606 is a reply to message #32601] Fri, 27 May 2011 14:51 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
This depends on what you want to do exactly :

- With telnet or ssh, you will have a command line, and you need just a telnet or ssh client to have the connexion to this command line, then you will act easily as if you were directly on the PC's command line, and run any application you want.
- With a web server and web app, you will have an app that can be used via http protocol (no more telnet or ssh) with a browser.

Seems that the web app is better in your case, but if you have to write it, it's probably easier to make a command-line app and run it via telnet or ssh...

For the web server, maybe you could use easyphp under Windows. But my advice should be to use Apache under Linux (ie Ubuntu or Debian) for reliability and security.

Re: How to internet enable a serial device [message #32613 is a reply to message #32606] Fri, 27 May 2011 22:12 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
You could make a Gui in Upp. I did that (with help on this forum).

You will need to get the serial comm port rxtx set at the board regardless of how you proceed from there.

Then the easiest way may be to have the socket Server at the board and your GUI app as the socket Client to poll for data and send commands.

That way the OS at both ends can be different as well as the language used.
Maybe a basic Android/Java at the board or just code on the board that can do it, some are fairly sophisticated.

As long as both ends have access to the internet a browser or server is not required, AFAIK, except the few lines of code in
C:\upp\reference\SocketClient and at the board SocketServer or similar in whatever language at the board.
http://www.kmitl.ac.th/~kswichit/Ajay4/index.html

The internet is similar in many respects to a cable hooked to your board except it can be VERY long.

[Updated on: Sat, 28 May 2011 02:34]

Report message to a moderator

Re: How to internet enable a serial device [message #32615 is a reply to message #32613] Sat, 28 May 2011 10:50 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

What is the MC board that you want to use, jerson ? To give more advices, it will be important to know :

nlneilson wrote on Fri, 27 May 2011 22:12

Then the easiest way may be to have the socket Server at the board and your GUI app as the socket Client to poll for data and send commands.

Yes for some sophisticated boards. But there is also a lot that use simple RS232 communication, not Client-Server...

Anyway, it's a way to do. But if a GUI interface is not really needed (if only to be more comfortable...), better to have a console app.
nlneilson wrote on Fri, 27 May 2011 22:12

The internet is similar in many respects to a cable hooked to your board except it can be VERY long.

Yes, it's really the way you can see that, and it's very long when you use a GUI app, because you have to transmit through your cable (that has low bitrate) all the graphics (ie 800x600=480000 pixels) to be able to see the same screen at the other end !

If you use a console app, you will have just to transmit some ASCII codes for the text messages to display. It can be fast, sometimes almost as fast as doing things directly (not through Internet), as RS232 is sometimes a lot slower than Internet connexion (ie 9600 b/s vs 1 Mb/s).

Re: How to internet enable a serial device [message #32618 is a reply to message #32615] Sat, 28 May 2011 12:44 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hello jibe

Further to my investigations, I have been able to narrow down my problem area. What I think I need is a way to make my pc into a webserver running my own application that can collect the data from my board.

The micro-controller board is a custom built one(that's typically what I do for a living). It communicates with the PC on a RS232 or USB port and that part is not the problem I have. The data will be a few bytes across a second. I only need to find a solution of how to take some information from my pc and present it on the internet(for this I think my pc needs to become a webserver). So, the suggestions I have seen till now involve EasyPHP, Apache and Perl among others. However, this is beyond my league at this point in time and I am trying to learn up fast.

I really appreciate your help on this and know I have support in trying to find a workable solution. Thank you

Regards
Jerson
Re: How to internet enable a serial device [message #32620 is a reply to message #32618] Sat, 28 May 2011 21:02 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Jerson

If you have your board tied to a computer with RS232 you have a comm port, baud rate, etc. then you have most of the work done.

For a Server/Client the "work" has been pretty much done for you.
It's basically the same for Python, Java, C++ and the Upp implementation.

In Upp it's the Socket
	Socket s;
	if(!ClientSocket(s, "127.0.0.1", 5024)) {


Socket s; // You have just created your own socket named s

if(!ClientSocket(s, "127.0.0.1", 5024)) { // this line checks to see if your socket can connect.
5024 is a port you designate and will be the same for Client and Server.

"127.0.0.1" is the address, in this case your computer.
When you want to connect over the internet this will be changed to an internet address.

This is the same for LAN cameras. The camera can be set up in India and you can see the image while in Australia or wherever and the Pan, Tilt and Zoom can be changed from wherever there is an internet connection.

Try the examples I mentioned for sockets in the reference assembly. Get that working with your board and your computer.
Then just change the address to whatever you get for your board for internet access, probably just your computer IP.
My Java Server is set up to receive multiple connections each in their own thread.

jerson wrote on Thu, 26 May 2011 23:43

What I am trying to do is connect the board via serial comm port to a PC that is connected to the internet so that the board can be controlled from any other pc on the internet.

If you intend to leave your computer on hooked to your board just click this link to get your computer address:
http://www.whatismyip.com/

You could also consider having whatever your board and what it controls at a remote site. Whatever ISP you use for that connection an IP address will be given. For that a considerably more expensive board is required but is often done since a computer at that site is not required.

It has been many years since I have done much of this over the internet except with LAN cameras which is through a router.

What are you planning to control with your board???

jibe
Typing on the command line in a dos box is OK but I prefer a GUI.
There is no difference as far as what is sent or received.
"... lot that use simple RS232 communication" that is just for connection to the board and has nothing to do with an internet connection.

[Updated on: Sat, 28 May 2011 23:45]

Report message to a moderator

Re: How to internet enable a serial device [message #32623 is a reply to message #32620] Sun, 29 May 2011 03:42 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Hello Neil

Thanks for your tips. You make it sound so easy. However, it ain't so till you've done it the first time Razz and I can vouch for that since I was a UPP newbie here some time back. I got a couple of hints from the piclist@mit.edu one of which is 'serproxy' I found this site http://www.lspace.nildram.co.uk/freeware.html that seems to have the sources too. I intend to investigate this further. Thanks

Regards
Re: How to internet enable a serial device [message #32624 is a reply to message #32623] Sun, 29 May 2011 04:12 Go to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Hi Jerson

Yes it is a bit of a hump to get over the first time.

If you have more than one computer you probably have a router which is your link to the internet. If not they are about $40 U.S.
Then it's just the set up to your board, which I am not familiar with. With LAN cameras whatever board they use it's almost plug-n-play, there are a few settings but usually straight forward for as many cameras as you want.

Your board to router should take care of it.

If you don't mind keeping your computer on then your connection to the internet is through there even if you just have a phone modem.

[Updated on: Sun, 29 May 2011 04:29]

Report message to a moderator

Previous Topic: Control with fixed rate Height/Width
Next Topic: GridCtrl help needed
Goto Forum:
  


Current Time: Thu Mar 28 13:46:14 CET 2024

Total time taken to generate the page: 0.02100 seconds