Author Topic: Blynk Compiling Issues  (Read 2758 times)

jens0771

  • Newbie
  • *
  • Posts: 12
Blynk Compiling Issues
« on: July 23, 2016, 08:55:44 am »
I've been trying to get the Blynk example compiled but it's having issues. I re-installed Arduino IDE 1.6.9 and first compile it completed but second time, after updating associated Oak Libraries, it failed. Here is the failure output.

Code: [Select]
WARNING: library SPI claims to run on [esp8266] architecture(s) and may be incompatible with your current board which runs on [oak] architecture(s).
C:\Users\Animal\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\cores\oak\OakParticle\oakboot-bigflash.c: In function 'Cache_Read_Enable_New':

C:\Users\Animal\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\cores\oak\OakParticle\oakboot-bigflash.c:32:9: note: #pragma message: CACHE READ COMPILED

 #pragma message "CACHE READ COMPILED"

         ^

C:\Users\Animal\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\cores\oak\OakParticle\particle_core.cpp: In function 'void particle_core::oak_rom_init()':

C:\Users\Animal\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\cores\oak\OakParticle\particle_core.cpp:2893:21: note: #pragma message: SYSTEM DEFINE NOT SET, DEFAULTING TO USER ROM

     #pragma message "SYSTEM DEFINE NOT SET, DEFAULTING TO USER ROM"

                     ^

libraries\Ethernet\Ethernet.cpp.o:(.text._ZN13EthernetClass5beginEPhmm+0x14): undefined reference to `__cxa_guard_acquire'

libraries\Ethernet\Ethernet.cpp.o:(.text._ZN13EthernetClass5beginEPhmm+0x18): undefined reference to `__cxa_guard_release'

libraries\Ethernet\Ethernet.cpp.o:(.text._ZN13EthernetClass5beginEPhmm+0x3e): undefined reference to `__cxa_guard_acquire'

libraries\Ethernet\Ethernet.cpp.o:(.text._ZN13EthernetClass5beginEPhmm+0x4e): undefined reference to `__cxa_guard_release'

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for "Ethernet.h"
 Used: C:\Users\Animal\Documents\Arduino\libraries\Ethernet
 Not used: C:\Users\Animal\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\libraries\Ethernet
 Not used: C:\Program Files (x86)\Arduino\libraries\Ethernet
Multiple libraries were found for "BlynkSimpleEthernet.h"
 Used: C:\Users\Animal\Documents\Arduino\libraries\Blynk
 Not used: C:\Users\Animal\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\libraries\Blynk
 Not used: C:\Users\Animal\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\libraries\Blynk
 Not used: C:\Users\Animal\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\libraries\Blynk
 Not used: C:\Users\Animal\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\libraries\Blynk
exit status 1
Error compiling for board Oak by Digistump (Pin 1 Safe Mode - Default).

Any ideas? Seems that there is some incompatibility in the updated libraries. Anyone see this before?

EDIT: So it does appear that there is something wrong with the update libraries. If I clear out my libraries and re-install the oak board, it compiles and is able to upload to my Oak, but if I update my libraries I get the above failure.

But now the iOS Blynk app says my Oak is "not online". I've triple checked my auth code and it is correct. I'm using the default "BlynkBlink" example and the only change is putting my auth code in.

