Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/centralnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@


class ConfigError(Exception):

def __init__(self):
self.message = "Can not config"


# Esta clase contiene la informacion del nodo
class centralnode:

def __init__(self, config_path):
config_file = open(config_path, 'r')
config_dic = json.load(config_file)
Expand Down Expand Up @@ -84,7 +82,9 @@ def config_trama(self):
return config_frame

def init_lora(self):
expect = [1, 0, 129, 12, 165, 165, 108, 64, 18, 7, 0, 0, 1, 1, 0, 3, 0, 182]
expect = [
1, 0, 129, 12, 165, 165, 108, 64, 18, 7, 0, 0, 1, 1, 0, 3, 0, 182
]
config_frame = self.config_trama()
self.ser = serial.Serial(self.lora_port, timeout=5)
self.ser.write(bytearray(config_frame))
Expand All @@ -104,7 +104,6 @@ def init_lora(self):


class loranode:

def __init__(self, dic):
self.id = dic['loraid']
self.slaves = dic['slaves']
Expand Down