RBMTX-Lite OpenWrt SDK Exmaple: Różnice pomiędzy wersjami
Z Elproma Wiki Knowledge Base
Linia 24: | Linia 24: | ||
In this example we are going to show you how to generate OpenWrt package base on the simple Modbus client and server application. | In this example we are going to show you how to generate OpenWrt package base on the simple Modbus client and server application. | ||
<ol> | <ol> | ||
<li> Install dependency library. In this example it is '''libmodbus''' library. To install library run: | |||
<pre>./scripts/feeds install libmodbus</pre></li> | |||
<li> To create custom package, when you are in the SDK directory go to the package directory. | <li> To create custom package, when you are in the SDK directory go to the package directory. | ||
<pre>cd package</pre></li> | <pre>cd package</pre></li> | ||
<li>Make new directory where the package Makefile should be placed. | <li>Make new directory where the package Makefile should be placed. | ||
<pre> mkdir modbus_server | <pre> mkdir modbus_server | ||
Linia 40: | Linia 45: | ||
PKG_BUILD_DEPENDS+= libs/libmodbus</pre> | PKG_BUILD_DEPENDS+= libs/libmodbus</pre> | ||
[[Plik:MakefileNew.png| | [[Plik:MakefileNew.png|2000x1050px|lewo]] | ||
</li> | </li> | ||
<li | <li>Now we are ready to select packages and libraries which we want to compile. Go back to the SDK root directory and execute command: <pre> make menuconfig</pre></li> | ||
<pre> |
Wersja z 15:05, 19 kwi 2023
Prerequisites
You will need:
- A PC, laptop or virtual machine running Linux OS (preferably Ubuntu distro)
- An SDK intended for your router, which can be downloaded here: Software Development Kit
Preparation
- Create directory, where the SDK will be extrated e.g RBMTX_SDK.
- Open terminal in created folder and unpack SDK.
tar -xf ~/Downloads/rbmtx3-owrt-sdk-....Linux-x86_64.tar.xz
- Go to the SDK directory.
cd rbmtx3-owrt-sdk-22.10.14-rbmtx3_gcc-8.4.0_musl_eabi.Linux-x86_64/
- Update the feeds.
./scripts/feeds update -a
Compiling a custom package
In this example we are going to show you how to generate OpenWrt package base on the simple Modbus client and server application.
- Install dependency library. In this example it is libmodbus library. To install library run:
./scripts/feeds install libmodbus
- To create custom package, when you are in the SDK directory go to the package directory.
cd package
- Make new directory where the package Makefile should be placed.
mkdir modbus_server cd modbus_server
-
Create the Makfile file to build your custom package. Exmaple Makefile shown below.
- It is important to change all modbus_server string with your package name.
- In the SOURCE_DIR section add path to your package sources.
- If you use external library it is important to complete the dependency sections e.g:
TARGET_LDFLAGS=-lmodbus DEPENDS:= +libmodbus PKG_BUILD_DEPENDS+= libs/libmodbus
- Now we are ready to select packages and libraries which we want to compile. Go back to the SDK root directory and execute command:
make menuconfig