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.
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!
To work in this mode, you must specify the name of the mode and the port. This is enough to get data from the modem!
For example:
./modeminfo --qmi -d /dev/cdc-wdm0
{"imei":"xxxxx","manufacturer":"Quectel","model":"EP06-E","firmware":"EP06ELAR04A04M4G","iccid":"-","reg":"registered", ...etc}
It 's a little more complicated here ... as I have already written, due to compatibility issues with different vendors, there is no convenient scalable solution. This solution does not solve these problems, although it is a more flexible. So, to work with your modem, we need to create a JSON file with commands for this modem (there is an example file in the examples), this will allow us to analyze this file and execute these commands, the result of execution will be JSON, which will put the answers to the places of requests, everything is simple!
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}
For example:
./modeminfo --network --qmi -d /dev/cdc-wdm0
./modeminfo --hardware --at -d /dev/ttyUSB2 -f /usr/share/quectel.json
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
cd openwrt
./scripts/feeds update -a ./scripts/feeds install -a make menuconfig
make cd
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
## 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).