EDIT2: I did a serial monitor on it and this is what I'm getting:
Code: [Select]
ˆNÌþÿÈ[5756] Blynk v0.3.7 on Oak
[5756] Getting IP...
[6057] DHCP Failed!
R)�þ
ôDã!ªˆNÌþÿÈ[4036] Blynk v0.3.7 on Oak
[4036] Getting IP...
[4337] DHCP Failed!
H!ˆÈ©1§`¦1dL@ñü[5978] Blynk v0.3.7 on Oak
[5978] Getting IP...
[6279] DHCP Failed!

My partice dashboard has my Oaks blue dot pulsing blue to grey to blue, repeat. Thoughts?
« Last Edit: July 23, 2016, 09:25:33 am by jens0771 »

DrJFM

  • Newbie
  • *
  • Posts: 31
Re: Blynk Compiling Issues
« Reply #1 on: August 01, 2016, 08:02:42 pm »
Dear jens0771,

Not sure if you have made progress, but in case not, this may help.

When the Oak is cycling on line and off line rapidly on the particle cloud, it is a moderately bad sign.  Please Post the sketch you are trying to compile and upload.  I am not sure why you should have issues with the ethernet libraries and it would help to see what your sketch lists for "#include .." statements. 

Have you tried to power up your Oak with Pin 1 grounded yet?  If not, try this and see if you see your Oak as online w the Particle cloud. 
The OAKTerm terminal at http://rawgit.com/kh90909/OakTerm/master/index.html (log on with your Particle username and password) is an easier tool to see on line status and events imho.
I would recommend using it if you get to the three rapid blink configure state by rebooting with Pin 1 grounded for the first few seconds after power up.
 -- add this line to your setup routine to allow communication with the OakTerm:
Code: [Select]
Particle.begin();  //Allows use of OAKTermNotes: the Particle cloud says flash fails when it succeeds and says it succeeds when it fails so don't worry when Particle says a flash failed
         There are almost always the two warnings with the Oak when compiling -- that it is not a ESP2866 device and that  it chose to load to the default ROM  these are expected
         If you still get the ethernet.h  or ethernet.cpp errors, move all copies of these files that are messing you up except for the ones included in the OAK libraries to a backup directory
         in some folder not on the search path for libraries (say another drive? ).  You should have everything you need in your OAK download directories (installed by Arduino board Manager)
         for me, these files are here: C:\Users\James\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.5\libraries
         move any other files that are throwing errors during compile until you use the versions in the 1.0.5\libraries folder.

Here is a tested example.  It does not need your Blynk authorization number to compile and run, but you can add it once it runs.
It will blink the LED on Pin 1 every 10 seconds -- you can't do things in the main loop hundreds of times a second while on Particle or Blynk.  You can go about once every second max.
When it is working well, then you can add a LED widget to a Blynk app, copy the authorization number into the sketch and use a push mode to a virtual pin to update the LED on the app to sync with your OAK led.  This should be something you can modify yourself once your Oak is on line, behaving well and not flooding the cloud server. 
 eg.   Blynk.virtualWrite(V6, ON);  would turn on a led widget assigned to virtual pin 6 in Blynk

You get to see the happenings on the OakTerm application and a screen capture below shows what this should be like.  It is very useful to follow a new program or when getting started to use  Particle.publish("simple text ", "Messages", 60 PRIVATE); statements to see that indeed, things are happening in the correct order and in the prescribed time intervals  -- note the 10 second timing of the LED events.
Code: [Select]
/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 * This example shows how to use Digistump Oak with Blynk.
 *
 * Please be sure to select the right board type
 * in the Tools -> Board menu!
 *
 * Change Blynk auth token to run :)
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include "SimpleTimer.h"

SimpleTimer timer;
int isLEDon = 0;    // simple variable for toggle of LED


// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

void setup()
{
  Blynk.config(auth);  // PLACE YOUR Blynk AUTHORIZATION HERE
 
  // Serial.begin(9600);
  // Oak has already configured WiFi

  pinMode(1, OUTPUT);  // this is our on board OAK led pin


  Particle.begin();  //Allows use of OAKTerm
 
  Particle.publish("Starting", " now.", 60, PRIVATE); // something to see in particle log or OakTerm
 
  timer.setInterval(10000, doLED);  // For Blynk, we use a timer set for 10 seconds to control timing
                                    // And we do our work in a subroutine called by this timer
                                    // so we don't flood the Blynk server (and get kicked off it!)
}

void doLED ()
{
  if (isLEDon == 0)
  {
    isLEDon = 1;
   digitalWrite(1, HIGH);    // turn it on
   Particle.publish("LED ", "ON", 60, PRIVATE);   // you can see these on OakTerm or using LOG on Particle Dashboard
  }
  else
  {
    digitalWrite(1,LOW);   // turn it off
    isLEDon = 0;           // toggle
    Particle.publish("LED ", "OFF", 60, PRIVATE);  // you can see these on OakTerm or using LOG on Particle Dashboard
                                                   // comment out when no longer needed or wanted on Particle cloud
  }
}
void loop()
{
  Blynk.run();
   timer.run(); // Initiates SimpleTimer  with Blynk, all work goes on outside this simple loop
}