elpinjo / CumulocityClient

Arduino library for connecting your WiFi enabled Arduino to Cumulocity IoT platform over MQTT
3 stars 4 forks source link

device credentials #1

Closed elpinjo closed 3 years ago

elpinjo commented 3 years ago

I am working on registering a device on cumulocity using ESP32. I am able to connect, register a device and can send data. However, once the device is disconnected, I am unable to reconnect and have to end up creating a new device. I have seen the example in Python where before creating a device, the code checks if the device already exists or not. However, the example in Arduino using different code structure. Can you please help or share some Arduino code that connects and receive device credentials?

Originally posted by @zabutt in https://github.com/arduino/Arduino/issues/9987#issuecomment-716785700

elpinjo commented 3 years ago

@zabutt, you would need to store the credentials received during the device registration. I was already planning on extending the example to make use of the ESP32 SPIFFS filesystem. I will work on that soon

zabutt commented 3 years ago

That would be a great help elpinjo.

elpinjo commented 3 years ago

I have created a new version of the library. Be aware I did change the API a bit to try and simplify it. The example that uses the ESP's SPIFFS file system to store device credentials is located in the example RetrieveAndStoreCredentials.

Note that there are two ways to connect your device to Cumulocity:

zabutt commented 3 years ago

Great. Will try the second way as we are already storing some of the device credentials using EPROM.