Project

General

Profile

4G » History » Version 4

sacha, 01/30/2020 04:53 PM

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