Openwrt Serial Port Programming Hardware

Flashing the firmware of the on the OpenWrt wiki. So I don’t feel the need to go over the architectural concepts in this article, but I did want to provide instructions for the Ubuntu specific tools you can use to flash the firmware.If you want to try flashing to OpenWrt using the factory LinkSys feature, that is your choice, but it really is working blind and you have no ability to fix issues if something goes wrong. After bricking my router once, I now rely solely on the Serial to USB-TTL cable which is the highly recommended connectivity method from the. Connect via USB-TTL cableI wrote a detailed article about using the USB TTL Serial cable to.After powering off/on the router, you should be able to clearly the see the boot sequence of your Linksys firmware in your terminal program. Below is a snippet of the output showing the Linksys logo in ASCII art which scrolls by as the router brings up all its services.Step 2. Determine your exact hardwareFor the, there are several ways you can determine the exact hardware: look at the firmware version as shown during the boot process as highlighted in the image above, OR login to the LinkSys web interface and look under the Signout About menu (default password is ‘admin’),OR look at the bottom of the router case and it will list the exact model number (whether WRT1200AC, WRT1900AC V1/V2, or WRT1900ACS V1/V2).

Note that the cardboard box shows the model, but is not sufficient because it does not list the exact version (V1 versus V2).Step 3. Download OpenWrt imageBased on the hardware version discovered above, you will need to download the relevant.

Serial

The ‘-factory’ images are for first time deployments (for example going from LinkSys standard firmware to OpenWrt). The ‘-sysupgrade’ images are for subsequent patching where you want to preserve the older settings. You can read more.Using the browser on your Ubuntu host, download the binary to a local folder. Connect via Lan cableYou should still have the USB-TTL cable from step #1 plugged in and communicating to the terminal program on your Ubuntu host.In order to avoid subnet and route conflicts, disconnect your Ubuntu host from any wireless networks by turning wireless off, or putting it into Airplane mode from the GUI. Or you can use console commands similar to below to disable a dynamic wireless connection.

Ifconfig wlan0 downNow connect wired Ethernet Port 1 on the back of the Linksys router (colored blue) to the wired Ethernet port of your Ubuntu host for a physical LAN connection.The serial connection is the ‘command channel’ for us to control the router. The LAN channel will be used to transfer the binary image from your Ubuntu host to the router in a later step.Now we are going to set a static IP address on the Ubuntu host so that we can guarantee that the router can reach it and there is no guesswork on the subsequent steps. The router is default to 192.168.1.1/24 and so we will force the Ubuntu host to the same subnet on 192.168.1.2I tried modifying ‘/etc/network/interfaces’ and using ifdown/ifup from the console in order to force a static IP, but in the end I used the desktop because I was getting unstable results and disconnects from the wired interface (I was using a LiveCD boot, so I was attempting to make these network changes without rebooting). Feel free to set the static IP in the manner you are comfortable, I’ll provide desktop instructions.From the desktop, open: System Settings NetworkAnd select ‘Options’. This will open the wired connection dialog, go to the ‘IPv4 Settings’ tab and select the Manual method and set the static IP address to 192.168.1.2, netmask to 255.255.255.0, and gateway to 192.168.1.1Then press the ‘Routes.’ button and add the router as a gateway to the 192.168.1.0 network.Press ‘OK’ on the routes dialog, and then ‘Save’ on the wired network dialog to save all settings.And now issuing ‘ifconfig’ from the Ubuntu console should report back that local eth0 is set to 192.168.1.2.

Openwrt Software

Issuing a ‘ping 192.168.1.1’ from the Ubuntu console should report packets coming back from the router. Step 5: Configure TFTP to serve OpenWrt imagethat can serve up the OpenWrt binary image to the router.When testing, make sure the TFTP server is available at the static 192.168.1.2 IP address because this is how it will be accessed from the router.

Tftp 192.168.1.2 Step 6: U-Boot and flashing the imageThe terminal program from step #1 should still be communicating with the router. Power off/on the router, and in the first few seconds you will get a message at the terminal saying ‘Hit any key to stop autoboot:’. You have three seconds to press a key, go ahead and do it, and you will be immediately be given the ‘Marvel’ console prompt.This is the U-Boot interface, and is where you will specify the IP address of the TFP server where the image will be retrieved, the name of that image, and then finally the command that flashes the image unto the router.First, let’s print the default parameters, and we will override what is necessary. Issue the following commands at the terminal program. Marvell printenv ipaddripaddr=192.168.1.1Marvell printenv netmasknetmask=255.255.255.0Marvell printenv serveripserverip=192.168.1.254Marvell printenv firmwareNamefirmwareName=cobra.imgThe ‘ipaddr’ and ‘netmask’ are what we expected, which is the default IP of 192.168.1.1 for the router. The ‘serverip’ is where the TFTP server should be located and we need to change that to 192.168.1.2 (the Ubuntu host).

HelloI would like to solder one or two serial ports to the WGT634U.I know that it's possible with MAXIM 232? As described inMy problem is that I only have MAXIM MAX3222CPN chips and I would like to know how to use those.Pinout of the chip is described here:I found some instructions how to build RS port with but WGT634U does not have RTS and CTS signals described in the picture of the circuit, how should I connect those? Just not connect?Circuit:Can I use only one MAX 3222CPN chip to build both serial ports, using connectors T1IN, T1OUT, R1IN and R1OUT for the first serial port and connectors T2IN, T2OUT, R2IN and R2OUT for the second one?RegardsKimmo.

To answer to myself, yes, using MAX 3222CPN works.I have now soldered both serial ports to the router but only ttyS1 seems to work.I had to solder header pins to the router circuitboard, there were header only for ttyS1.Kernel only mentions that IRQ 3 is for serial:# cat /proc/interruptsCPU02: 4915283 MIPS ath0, ehcihcd, usb-ohci, usb-ohci3: 4482 MIPS serial4: 142 MIPS eth07: 123209 MIPS timerERR: 0And the ERR: 0. But there is no IRQ 4 which should be there for ttyS0?Any ideas, is the second serial port disabled by hardware or just something else?