-
Notifications
You must be signed in to change notification settings - Fork 0
Iteration 2 ASM
OriHalyo edited this page Jun 5, 2018
·
7 revisions
In this iteration we will be finish the functionality of the basic state, mean we going to send to cloud min' data package of "pulse" every X time. the sensor will send a package that says "everything is ok", for us it mean there was no change to data, as well as the sensor is function.
Itamar:
- building the system "skeleton"
Ori:
- see how active python on IoT device
Skeleton
class device(ABC):
def __init__(self, interval, ID, description):
self.interval = interval
self.ID = 12
self.description = description
self.dataType = "my data type"
self.mode = "standBy" #device state: standby= regular mode (waiting for something to happen)
print("device: init device:", description)
def save(self, path):
with open(path, 'wb') as f:
return pickle.dump(self, f)
def load(self, path):
with open(path, 'rb') as f:
self.__dict__.update(pickle.load(f).__dict__)
@abstractmethod
# override from device
def setInterval(self, interval): # interval for heart beat send
pass
#override from device
def doesNeedAnalyzing(self): # is the data need to be analyzed (example: if only 1 second past from last time there is no need)
print("device: check if need analyze")
return True # todo: just place holder, need to check if need analyze
@abstractmethod
# override from device
def deleteOutdatedData(self): # delete data who isn't nececcery anymore for cleaning space in device memory
print("device: deleteOutdatedData")
pass
#todo: ERASE?
# def sendData(self): # send data to cloud
# print("device: sending data")
# pass
def getReady(self): # final initializaion of device
pass
def isTheDataHasChanged(self): # boolean
pass
def getChange(self): # get the change from the old data that captured in sensor to the new data captured
pass
def sendPulse(self): # pulse heart beat to the server
print("device: sending pulse")
pass
def isReady(self, false): # is the device ready to send data amd etc?
pass
def createData(self, dataType): # create the data file
pass
def setDescription(self, description): # set a new (textual) description to the device
pass
def deleteOutDatedData(self):
pass # todo: place holder. need to write the method
def printDetails(self):
pass
def sendData(self, path):
pass
IoT Devloper Guide Devloper Guid for IoT Device
We have a delay with our schedule, it took us too much time the connection python to IoT device due the device was not support python. We Decided that we have to create each sensor own class, so we will have to deal with it in the next iteration.
Project's Wiki Table of contents
-
Iterations:
- Iteration 0 - ZFR
- Interation 1 - MVP
- Iteration 2 - ASM
- Iteration 3 - SaC
- Iteration 4 - SaB
- Iteration 5 - FH