PDA

Bekijk de volledige versie : Servo control



AdrianA
20-03-2008, 10:03
Hi!
First of all, I appreciate very much all this labor that all of you are doing here and special thanks to Oleg!
I have read some 50 threads to find something that fit to my need, but I give up. This is why I am posting here.
I start a robot project. First I choose XBee chips for transmission. Now I found this router wl-500gp and I intend to integrate it within the robot. I also plan to use a webcam due the plug'nd share....possibility. I built a servo controller based on a PIC 16F84A (http://home.planet.nl/~j_havinga/servo/servo.htm). Basically the PIC receive serials commands and send PWM to every servomotor. From what I read til now, I found that it is possible to add a serial port to the router WL500G Premium (part of problems solved). What I have to do is to send serial commands from desktop pc (windows xp) to the serial port added to the router. Shortly, create a wireless link beet win a win32 program and my PIC which handle the servos. I know how to do the part of windows (tcp raws- or controlling serial port if is necessary)... Any other idea it is welcome.
Thank you for your time.
AdrianA

Serpent
20-03-2008, 10:31
The same answer like here. (http://wl500g.info/showpost.php?p=88986&postcount=6)

al37919
20-03-2008, 10:48
You mean that you're going to build the router into your robot?

If you use USB->COM converter don't forget that you will need another chip for COM port level's matching.

Much better solution would be to solder the 8-pin header to the router's board, because the router already has 2 COM ports. They operate at 3.3V levels, which will be acceptable by your MC either directly, or need only a simple divider.

AdrianA
20-03-2008, 13:54
The same answer like here. (http://wl500g.info/showpost.php?p=88986&postcount=6)

Hi again!
Thank you for your answer. But do not help me. This is what I need: ''What I have to do is to send serial commands from desktop pc (windows xp) to the serial port added to the router.''
To: al37919
Yes, I intend to integrate the router in my robot :) and communicate wireless with the router. I have 5V and more Apms inside the robot. For two reasons: to add a usb webcam to my robot; and to intend to control wireless the servos (I have built a serial controller). I do understood that it is possible to add serial port to the router in a very easy fashion (and yes, I'll have to adapt the levels Tks) and it is quite nice !
Perhaps I was not so clear in my desire (sorry for my english). I want to access one of this serials ports of router from my desktop winXP, practically, to send wireless some bytes (4) from windows to router serial port.
Thank you once again.

al37919
20-03-2008, 14:20
you have /dev/tts/0 and /dev/tts/1 devices. I can speculate that probably you device should be connected to the port 1, as port 0 is actually a system console. So writing something to /dev/tts/1 should give you result you need. Of course, you should establish ssh or telnet connection. And before all to install and setup custom firmware.

AdrianA
20-03-2008, 14:54
Thank you!
it is a very good point of start!
1'st step install oleg's firmware
2'nd create a telnet connection: in windows i'll do. in linux i have to make a program to watch the telnet connection, ''translate'' the info and then to write it in port 1.
it is that correct? Then i am dead man. i do not know programing linux....

al37919
20-03-2008, 17:24
no, telnet or ssh connection to unix allows you to execute commands on remote system (you get something like powerful dos prompt). So, you need to type
echo "ABCD" > /dev/tts/1

So, what you need is to search a component for your windows programming system, which allows to open telnet or ssh connection to the remote system, and then send bytes to it.

raas
20-03-2008, 18:49
Hi,

like al37919 said..
the ssh connection bewteen your application and the ssh-server which is running on the router.

I don't know you IDE, but for .net there's something like http://www.tamirgal.com/home/dev.aspx?Item=SharpSsh

AdrianA
20-03-2008, 18:49
no, telnet or ssh connection to unix allows you to execute commands on remote system (you get something like powerful dos prompt). So, you need to type
echo "ABCD" > /dev/tts/1

So, what you need is to search a component for your windows programming system, which allows to open telnet or ssh connection to the remote system, and then send bytes to it.

Ok. I understood. This way to send some bytes will introduce some latency, i think... If it is working without latency will be great.
Right now I am reading some linux socket implementation in c++ to see if it is suitable to my need.
Thank you

AdrianA
23-03-2008, 01:54
Hi

To be more concrete, this is the chain:
PC (wireless network card) <==wireless tcp connection==> Asus WL500 (wireless network device) <==software bridge==> Asus WL500 (serial port device)
I still working with tcp connection and so fare i manage to make a direct tcp connection between 2 windows machines over internet. Now i have to compile the same source (lazarus&fpc) on a linux machine and establish the connection with a linux machine.
One question is: if I compile the program on a pc linux machine, the executable (binary) will work in oleg firmware environment aka asus oleg linux firmware? I think that I have to change the names of the devices...
Assuming we have this wireless connection PC <=> wl500. The above mentioned tcp connection it will be made between the PC wireless network card (192.168.1.10) and the WL500 wireless network card (192.168.1.1 ??). This WL500 wireless network card - device...what it is it name internally, in linux box? Because I have to refer to it in my linux program.
Program which made a ''bridge'' between the tcp connection and serial port of asus. Like I say, I don't know the internal name of the WL500 wireless card. A link it is enough. Thank you.
I found this thread http://wl500g.info/showthttp://wl500g.info/showthread.php?t=4535hread.php?t=4535 (http://wl500g.info/showthread.php?t=4535) about ser2net. Did anybody know how it is made the translation form tcp packet to serial byte? All I need it is to send a few bytes from tcp port to serial port of asus.
Thank you for your time. All the best.

al37919
23-03-2008, 06:13
with compilation for the router you have two options.
1) compile on the router natively. You need to install package optware-devel
2) install cross compile environment on PC: http://www.nslu2-linux.org/wiki/Optware/AddAPackageToOptware
Direct compilation on PC is useless.

On wl500g Premium wireless interface has name eth1