Commit c5d9f6e0 authored by Sven  Pullwitt's avatar Sven Pullwitt
Browse files

changed coodinator

parent 86e5974f
......@@ -128,24 +128,26 @@ class PRREvalClient(Client):
logger.log( "CHANNEL={} ".format(channel) )
self.set_channel( channel )
sleep(0.25)
for power in [-17, -7, 0, 3]:
logger.log( "POWER={} ".format(power) )
self.set_txpower( power )
sleep( 0.5 )
for payload in ['short', 'miiiiiiiiiiiiiiiiidle', 'loooooooooooooooooooooooooooooooooooooooong']:
logger.log( "PAYLOAD={} ".format(payload) )
self.send_all( "payload {}\n".format( payload ) )
sleep( 0.5 )
# TODO(rh) START ROUND:
# round = Round( channel=channel, power=power, payload=payload )
# session.add( round )
# sessionc.commit()
for sender in NODES:
self.send({'dst': {'id': sender}, 'type': 'serial_tx', 'line': 'tx 5 200000\n'})
# 5 packets, 200ms -> 1 second
sleep( 1.5 )
self.send({'dst': {'id': sender}, 'type': 'serial_tx', 'line': 'ifconfig 3 set state idle\n'})
for angle in [0,25,50,75,100,125,150,175]
self.set_angle(angle)
sleep(2)
for power in [-17, -7, 0, 3]:
logger.log( "POWER={} ".format(power) )
self.set_txpower( power )
sleep( 0.5 )
for payload in ['short', 'miiiiiiiiiiiiiiiiidle', 'loooooooooooooooooooooooooooooooooooooooong']:
logger.log( "PAYLOAD={} ".format(payload) )
self.send_all( "payload {}\n".format( payload ) )
sleep( 0.5 )
# TODO(rh) START ROUND:
# round = Round( channel=channel, power=power, payload=payload )
# session.add( round )
# session.commit()
for sender in NODES:
self.send({'dst': {'id': sender}, 'type': 'serial_tx', 'line': 'tx 5 200000\n'})
# 5 packets, 200ms -> 1 second
sleep( 1.5 )
self.send({'dst': {'id': sender}, 'type': 'serial_tx', 'line': 'ifconfig 3 set state idle\n'})
def run(self):
while True:
......@@ -155,10 +157,13 @@ class PRREvalClient(Client):
logger.success("Stopped")
break
def set_angle(self, angle):
self.send({'dst': {'id': 'lctc-01-serialsteppermotormodule'}, 'type': 'serial_position', 'position': angle})
def set_channel(self, channel):
#self.send_all("ifconfig 3 set state idle\n")
self.send_all("ifconfig 3 set channel {}\n".format( channel ))
def set_txpower(self, power):
self.send_all("ifconfig 3 set power {}\n".format( power ))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment