top of page

Remote learning support

Public·34 members
Ivan Volkov
Ivan Volkov

Openwrt Serial Port Programming Tutorial

If by chance the lan bridge is not working after flashing and the router is inaccessible, it might be worth a shot to use the serial instructions to add a serial port and configure Wifi. If ssh connection via Wifi is working a newer/bugfixed/stable image can be copied via scp and then installed via sysupgrade command.

Openwrt Serial Port Programming Tutorial


Warning: If you use a FTDI cable for serial console then you probably must disable the FTDI serial port driver or exclude the product ID 0x6014 for the FT232H chip in the serial driver. Patch for MacOS:

To allow easy programming, Arduino boards provide a USB interface that allows the user to connect them with a USB port to their PC. This means either that the board has a serial-to-usb adapter, or that the microcontroller itself is faking a serial-over-USB connection (which is perfectly possible for midrange and higher Arduinos).

After the installation of the packages, connect the Arduino to the USB port, then write dmesg to see if it was detected, and what is the serial device assigned to it (usually /dev/ttyUSB0 if you have only one Arduino connected)

Also called USB OTG.This Linux functionality is a bit obscure to most people yet very commonplace in consumer embedded linux devices. It allows to connect your device as if it was a USB peripheral of various types (serial port, usb storage, ethernet port, CD drive, audio device, keyboard/mouse and more).

To make an example, most modern 3G/4G dongles use this functionality to show themselves as: ethernet port (to provide the network connection), some serial ports (for comntrolling them), a CD drive (that holds an installer for some program to use them on Windows/MacOS) and usb storage (if they have a microSDcard port). Yes, there is a Linux system inside them, among other things.

On host device (ie PC) a USB Mass Storage device (VID:PID 0525:a4a5 by default) will appear and behave as any other USB Mass Storage device (ie flash stick) would.Module parameters can specify the serialnumber, number of LUNs to support as well as some other low-level features (see 'modinfo g_mass_storage' for details)

on host device (ie PC) a 'Linux Foundation Webcam Gadget' device (VID:PID 1d6b:0102 by default) will appearon target device (Gateworks board) a /dev/video device will be created and avialable as a Video4Linux output device supporting 320/240 YUYV videomodule parameters can specify the VID, PID, device version, manufacturer string, product string, serialnumber

Any idea of how to solve this issue? I'm really looking forward to be able to use the serial port library with nodejs, since I had a really positive experience on my previous project both from the point of view of the performance and from the point of view of its stability.

Which actually allows you to use your external SD card as available space either for linino and for storing basicly anything and, moreover, it actually even allows you to install both Nodejs and the Nodejs-serialport module.

Barionet 1000 is a fully programmable I/O device server, based on Linux/Lede/OpenWRT. The device features a wide range of interfaces such as two USB, WiFi, serial ports, Dallas 1-wire, analog and digital I/Os and Relays. It is IPv4 or IPv6 capable. Supporting multiple communication protocols, the Barionet device can be used in different applications such as automation, building control, public transport and many more. Barix Products are developed in Switzerland and manufactured to the highest standards.

All the Devices in the Barionet Product Familiy can easy be programmed in Lua programming language. The important Lua packages in order to user IOs and Interfaces are pre-installed in the default Barionet Images.

OpenWRT Development Snapshot Development snapshot is a minimal system, supporting the latest features. No graphical interface, requires serial terminal commands to set up. Recommended for experienced users only

Firmata is an intermediate protocol that connects an embedded system to a host computer, and the protocol channel uses a serial port by default. The Arduino platform is the standard reference implementation for Firmata. The Arduino IDE comes with the support for Firmata.

This could work perfectly with Odyssey-X86 with its onboard Arduino Core meaning that you can control the Arduino Core simply using Firmata protocol with different programming languages too! In this tutorial, it's based on Windows OS.

OpenWrt has uart serial port baudrade speed set via kernel command line option, so it is hardwired into kernel, and as far as I know this method is the only way to change baudrate speed of serial port.

You can now configure the router how you see fit. For much more details, read this OpenWrt Installation and Configuration Guide.ConclusionIn this tutorial, you learned how to flash the Plusnet Hub One Router with OpenWrt Version 21.02. You can now do things like:Configure VPNs.Setup VLANs.Block Ads and websites at the router.Enable QoS.Setup and File or Printer Server via the USB port.And pretty much anything you can do with Linux.

