Turning Led on and off with Cloud and GSM

Hi im new to Arduino and need some help.

I am trying to turn the LED LED_BUILTIN of an Arduino MKR GSM 1400 on and off via Arduino Iot Cloud.

This is my Serial Monitor Output:

***** Arduino IoT Cloud - configuration info *****
Device ID: 0a89e9ac-102b-4a06-b346-e73e12ea4601
Thing ID: d9a4c5cc-4451-4fb8-ba70-d56814fa3077
MQTT Broker: mqtts-sa.iot.arduino.cc:8883
SIM card ok
GPRS.attachGPRS(): 4
Sending PING to outer space...
GPRS.ping(): 112
Connected to GPRS Network
Connected to Arduino IoT Cloud
Switch in cloud is:0
The light is OFF

No Matter how i switch my led thing in the IoT Cloud Dashboard, the LED_BUILTIN doesn't do anything and the led Variable stays 0.

In Attachment there is my sketch and a JPG of the thing.

Thanks for any help. :slight_smile:

Test_Led_sep15a (1).zip (5.08 KB)

Hello Newbee,
The most important thing is to start with the most minimalistic program that is possible in your project,
I guess for Arduino Cloud-IoT there are some examples. Did you manage to make one of the pre-written examples to work?

If you have a working example modify in small steps towards your needs.

Too much modifiying at once in combination with too less knowledge leads to a big mess that slows everything down.

best regards Stefan

Hello Stefan

Thanks for your reply. You are ofcourse right and yes i have also tried to use the ArduinoIotCloud-Basic Example from the ARDUINOIOTCLOUD Example Librarie, which does more or less the same thing as my own sketch. This has led to the same result. And I have also tried to turn the LED on and off directly via digitalWrite(LED_BUILTIN, HIGH) which has worked.

It seems to me that I am doing something wrong with the connection between IoTCloud and the device but I can't figure out what.

Regards, Pierino