Project

General

Profile

4G » History » Version 1

sacha, 01/30/2020 04:19 PM

1 1 sacha
# 4G
2
3
## Installation API Python de Huawei
4
5
~~~
6
pkg_add py3-pip  
7
ln -sf /usr/local/bin/pip3.6 /usr/local/bin/pip 
8
pip install huawei-lte-api
9
# API: /usr/local/lib/python3.6/site-packages/huawei_lte_api/api
10
# For more API calls just look on code in the huawei_lte_api/api folder, there is no separate DOC yet
11
~~~ 
12
13
## Consulter l'API Huawei ( en Python )
14
15
~~~ python
16
from huawei_lte_api.Client import Client
17
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
18
from huawei_lte_api.Connection import Connection
19
connection = AuthorizedConnection('http://admin:Rosedor123@192.168.8.1/')
20
21
# connection = AuthorizedConnection('http://admin:MY_SUPER_TRUPER_PASSWORD@192.168.8.1/', login_on_demand=True)
22
# connection = Connection('http://192.168.8.1/')
23
client = Client(connection)  # This just simplifies access to separate API groups, you can use device = Device(connection) if you want
24
print(client.device.signal())  # Can be accessed without authorization
25
~~~
26
27
## Exportateur Prometheus
28
29
/home/sacha/node_exporter_huawei_prom                                                                                                                     
30
~~~
31
#!/usr/local/bin/bash
32
/usr/local/bin/python /home/sacha/huawei.py \
33
  | gsed -e 's/['\''{}]//g' -e 's/[][]//g' -e 's/dBm//g' -e 's/dB//g' -e 's/MHz//g' -e 's/kHz//g' -e 's/\n//g' \
34
  | tr -d '\n' | tr ',' '\n' \
35
  | gsed -e 's/^ //' -e '/^$/d' -e '/^nei_cellid*/d' -e '/^ul_mcs*/d' -e '/^dl_mcs/d' -e '/None/d' -e 's/txpower: //g' \
36
    -e 's/PPucch/\nPPuch/g' -e 's/PSrs/\nPSrs/g' -e 's/PPrach/\nPPrach/g' -e 's/earfcn: //g' -e 's/UL/\nUL/g' -e 's/ //g' \
37
    -e 's/:/ /g' -e 's/transmode TM/transmode /g' \
38
  | sed -e 's/^/huawei_/' \
39
  > /var/node_exporter/huawei.prom || rm /var/node_exporter/huawei.prom
40
echo >> /var/node_exporter/huawei.prom
41
~~~
42
43
## Antennes externes LTE SMA-J1.5
44
45
https://www.amazon.fr/dp/B01N11WV54 ou la https://www.amazon.fr/dp/B00CS2D7ZI
46
47
Qualité du signal 4G:
48
49
| ANTENNE                    | Sans ANTENNE   |
50
|----------------------------|----------------|
51
| RSRQ: -5dB                 | RSRQ: -12dB    |
52
| RSRP: -85dBm => super !!!  | RSRP: -108dBm  |
53
| SINR: 1dB                  | SINR: 7dB      |
54
| PLMN: 20810                | PLMN: 20810    |
55
56
57
https://routeur4g.fr/antennes-4g/
58
https://forms.na1.netsuite.com/app/site/hosting/scriptlet.nl?script=457&deploy=2&compid=818164&h=5928a16f2b6f9582b799&article=understanding-lte-signal-strength-values