arduino-libraries / ArduinoIoTCloud

https://app.arduino.cc
Other
113 stars 78 forks source link

Red death by LED with PortentaH7 #303

Closed hpssjellis closed 2 years ago

hpssjellis commented 2 years ago

Can someone check if the ArduinoIoTCloud-Basic kills the PortentaH7 (Solid Red onBoard LED). I have copied ThingID and DeviceID from the cloud and used my own wifi credentials.

pennam commented 2 years ago

Hi @hpssjellis, i've made a test and everything looks fine on my side. Could you please telle me the core and IoT library version you are using ?

Just wanted to tell you that if you are using the latest IoT library >= 1.5.0 it is no more necessary to configure the ThingID because we have implemented the ThingId discovery protocol and the library retrieves the ThingID from the cloud.

I'll open another issue to remember to update library examples #304

Thanks

hpssjellis commented 2 years ago

@pennam Thanks for checking. I will re-test today. I think everything is up-to-date IDE 1.8.19 and library 1.5.0 but will double check. While here, do you have example code for both Ethernet and LoRa? I have both Portenta Shields and would like to get these setup as well.

pennam commented 2 years ago

No, i'm sorry i don't have nothing ready to share, but i will ask around and let you know.

hpssjellis commented 2 years ago

@pennam Can you explain BOARD_HAS_WIFI I have never seen it defined for the Portenta series.

hpssjellis commented 2 years ago

@pennam Wow this is really exciting, got the Basic code working! Thanks for your statement that it should work. I removed ThingID in these 2 spots.


//#define THING_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
#define BOARD_ID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

void onLedChange();

bool led;
int potentiometer;
int seconds;

void initProperties() {
#if defined(BOARD_ESP8266)
  ArduinoCloud.setBoardId(BOARD_ID);
  ArduinoCloud.setSecretDeviceKey(SECRET_DEVICE_KEY);
#endif
//  ArduinoCloud.setThingId(THING_ID);

We can probably close this, but I was looking at the code and with help could probably write the Ethernet and LoRa examples. If you haven't met me I wrote the "Portenta Pro Community Solutions" library, search for community in the Arduino IDE, twitter @rocksetta.

pennam commented 2 years ago

@hpssjellis BOARD_HAS_WIFI is defined here https://github.com/arduino-libraries/Arduino_ConnectionHandler/blob/28fc65b7492b6223a2b6dcc6fcfcc4ada12c79da/src/Arduino_ConnectionHandler.h#L50 and it is used to configure the preferred connection method in the ArduinoIoTCloud examples

pennam commented 2 years ago

Wow this is really exciting, got the Basic code working! Thanks for your statement that it should work. I removed ThingID in these 2 spots.

This is also a bit strange :wink: In the latest firmware library the hardcoded thing id is just ignored and should not be the cause of your issue.

I think the best place to start adding support for the Ethernet shield is the ConnectionHandler.

hpssjellis commented 2 years ago

This is also a bit strange 😉 In the latest firmware library the hardcoded thing id is just ignored and should not be the cause of your issue.

Could have been lots of issues on my side. No RED LED now so I am happy. Closing this issue. I will make 2 feature requests about the shields.