test_gateway.py
598 Bytes
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Code de test pour envoyer des requetes au gateway.
Created on Fri Jun 11 09:12:11 2021
@author: Georges de Massol
"""
import gateway as gw
gw.server = '192.168.1.180:8080'
EUI = "70b3d549966002e1"
endpoint = gw.Endpoint(EUI)
downlink = gw.Downlink(gw.server, gw.APIKey)
#fCnt = downlink.Lorasend(endpoint.EUI, b'\x01' + int(10000).to_bytes(4, 'big'))
downlink.FlushQueue(endpoint.EUI)
print("queue flushed")
fCnt = downlink.Lorasend(endpoint.EUI, b'\x55')
print("premier paquet envoye, fCnT : %s" % fCnt)
#downlink.ResetCounter(endpoint.EUI)