Package: openioe
Open IoEOpen IoE is a simple IoT platform to operate IoT devices.There are two options available,Python Library (Client)Web services (REST APIs)1. Python LibraryUsers are expected to take these steps,Install Python Librarypip install openioeWrite the client code using the following methodsMethod List:NoMethodDescriptionExample1ReadValueTo read the sensor data from single nodes. Type of data is "Numeric/String"from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
SensorData,ResposeCode=oi.ReadValue()
print(SensorData)
print(ResposeCode)2WriteValueTo modify the control signal at single nodes. Type of data is "Numeric/String".from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xx
oi.Data=10
SensorData,ResposeCode=oi.WriteValue()
print(SensorData)
print(ResposeCode)3ReadJSONTo read the sensor data from single nodes. Type of data is "JSON".from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
SensorData,ResposeCode=oi.ReadJSON()
print(SensorData)
print(ResposeCode)4WriteJSONTo modify the control signal at single nodes. Type of data is "JSON".from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
oi.DataJSON={'Value': '10'}
SensorData,ResposeCode=oi.WriteJSON()
print(SensorData)
print(ResposeCode)5ReadXMLTo read the sensor data from single nodes. Type of data is "XML".from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
SensorData,ResposeCode=oi.ReadXML()
print(SensorData)
print(ResposeCode)6WriteXMLTo modify the control signal at single nodes. Type of data is "XML".from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.DeviceID=xx
oi.DevicePin=xxx
oi.DataXML='OpenIoE'
SensorData,ResposeCode=oi.WriteXML()
print(SensorData)
print(ResposeCode)7ReadTo read the sensor data from multiple nodes. Type of data is "Numeric/String".from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.UserIDPinAPIKeys=[[xx, xxx], [x, xxx]]
SensorData,ResposeCode=oi.Read()
print(SensorData)
print(ResposeCode)8WriteTo modify the control signal at multiple nodes. Type of data is "Numeric/String".from openioe.openioe_apis import *
oi=openioe_apis()
oi.APIKey='xxxxxxxxxxxxxxxxxxxx';
oi.UserIDPinAPIKeys=[[xx, xxx], [xx, xxx]]
oi.Data=[xx,xx]
Confirmation,ResposeCode=oi.ReadAPI()
print(Confirmation)
print(ResposeCode)9Generate API KeyTo generate new API key for a given email and password.from openioe.openioe_apis import *
oi.UserEmail='xxxxxxxxxx'
oi.UserPassword='xxxxxxxxxxx'
ResponseJson,ResponseCode=oi.GenerateAPIKey()
print(ResponseJson['User ID'])
print(ResponseJson['API Key'])
print(ResponseJson['Message'])
print(ResponseCode)10Create New DeviceTo add new IoT device for a given API key, name, cryptotype and data format.from openioe.openioe_apis import *
oi.APIKey='pnHEmHgjFl0PT247Eae9'
oi.DeviceName='Test000'
oi.CryptoName='None'
oi.DataFormat='Value' # 'XML' or 'JSON'
ResponseTest,ResponseCode=oi.CreateDevice()
print(ResponseTest)
print(ResponseCode)11DeveloperTo display the developer informationfrom openioe.openioe_apis import *
oi=openioe_apis()
oi.Developer()2. Web ServicesUsers are expected to take these steps,Register and login to OpenIoE-Register/LoginCreate API Key/ Get API Key from OpenIoE.Embed the API Key, Device ID and Pin into the client code.Visit the OpenIoE 3.0 web portal athttps://openioe.gnanodaya.orgVisit the OpenIoE 3.0 Help Portal athttps://openioedoc.gnanodaya.orgAPI List:NoAPIDescriptionTypeExample1showdevicevalueTo get hardware value from web service.http get<endpoint>/showdevicevalue/<apikey>/2/4332updatedevicevalueUpdate the hardware value passed as a parameterhttp get<endpoint>/updatedevievalue/<apikey>/2/433/23showdevicejsonTo get hardware JSON from web service.http get<endpoint>/showdevicejson/<apikey>/2/4334updatedevicejsonUpdate the hardware JSON passed as parameterhttp post<endpoint>/updatedevicejson/<apikey>/2/433 <Data>5showdevicexmlTo get hardware XML file from web service.http get<endpoint>/showdevicexml/<apikey>/2/4336updatedevicexmlUpdate the hardware XML passed as parameterhttp post<endpoint>/updatedevicexml/<apikey>/2/433 <Data>7generateapikeyGenerate new API Key by providing user credshttp get<endpoint>/generateapikey/<emailid>/<password>8createuserdeviceAdd new IoT device to your accounthttp get<endpoint>/createuserdevice/<APIKey>/<DeviceName>/<CryptoName>/<DataFormat>DevelopersThanks and RegardsVenkataswamy RAssistant ProfessorDepartment of Electrical and Electronics Engineering,School of Engineering and TechnologyChrist (Deemed to be University)Bengaluru-560074, Indiavenkatswamy.in