ARDUINO OPTA and BLYNK

I’m writing because I have a problem with Arduino OPTA and Blynk. If I insert the BlynkSimpleWifi.h library and the Blynk.config in my sketch everything is fine; as soon as I try to insert Blynk.run and compile the sketch I get this error which reports: "C:\Users\Facility\AppData\Local\Temp\arduino\sketches\BE48FF858D50271795B7F35445286FB0/…..\cores\arduino_mbed_opta_opta_split_100_0,target_core_cm7, security_none_41bcd6cecbbb7a037f4552f498a6888f\core.a(wiring_analog.cpp.o): In function analogWrite': C:\Users\Facility\AppData\Local\Arduino15\packages\arduino\hardware\mbed_opta\4.0.10\cores\arduino/wiring_analog.cpp:74: undefined reference to g_AAnalogOutPinDescription’
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

I attach skecht

#include "secret.h"    
#include <WiFi.h>   ///per WIFI
#include <BlynkSimpleWifi.h>   ///per blynk

void setup() {
Blynk.config(BLYNK_AUTH_TOKEN); 
BlynkTimer timer; 
if (WiFi.status() != WL_CONNECTED) {
        Serial.println("Connessione WiFi persa. Tentativo di ristabilire la connessione...");
        WiFi.begin(ssid, pass);
        Serial.println("Connessione alla rete WiFi in corso...");
        }
        else{     
        Serial.println();
        Serial.println("- NETWORK INFORMATION");
        Serial.print("- Connesso alla rete ");
        
        // Display network IP
        IPAddress ip = WiFi.localIP();
        Serial.print("- IP address: ");
        Serial.println(ip);

        // Display network RSSI
        long rssi = WiFi.RSSI();
        Serial.print("- Signal strength (RSSI): ");
        Serial.println(rssi);
        }

}

void loop() {
 if (WiFi.status() == WL_CONNECTED) {
 Blynk.run();
 timer.run(); 
 }
}

Thank you all

1 Like

I am also having the same problem with the Arduino Opta using the BlynkSimpleEthernet class

1 Like

I hope that someone can solve this problem. In this moment I’m using Arduino iot Cloud. I have done montlhy subscription. I wouldn’t transfer all application on Arduino Cloud. I can’t have two difference applications. How did you solve your issue? Thanks for sharing.

Hello,

i had the same problem with an Arduino OPTA. I looked inside the file “wiring_analog.cpp”, in the given path, from the error message and searched
for the undefined reference “g_AAnalogOutPinDescription”.

The Variable is declared in “Arduino.h” file and there is a comment which navigates me to OPTA/variant.cpp. I am not a C++ programmer so i don’t
understand every line of this code but in the variant.cpp is no Pins-Table for g_AAnalogOutPinDescription only a g_AAnalogPinDescription without the word “Out”.

So i decided to comment out the declaration and the reference to this Variable as shown below. After that my code is compiled sucessfully and works.

Maybe this helps someone.

wiring_analog.cpp:

void analogWrite(pin_size_t pin, int val)
{
  if (pin >= PINS_COUNT) {
    return;
  }
#ifdef DAC
  for (unsigned int i=0; i<NUM_ANALOG_OUTPUTS; i++) {
    //if (digitalPinToPinName(pin) == g_AAnalogOutPinDescription[i].name) {
    //  analogWriteDAC(digitalPinToPinName(pin), val, i);
    //  return;
    //}
  }
#endif
  float percent = (float)val/(float)((1 << write_resolution)-1);
  mbed::PwmOut* pwm = digitalPinToPwm(pin);
  if (pwm == NULL) {
    pwm = new mbed::PwmOut(digitalPinToPinName(pin));
    digitalPinToPwm(pin) = pwm;
    pwm->period_ms(2); //500Hz
  }
  if (percent < 0) {
    delete pwm;
    digitalPinToPwm(pin) = NULL;
  } else {
    pwm->write(percent);
  }
}

Arduino.h:

// Pins table to be instantiated into variant.cpp
extern PinDescription g_APinDescription[];
extern AnalogPinDescription g_AAnalogPinDescription[];
//extern AnalogPinDescription g_AAnalogOutPinDescription[];