LuCI is the web interface server used by OpenWrt. First of all you need internet. Connect the router in the home network (wired LAN) and use the serial port to access OpenWrt console (yes, the hardware serial port). I recommend the CH340G USB to serial TTL converter (cheapest possible, less than 1 USD) with the jumper set to 3.3 V. Find your device on OpenWrt table of hardware and identify serial port pins. Connect only ground, RX and TX lines and start a PuTTY session on the serial port, with 115200 baud, 8N1 settings. If, when the router is booting, you get nothing printed in console, switch RX and TX connections.

This sketch uses the Serial Monitor of your Arduino Software (IDE) to interact with you, asking the relevant information for the configuration. The shield uses the hardware serial port on pins 0 and 1 to communicate with the board. On the Zero and Due use the Native port to interact with the board.Please get ready with SSID (the Access Point name) and the key or passphrase to access the WiFi network.We assume that you have your board properly configured and that you have already attached the shield onto it.Load the sketch and then open the Serial Monitor clicking on the Magnifier Lens icon on the right of the icon bar.You will see a message as the one in the screenshot below.

These boards do not have a second hardware serial port and therefore can't be used with the easy connection sketch described above. These boards can use the Yún Shield, but will have some limitations listed further down the page.

The UNO Rev3 and Mega2560 Rev3 boards do not have two hardware serial ports, therefore the only serial port available is connected to the Atheros processor. This keeps the serial port of the ATmega 328P busy and makes programming through USB not possible. Nevertheless, this shield can be used with the UNO board with the following caveats:

Note: programming the UNO boards through Web interface requires that your Yún Shield has firmware version 1.6.2 or newer. Please check the upgrade tutorial and be sure you're running the latest version available.

allow you to operate the board via a serial terminal.Here is a setup where we connect a board to a PC via the PSU-ONECOM and you can power on your board from either the PSU-ONECOM or its MicroUSB:You can use a USB to Serial conversion board too. Make sure you use a 5V/2A power to power your board from its MicroUSB port:

When you do kernel development you'd better get a serial communication board. After you connect your board to a serial communication board you will be able to do development work from a commandline utility.Here is a hardware setup:After you connect your board to a serial communication board (e.g. FriendlyElec's serial communication board) you can power the whole system from either the DC port on the serial communication board or the MicroUSB port(if there is one) on your board:

Routers with a serial port AND working CFE (bootloader) can often be recovered with a serial adapter, using CFE low-level commands. Otherwise JTAG is required to debrick, if available, which can also replace a corrupted CFE. The last resort is to desolder the flash chip and use a programmer to flash CFE (if needed) and firmware.

Serial ports are normally four or five pins on the router board. Unless it has an OEM header, you have to either solder the wires to the pads, or remove solder from the holes to install an appropriate header. Some routers have serial ports inside the WAN port, and here is a link to some Serial port pinouts.

Serial cable can be either USB or DB9 connection type and be capable of voltage level shift to +3.3V, not +5V. There are three or four connections for serial to function properly: Vcc (+3.3V, but usually not connected), GND, Tx and Rx. Some boards are NOT marked with pin designation, so use a multimeter to determine power and ground to avoid shorting the serial cable TTL chip. Then you can guess at the Rx and Tx lines. Rx and Tx are labeled relative to the cable, so Rx line needs connected to the router's Tx, because the router labels are also relative to it, so Tx and Rx get crossed for proper connection. On routers with two Serial ports (Tx0/Tx1 and Rx0/Rx1), use the "0" ports for your connections (I've not seen a router yet that connects to the "1" side).

To configure a VoCore2 using this tutorial, you will need to use the vi text editor and a serial emulator. If you are not familiar with these, there are links in the tutorial which will provide assistance.

OpenWrt version supported for ESPRESSObin is Designated Driver (DD), with additional patches for the boards. We will download OpenWrt to /opt/openwrt/openwrt-dd so create the directory and position there:

minicom is a serial communication program that connects to devices through a GNU/Linux PC's serial ports. If run by calling its name without any additional arguments, it uses whatever settings have been saved for its defaults in /etc/minicom/minirc.dfl. For those using Windows, PuTTY is a viable application to make such connections between a Windows PC and one of our EMAC devices. More information about PuTTY can be found at


Welcome to the group! You can connect with other members, ge...
bottom of page