Beispiel #1
0
def remote_set_retries(remote,retries,delay):
    print("remote_set_retries:")
    mesh.send_msg([7,0x70,mesh.pid["exec_cmd"],node_id,remote,mesh.exec_cmd["cfg_retries"],retries])
    loop(2)
    mesh.send_msg([8,0x70,mesh.pid["exec_cmd"],node_id,remote,mesh.exec_cmd["cfg_ack_delay"],0,delay])
    loop(2)
    return
Beispiel #2
0
def remote_test_channel(remote,test_target,channel,nb_ping=100):
    """
    Tests the RF connection between any 'remote' node and another 'test_target' node
    sends an RF message to execute an RF test command:
    - 'remote' : any node from the mesh network that will be sending pings
    - 'test_target' : receiver of the test pings and sender of ack
    - 'channel' : frequency channel, from 0 (2.4 GHz) till 125 (2.525 GHz)
      note that the remote will request the 'test_target' to switch to the test RF and then back
      condition is that the remote and the test_target are initially in the same channel, as there is no search
    - 'nb_ping' : usually 100 for a significant signal quality estimation
    """
    set_rx("msg",1)
    set_rx("bcast",0)
    set_rx("resp",1)
    print("Remote RF Test %d->%d, Chan %d" % (remote,test_target,channel))
    mesh.send_msg([9,0x70,mesh.pid["exec_cmd"],node_id,remote,mesh.exec_cmd["test_rf"],test_target,channel,nb_ping])
    loop(40)
    return
Beispiel #3
0
def remote_set_channel(target,chan):
    print("remote_set_channel:")
    mesh.send_msg([7,0x70,mesh.pid["exec_cmd"],node_id,target,mesh.exec_cmd["set_channel"],chan])
    loop(2)
    return
Beispiel #4
0
def ping(target,ttl=0):
    print("send msg ping:")
    control = 0x70 | ttl
    mesh.send_msg([5,control,0x01,node_id,target])
    loop(10)
    return
Beispiel #5
0
def send_RGB_test():
    mesh.send_msg([8,0x70,0x0B,node_id,24,0,0,3])
    loop(2)
    return