LTE modem HUAWEI K5161H + Serial Studio Example
Overview
This project demonstrates how to use Serial Studio and MQTT to visualize data from a LTE modem HUAWEI K5161H.
Using in this example
- OS Archlinux
- Mosquitto: MQTT broker
- Python
- paho: Python client library for MQTT
Step-by-Step Guide
1. MQTT broker Mosquitto
To install MQTT Broker Mosquitto run in terminal:
sudo pacman -S mosquitto
To run MQTT Broker Mosquitto with default settings run in terminal:
mosquitto --verbose
2. Parse data from LTE modem API
For simple cases, you can send data frame to MQTT from terminal, e.g.:
mosquitto_pub -m "100,50,75,89" -t "lte"
For complex situations, you can use Python (or another language for your choice) to retrieve and form the data frame.
An example script is contained in the file lte_mqtt.py
Install paho - Python client library for MQTT:
sudo pacman -S python-paho-mqtt
Run in terminal:
python lte_mqtt.py
Data frame will send to MQTT every 5 seconds.
3. Serial Studio Configuration
-
Download and Install Serial Studio:
Visit Serial Studio's official website to download and install the software.
-
Open Serial Studio and configure MQTT:
-
After get first frame of data Serial-Studio will automatic open dashboard with plots.
- Use Project editor to configure dashboard.
UDP Socket
Solution with UDP Socket looks much simpler than MQTT.
Run in terminal:
python lte_udp.py