Welcome, Guest
Username: Password: Remember me

TOPIC: Easy IoT for Particle photon/electorn devices

Easy IoT for Particle photon/electorn devices 5 months 3 days ago #3680

Hello Easy IoT,

I´ve been using Easy IoT Cloud for almost a year now with great results, working very well etc. After maintenance I haven´t been able to use your cloud because I cannot use the EIoTCloudRestApi library (it is only for ESP8266). The library is not compatible with the WEB IDE for Particle devices (www.particle.io). Do you have a solution for this?

Regards,

Ragnar
Last Edit: 5 months 3 days ago by rdavidsson.
The administrator has disabled public write access.

Easy IoT for Particle photon/electorn devices 5 months 2 days ago #3681

  • EasyIoT
  • EasyIoT's Avatar
  • Offline
  • Administrator
  • Posts: 826
  • Thank you received: 255
  • Karma: 23
rdavidsson wrote:
Hello Easy IoT,

I´ve been using Easy IoT Cloud for almost a year now with great results, working very well etc. After maintenance I haven´t been able to use your cloud because I cannot use the EIoTCloudRestApi library (it is only for ESP8266). The library is not compatible with the WEB IDE for Particle devices (www.particle.io). Do you have a solution for this?

Regards,

Ragnar

Hi Ragnar,

after upgrade old REST API was disabled for security reasons. Now you can use only REST API V1. Detailed spec is on this link:
iot-playground.com/blog/2-uncategorised/...-cloud-rest-api-v1-0

REST API V1 is more powerful than old REST API. Most important it uses security token to allow access to API. You can use new REST API V1 similar as old REST API. First you need to add new token in WEB interface (Configure->Tokens->Add token). After you add new token use this token in REST call in HTTP request header EIOT-AuthToken: [token]. I'm sure particle supports this. URL of request is also changed. Look at REST API V1 spec. Also you can help with ESP8266 library. The part to set value EasyIoT Cloud parameter is:
bool EIoTCloudRestApi::setParameterProperty(String parameterId, String property, String value)
{
	WiFiClient client;
   
	while(!client.connect(EIOT_CLOUD_ADDRESS, EIOT_CLOUD_PORT)) {
		debug("connection failed");
		wifiConnect(); 
	}

	String url = "POST /RestApi/v1.0/Parameter/"+parameterId+"/"+property+"/"+value;

	client.print(String(url+" HTTP/1.1\r\n") +
               "Host: " + String(EIOT_CLOUD_ADDRESS) + "\r\n" + 
               "EIOT-AuthToken: "+String(_token) + "\r\n" + 
			   "Connection: close\r\n" + 
               "Content-Length: 0\r\n" + 
               "\r\n");

	return parseResponse(&client);
}

I'm sure it can be easily translated to Particle IDE.


Also you can use MQTT protocol - it's standard for IoT devices.
Last Edit: 5 months 2 days ago by EasyIoT.
The administrator has disabled public write access.
Time to create page: 0.295 seconds
Powered by Kunena Forum