Extending Router Functionality
Document Content and Structure
This manual introduces various methods for enhancing your Advantech router's core functionality using both built-in firmware capabilities and custom development approaches. Each Advantech router platform offers a degree of extensibility, allowing users to customize and optimize its behavior for specific applications and use cases. The methods described in this document are generally structured by increasing complexity — from simpler scripting solutions to more advanced application and firmware development — and are grouped into the following parts, each covered on its own page:
Part Shell Scripting — Scripts are sequences of commands executed via the router's command-line interface (CLI). This method allows users to automate tasks, manage router operations, and extend functionality without modifying the core system firmware. Shell scripts are often the most flexible and immediately accessible way to add simple custom features, enabling tasks like remote management, handling network events, or controlling basic I/O ports (GPIO scripting).
Part Python — Python support on Advantech routers, typically provided via installable Python Router Apps (Full and Lite versions), offers a powerful high-level programming language for more complex automation, data processing, and custom application logic. It facilitates interaction with router functionalities, development of sophisticated scripts, and management of third-party libraries (with
pipin the Full Python RA), providing a significant step up in capability from basic shell scripting.Part Router Apps — Router Apps (formerly known as User Modules) are self-contained software packages. They can be developed in languages like C/C++, Python, or shell script and then installed on the router. Router Apps provide a structured and robust way to add significant new features or custom applications that are not available in the default firmware. They are ideal for users who need specific, well-integrated functionality, prefer a plug-and-play solution, or need to distribute custom features reliably.
Part Router Peripherals — This part describes how to interact with and control the router's various hardware interfaces. It covers utilizing the General Purpose I/O (GPIO) interfaces for monitoring and control, managing devices connected to the USB interface (such as storage media or serial converters), and programming user-configurable LEDs for status indication. Examples and usage of command-line utilities like
ioandledfor managing these peripherals are detailed. There are also available some bash and python script examples utilizing the peripherals.Part Constraints — Standard shell scripting and general Python usage (outside of Router Apps) are typically not supported on the S1 Router product line due to its enhanced security model which restricts direct shell access and script execution in the main OS. To achieve custom automation or extend functionality on S1 devices, developers must implement a custom Router App. This chapter details S1-specific programming considerations, development workflows, and security implications. (Part Router Apps provides general information on Router App development).
This chapter also discusses important hardware-related constraints and considerations relevant to application development on embedded routers. Topics include managing non-volatile memory (flash storage) effectively, understanding RAM limitations, and considering CPU performance implications to ensure applications run reliably without overloading the router's resources.
Part Custom Firmware — For highly advanced use cases requiring deep integration or modification of the router's operating system components, compiling custom firmware (or selected parts thereof) offers the most powerful solution. This method allows extensive control over software behavior and feature integration. It primarily involves understanding and potentially recompiling open-source components of the ICR-OS and requires significant knowledge of Linux, embedded systems, firmware development, cross-compilation toolchains, and thorough testing. Users should be aware of the significant implications regarding warranty and support when running custom firmware.
Part Special System Options — This chapter describes advanced configuration parameters and system settings that are not typically accessible or configurable via the standard web interface. These options allow for fine-tuning of specific router behaviors, underlying system services, or enabling specialized features.
Each of these methods for extending router functionality offers a different level of control, complexity, and development effort. This manual aims to provide the necessary information for users to choose and implement the appropriate method to meet their specific requirements, whether they are beginners automating simple tasks or experienced developers building fully custom solutions.