Skip to content

Commit

Permalink
Adding serial ESPNow controller
Browse files Browse the repository at this point in the history
  • Loading branch information
enesbcs committed Sep 18, 2019
1 parent 40f6867 commit e51b007
Show file tree
Hide file tree
Showing 8 changed files with 1,497 additions and 20 deletions.
4 changes: 3 additions & 1 deletion _C020_LoraDirect.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def controller_init(self,enablecontroller=None):
self.enabled = enablecontroller
self.initialized = False
if self.enabled:
if int(Settings.Settings["Unit"])>0:
self.controllerport = Settings.Settings["Unit"]
try:
BOARD.setup()
gpios.HWPorts.remove_event_detect(BOARD.DIO0)
Expand Down Expand Up @@ -321,7 +323,7 @@ def senddata(self,idx,sensortype,value,userssi=-1,usebattery=-1,tasknum=-1,chang
if Settings.Tasks[tasknum].remotefeed == False: # do not republish received values
dp2 = p2pbuffer.data_packet()
dp2.sensordata["sunit"] = Settings.Settings["Unit"]
dp2.sensordata["dunit"] = self.defaultuint
dp2.sensordata["dunit"] = self.defaultunit
dp2.sensordata["idx"] = idx
if tasknum>-1:
dp2.sensordata["pluginid"] = Settings.Tasks[tasknum].pluginid
Expand Down
5 changes: 4 additions & 1 deletion _C021_BLEDirect.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ def webform_load(self):
webserver.addFormNote("IP and Port parameter is not used!")
webserver.addFormCheckBox("Enable Receiver Service","receiver",self.enablerec)
webserver.addFormNote("Enable this for Gateway/Repeater unit, Disable if you only want to send data!")
if self.bleserv is not None:
try:
if self.bleserv is not None:
webserver.addFormNote("Current Address: "+str(self.bleserv.getaddress()))
except:
pass
webserver.addFormCheckBox("Enable Sending to Default Master Unit","sender",self.enablesend)
webserver.addFormCheckBox("Enable Direct Sending to Units in P2P list","directsender",self.directsend)
webserver.addFormNote("Please respect MASTER-SLAVE nature of BLE and do not create infinite loops!")
Expand Down
Loading

0 comments on commit e51b007

Please sign in to comment.