Setting up a UDP based network serial port on a Linksys WRT5. GS router. Introduction. This is part 2 of a tutorial I wrote on using network serial ports on a Linksys router. In part 2 of this tutorial I am going to show how to get a UDP based network serial port running on your Linksys WRT5. GS dd- wrt powered router. This is an animation of netcat receiving a Locosys GPS NMEA datastream via UDP. The nice thing about Linksys WRT5. GS routers is that you can get them for about $2. Bay. You need to check the model number to make sure it has enough ram to run the full version (standard generic) of dd- wrt and have plenty of memory available to create a JFFS storage partition. You can check out the details and specs of your router model on the dd- wrt router database. You need to start by following the all the steps on my first blog post to get a working TCP based serial link before you try this tutorial. Part 2 of this tutorial also expects you to have created the JFFS partition and installed the custom build of netcat from the first tutorial. One of the serial ports is easy to use and the other serial port is tied up with the serial console on the router. Step 1. Prepare the Files on your desktop system. Download the ZIP archive file. This program will allow you to set the baud rate for the Linksys WRT5. GS serial port. Step 2. Copy the files to your Linksys router. Use the SCP protocol and a program like WINSCP to copy the files from your desktop computer onto the /jffs/tmp folder on your Linksys router. This is the Win. SCP Login window. To connect to your Linksys router with SCP you need to type in the IP address of your router under Host Name. Set the user name to root and type in your password. The File Protocol should be set to SCP. You also need to edit the Win. ![]() SCP Environment settings. In the Win. SCP Login window click on the SCP/Shell section. Under the Other options section you need to disable Lookup user groups. Click the Continue button.
This is the initial path for Win. SCP. You need to navigate in Win. SCP to the /jffs/tmp folder to install the UDP support files on the router. Drag the files you expanded from the ZIP archive in Step 1 of this tutorial to the /jffs/tmp folder in Win. SCP. This is the file copy dialogue in Win. SCP. This is the folder view of the /jffs/tmp directory after I copied the supporting files in place.(It is important that you have followed Step 4. Enable JFFS2 Support on your router from on my first tutorial. Install the supporting files. Login to your router using SSH. On Linux use your standard terminal program. On Windows you can download the free Putty SSH program. I am going to connect to the router using SSH with the default username of “root”. ![]() How to get RS232 communications working between your computer and measuring device: RS232 pin connections, testing, serial port notes, handshaking. Using a USB to Serial adapter and Terminal Emulator in Windows 7 to communicate with a DM101 Z Technology Application Note No: 40 This application note outlines the. The main reason why you need any program like minicom to communicate over a serial port is that the port needs to be set up prior to initiating a connection. This tutorial covers how to create a serial port connection using HyperTerminal terminal emulation software for Windows. I typically use screen(1) to open a serial port with the command: sudo screen /dev/ttyUSB2 115200 I've tried setting parenb (and a number of other things) using the. It's only a matter of soldering a few more wires to add an SD card to your router. For this mod, my preferred method of attaching the SD card is to buy. On Mac and Linux systems you would connect to the router using: ssh root@1. On Windows the SSH program called PUTTY is used to connect to the router. ![]() ![]() Here is a screenshot of the PUTTY Configuration window that is used to login to the dd- wrt router. Using Putty you can save the connection settings by giving your SSH connection a session name and pressing the Save button. This is the DD- WRT v. SSH. Once you are connected to the router you need to navigate to the temp folder on the JFFS partition. This is where your UDP support files are. Next we need to install the setserial program. Start by updating the ipkg package list. The Setserial package is used to configure the serial port’s IRQ address. Type the following into the dd- wrt SSH command line: ipkg updateipkg install setserial. Then copy the new busybox program from the current /jffs/tmp folder to the new /jffs/usr/bin folder. If you have ser. 2net running on the Linksys router (based upon the instructions from part 1 of my previous Linksys dd- wrt serial port tutorial) now would be a good time to quit the ser. If ser. 2net is listed as a startup item in the dd- wrt web UI you should remove it there aswell. Run the program “top” from the dd- wrt SSH command line to find out the current Process ID (PID) for ser. Make a note of the PID number for ser. This PID number is unique and changes every time you restart your router. Now let’s quit top by pressing the Q key on the keyboard. To termiate the ser. PID number on your system that was displayed next to the process name “ser. In this example ser. PID of 3. 24. kill 3. Step 4. Testing the UDP settings. To test that everything is installed correctly lets manually type in the settings once before we define a new startup command. We will start by defining an IRQ address for the tts/1 serial port. This is the available serial port on a Linksys WRT5. GS router that is NOT linked to the router’s serial console. For this example I have a Locosys 3. Volt gps connected to the 1. I soldered on my Linksys WRT5. GS router in part 1 of the tutorial. The Locosys LS2. 00. GPS. On my Linksys router I had to run the command twice to force the setting./jffs/usr/bin/busybox stty - F /dev/tts/1 raw speed 3. F /dev/tts/1 raw speed 3. Next we will run the program netcat (that we installed in the previous Linksys serial tutorial). Netcat is a handy network utiltiy that has a lot of cool features. The feature we are going to use today is netcat’s ability to forward data from the /dev/tts/1 serial port to an incomming UDP connection. When we start netcat from the command line we can enable UDP support by adding the - u argument . The standard version of netcat that is comes pre- installed with dd- wrt is called “nc” and lacks UDP. In this example I am going to have netcat reply to any incomming UDP requests using the UDP port number 3. Netcat will use the Linux < redirection feature to open the tts/1 serial port on the Linksys router and send the serial data out over UDP. Step 5. Setting up a Startup item. Note: You need to have a BASH . This is important because netcat will quit every time it finishes a remote UDP connection on the Linksys router. The BASH script will restart netcat automatically so your router will be ready for a new connection. The web based dd- wrt control panel makes it easy to define startup items. Using a web browser connect to the dd- wrt control panel. If the startup item was save correctly when you reboot the router you should see the program gps. For your reference, here is the contents of my bash startup script gps. If you set this script to be a startup item it will automatically set the baud rate for the serial port and launch netcat in an infinite loop. You can change the baud rate of the connection by replacing the number 3. You can change the UDP server port number by replacing the netcat 3. Contents of the. Connecting to the router using UDPUsing UDP with netcat on Mac OS XNow that you have your Linksys router all set up the netcat program will listen for an incomming UDP connection. Note: With this set up only one UDP connection is possible at a time. Also the default version of netcat called nc that comes bundled with Mac OS X does not include UDP support! Since the default version of netcat that comes with Mac OS X doesn’t include UDP support, . If everything is set up correctly I should see a live NMEA serial data stream from my Locosys GPS over my network connection. Once nc connects to the Linksys router you need to press either the. This utility comes with all versions of Mikro. C. The UDP Terminal in Mikro. C offers a simple GUI that lets you send and receive UDP data. This utility comes in handy when you need to interact with a networked UDP device like a PIC microcontroller while you are programming a new firmware with Mikro. C. You can find the Mikro. C UDP Communication Terminal in the Tools menu. The Mikro. C UDP Terminal is located in the Tools menu. The Mikro. C UDP Communication Terminal makes it easy to test a UDP connection on Windows. In the Mikro. C UDP Communications Termial type in the IP address for the Linksys router and the UDP port number 3. Then click the Connect button. You need to send a single character to netcat on the Linksys router to start receiving the UDP datastream. Type any ascii letter into the send text field and then press the send button. Now the UDP Terminal will start receiving the UDP packets from the router. You can click the Clear button to erase the contents of the received text area. Using PUTTY and a loopback connection on the Router. Another way I was able to test the UDP connection to the router was by using Putty to create a 2nd SSH connection on the Linksys router. I then ran another copy of netcat on the Linksys router using SSH to connect to the UDP server port: netcat - u 1. Using PUTTY with SSH to create a 2nd SSH connection to the router.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2016
Categories |