You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importrandomfromiottalkpy.danimportNoData### The registeration api url, you can use IP or Domain.# api_url = 'https://iottalk2.tw/csm' # defaultapi_url='http://GG/csm'# with URL prefix# api_url = 'http://localhost:9992/csm' # with URL prefix + port### [OPTIONAL] If not given or None, server will auto-generate.device_name='Dummy_Test'### [OPTIONAL] If not given or None, DAN will register using a random UUID.### Or you can use following code to use MAC address for device_addr.fromuuidimportgetnode# device_addr = "{:012X}".format(getnode())# device_addr = "..."### [OPTIONAL] If the device_addr is set as a fixed value, user can enable### this option and make the DA register/deregister without rebinding on GUI# persistent_binding = True### [OPTIONAL] If not given or None, this device will be used by anyone.# username = 'myname'### The Device Model in IoTtalk, please check IoTtalk document.device_model='Dummy_Device'### The input/output device features, please check IoTtalk document.idf_list= ['Dummy_Sensor']
odf_list= ['Dummy_Control']
### Set the push interval, default = 1 (sec)### Or you can set to 0, and control in your feature input function.push_interval=10# global intervalinterval= {
'Dummy_Sensor': 3, # assign feature interval
}
defon_register(self):
print('Register successfully')
defDummy_Sensor():
returnrandom.randint(0, 100)
# Or you want to return nothing.# Note that the object `None` is treated as normal data in IoTtalk## return NoDatadefDummy_Control(data): # data is a listprint(str(data[0]))
The text was updated successfully, but these errors were encountered:
sa.py
中的 endpoint 打錯導致 requests 無法正常將 request 送到 EC 時,subprocess 會拋出 exception 但整個程式並不會中止而是 halt 住,需要多按一次 CTRL-C 才能終止The text was updated successfully, but these errors were encountered: