Small sketch that works fine in the web IDE, but I've spent the better part of today setting up VSCode and P. Workbench (and reading tutorials and watching tutorials), but I can't seem to get past the following error. I've rebuilt the environment a couple of times and done a "Clean". I've tried with both the latest firmware as well as an older one, but the results remain the same. I've tried using both a .cpp and .ino extension, which causes differences in the compilation, but still throws the same errors. I see the error regarding CellularHelper.o, but no clue as to why this is being thrown. What am I missing?
Executing task in folder AQI_Boron_Project: make -f '/Users/Chuck_Allen/.particle/toolchains/buildscripts/1.9.2/Makefile' compile-user -s <
:::: COMPILING APPLICATION
Creating /Users/Chuck_Allen/Dropbox/Arduino/#Capstone/#Boron_Code/AQI_Boron_Project/target/2.0.0-rc.4/boron/platform_user_ram.ld ...
arm-none-eabi-gcc: warning: /Users/Chuck_Allen/Dropbox/Arduino/: linker input file unused because linking not done
/Users/Chuck_Allen/.particle/toolchains/gcc-arm/9.2.1/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ar: ../build/target/user/platform-13-m/AQI_Boron_Project/CellularHelper/src/CellularHelper.o: No such file or directory**
make[3]: *** [../build/target/user/platform-13-m/AQI_Boron_Project/libuser.a] Error 1
make[2]: *** [user] Error 2
make[1]: *** [modules/boron/user-part] Error 2
make: *** [compile-user] Error 2
The terminal process "/bin/bash '-c', 'make -f '/Users/Chuck_Allen/.particle/toolchains/buildscripts/1.9.2/Makefile' compile-user -s'" terminated with exit code: 2.
For me this seems to work (in Windows and WSL2/Ubuntu)
What I did
Particle: Create New Project
select the correct platform (boron) and target version (deviceOS@2.0.0-rc.4) via the status bar
(can also be done via Particle: Configure Project for Device)
Particle: Install Library -> CellularHelper
copy code from lib/CellularHelper/Examples/1-simple/1-simple.cpp to the projectās .ino file in src
AFAIK there are many times in the internal Makefiles where the build path is used unescaped, having issues with paths containing spaces and mangling non-ascii characters. Since # would signify a comment, Iām willing to bet your path was improperly interpreted by the Makefiles.
Could you try using your dropbox folder but not have any #ās in the project name or the path?
Now that you mention it⦠I ran up against this a couple of years ago - different issue though, but the solution was eliminating (or escaping - canāt remember which) the #-signs. Iāll bet youāre right. I can test it later as Iāve now got a different problem, which I will add onto here for now.
I was successful in uploading via local USB, but the Boron got into some weird state and since then, Iāve spent two hours trying to get it back to normal⦠I have a blinking blue, no matter what I try. I can do a local Flash though, but it wonāt do anything after the āsuccessfulā message. I can run Particle Identify and I get the right stuff back. I wrote a simple script to do nothing but connect to the cloud, but it never even gets to my Serial.print commands⦠Iāve tried the button reset and āparticle flash --usb tinkerā in DFU mode (success), but all I end up with is a blinking Blue light (listening mode). Code follows:
#include "Particle.h"
#define EXPIRED_TIMER(tmr) (millis() >= tmr)
#define SET_TIMER(tmr, dur) (tmr = millis() + dur)
#define _SECONDS (1000)
uint32_t cxnFailedTimer = 0;
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Connect to Particle Cloud
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bool connectToCloud()
{
Particle.connect();
SET_TIMER(cxnFailedTimer, (10 * _SECONDS));
while (!Particle.connected() && ! EXPIRED_TIMER(cxnFailedTimer))
{
Particle.process();
}
if(Particle.connected())
{
return true;
} else {
return false;
}
}
void setup() {
Serial.begin(115200); // Opens up a Serial port
waitFor(Serial.isConnected, 5000); // Waits 5 seconds for it
Serial.print("Initializing.....\n");
Cellular.on();
if(connectToCloud())
{
Serial.print("Init:\tCloud connection successful\n");
} else {
Serial.print("Init:\tCloud connection Failed. Retrying.......\n");
if(!connectToCloud())
{
Serial.print("Init:\tCloud connection Failed after retry\n");
}
}
}
// loop() runs over and over again, as quickly as it can execute.
void loop() {
// The core of your code will likely live here.
}
The āsetup-doneā command workedā¦ā¦ā¦
Iāll add this to my notes for how to recover from various states.
The waitFor throws errors.
It doesnāt seem to like the 10s. When I changed it to 10000, it compiled fine.
/Users/Chuck_Allen/Developer/ParticleProjects/InitProject/init_01/src/init_01.ino:18:23: error: āclass CloudClassā has no member named āisConnectedā; did you mean ādisconnectedā?
18 | waitFor(Particle.isConnected, 10s);
We are replacing the Adafruit FONA with the Boron in a large Air Quality reporting network here in Central Oregon.
The Boron and the Particle Cloud provide a far superior way to implement for cellular, once I get past all these teething issues.
Iāve developed for Arduino platform devices for years, but the Particle devices, although similar, certainly have their own universe of behaviors.