Topic: How to control wrt54gl serial from vb

I sucessful installed openwrt with ser2net to my Linksys WRT54GL.

I would like to use winsock from VB to control the serial of WRT54GL, but I don't know how to get start.

This is how my PC connect to the WRT54GL:
---------------                 ------------             ------------------------
| PC-RS232  |-----------|  MAX232  |---------|  SERIAL-WRT54GL  |
---------------                -------------             ------------------------

some of the configurations from WRT54GL:

vi /etc/init.d/setserial
boot() {
/usr/sbin/setserial /dev/tts/1 irq 3
/bin/stty -F /dev/tts/1 speed 9600 raw
/usr/sbin/ser2net -u &

vi /etc/ser2net.conf
# <TCP port>:<state>:<timeout>:<device>:<options>
1500:raw:3600:/dev/tts/1:9600 NONE 1STOPBIT 8DATABITS -XONXOFF LOCAL -RTSCTS

1. Run RealTerm (com1, baud rate:9600) & SSH (PuTTY)
2. When send data from SSH (echo xxx > /dev/tts/1), RealTerm is able to receive data
3. When send data from RealTerm, SSH (cat < /dev/tts/1) is able to receive data

I try to use socket programming from VB & Delphi 7, but failed to connect.

Re: How to control wrt54gl serial from vb

I found this page … duino.html (On top of the page, you can translate to English)

By installing the OstroSoft Winsock Component (OSWINSCK.dll)
I think it can use to control the serial from OpenWrt

Anybody download this Excel file & use with OpenWrt? … Telnet.xls
or … amp;psid=1

Re: How to control wrt54gl serial from vb

I found the solution myself. But it is not a fully solution.

Everytime the wrt54GL is restart, ser2net is not run at startup, instead I have to run ser2net manually from SSH.
Anybody know how to start the ser2net automatically?

For those who want to use the above Excel file (work with Oswinsck.dll), here is the solution:
Add remote port before socket connect. For my case, it is like this: Winsock1.RemotePort = 1500

Re: How to control wrt54gl serial from vb

Again I found the solution.
I put the ser2net to /etc/init.d/custom-user-startup

I'm very happy with OpenWrt