Kodo-kakaku / ModemInfo

Server part for modeminfo to get information about 3G/LTE keys in OpenWRT
GNU General Public License v3.0
6 stars 1 forks source link
lte luci modem openwrt qmi quectel sierra

ModemInfo

ModemInfo designed for luci-app-modeminfo backend. Goal of the project is to provide a user-friendly interface for receiving information from 3G/LTE dongle in OpenWrt.

Features

The main task of the server part is to request data about the equipment and the modem signal. The problem of receiving data from modem is the lack of any standardization of commands (each vendor uses its own commands). Now it is implemented to receive data from the modem using the serial port via AT commands or using the QMI interface. The response is returned in a JSON format that can be studied, parsed with a script or sent to the user interface, now all information about the modem is available to you!

How to use

Important:

After the file is ready, you will be able to execute the request!)

For example:
./modeminfo --at -d /dev/ttyUSB2 -f /usr/share/quectel.json
{"device":["Quectel","EP06"],"imei":"xxxxx","imsi":"xxxxx","iccid":"+ICCID: xxxx","firmware":"EP06ELAR04A04M4G","chiptemp":"+QTEMP: 31,31,30", ...etc}

Other Features

HARDWARE -> { "device", "imei", "imsi", "iccid", "firmware", "chiptemp" } NETWORK -> { "csq", "cops", "creg", "cereg", "cgreg", "any" }

- And of course it's pretty to print!

For example: ./modeminfo --pretty --network --qmi -d /dev/cdc-wdm0 ./modeminfo -p --hardware --at -d /dev/ttyUSB2 -f /usr/share/quectel.json

## How to build

Download OpenWRT if it's not already done

cd openwrt

Install packages from feeds

./scripts/feeds update -a ./scripts/feeds install -a make menuconfig

select latest C++ compiler

Advanced configuration options (for developers) ---> [*] Toolchain Options ---> GCC compiler Version (gcc 10.x)

make cd

Install the package manually

git clone https://github.com/Kodo-kakaku/ModemInfo mkdir openwrt/package/modeminfo mkdir openwrt/package/modeminfo/build cp -rf ModemInfo/openwrt-cmake/build* openwrt/ cp -rf ModemInfo/openwrt-cmake/Toolchain-mips.cmake openwrt/ cp -rf ModemInfo/src/ openwrt/package/modeminfo/build/ cp -rf ModemInfo/lib/ openwrt/package/modeminfo/build/ cp -rf ModemInfo/Makefile openwrt/package/modeminfo/ cp -rf ModemInfo/config.h.in openwrt/package/modeminfo/build/ cp -rf ModemInfo/CMakeLists.txt openwrt/package/modeminfo/build/

cd openwrt make defconfig make

That's All!



## Credits
- [libqmi](https://github.com/freedesktop/libqmi)
- [cJSON](https://github.com/DaveGamble/cJSON)
- [GLib – 2.0](https://docs.gtk.org/glib/index.html)

## License
ModemInfo like OpenWRT is released under the GPL v3.0 License - see detailed [LICENSE](https://github.com/Kodo-kakaku/ModemInfo/blob/main/LICENSE).