Hi everyone,
Here are 4 issues that I have found when trying to compile my first Oak blink code and upload to my device - I have solutions to some of the issues (details below to help others hitting same problems and get folded into the code in due course) - because the uploader cannot find the particle config.json, I have not yet been able to upload my code to my device.
My environment:
- MacBook Pro running OSX 10.11.2 (El Capitan)
- Arduino IDE 1.6.7
These issues were encountered when compiling for the first time following the initial tutorial at
http://digistump.com/wiki/oak/tutorials/arduinoThe setup of the Oak device and connection to Particle has worked perfectly - the firmware appears to have updated.
Note - to differentiate the blink slightly from the default blink I see on the device, I have modified the blink code, so that the on time is much shorter than the off time, otherwise the code is as listed:
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(1, OUTPUT); //LED on Model A
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(1, HIGH); // turn the LED on (HIGH is the voltage level)
Particle.delay(250); // wait for a tenth second
digitalWrite(1, LOW); // turn the LED off by making the voltage LOW
Particle.delay(1000); // wait for a second
}1. First compilation attempt failed with:"/Users/apowell/Library/Arduino15/packages/digistump/tools/esptool2/0.9.0/esptool2" -quiet -bin -boot2 -4096 -iromchksum "/var/folders/9s/c2psyzzd6g73bn_7kth3cqvm0000gn/T/buildda9acfd3e334df2868c83c8c224f82f1.tmp/oak_blink.ino.elf" "/var/folders/9s/c2psyzzd6g73bn_7kth3cqvm0000gn/T/buildda9acfd3e334df2868c83c8c224f82f1.tmp/oak_blink.ino.bin" .text .data .rodata
fork/exec /Users/apowell/Library/Arduino15/packages/digistump/tools/esptool2/0.9.0/esptool2: permission denied
Error compiling.FIX: From command prompt,
cd ~/Library/Arduino15/packages/digistump/tools/esptool2/0.9.0/
chmod 755 esptool22. Recompiling then failed with the following:Sketch uses 254,820 bytes (24%) of program storage space. Maximum is 1,040,368 bytes.
Global variables use 50,710 bytes (61%) of dynamic memory, leaving 31,210 bytes for local variables. Maximum is 81,920 bytes.
/Users/apowell/Library/Arduino15/packages/digistump/tools/oakcli/0.9.0/oak /var/folders/9s/c2psyzzd6g73bn_7kth3cqvm0000gn/T/buildda9acfd3e334df2868c83c8c224f82f1.tmp/oak_blink.ino.bin
java.io.IOException: Cannot run program "/Users/apowell/Library/Arduino15/packages/digistump/tools/oakcli/0.9.0/oak": error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:11)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:123)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:167)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.Sketch.upload(Sketch.java:1178)
at processing.app.Sketch.exportApplet(Sketch.java:1152)
at processing.app.Sketch.exportApplet(Sketch.java:1124)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2430)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 11 moreSo, now the compiler appears to have succeeded, but was unable to run oakcli
FIX: From command prompt,
cd ~/Library/Arduino15/packages/digistump/tools/oakcli/0.9.0/
chmod 755 oak3. Error when trying to find the configuration file:"/Users/apowell/Library/Arduino15/packages/digistump/tools/esptool2/0.9.0/esptool2" -quiet -bin -boot2 -4096 -iromchksum "/var/folders/9s/c2psyzzd6g73bn_7kth3cqvm0000gn/T/buildda9acfd3e334df2868c83c8c224f82f1.tmp/oak_blink.ino.elf" "/var/folders/9s/c2psyzzd6g73bn_7kth3cqvm0000gn/T/buildda9acfd3e334df2868c83c8c224f82f1.tmp/oak_blink.ino.bin" .text .data .rodata
Sketch uses 254,820 bytes (24%) of program storage space. Maximum is 1,040,368 bytes.
Global variables use 50,710 bytes (61%) of dynamic memory, leaving 31,210 bytes for local variables. Maximum is 81,920 bytes.
/Users/apowell/Library/Arduino15/packages/digistump/tools/oakcli/0.9.0/oak /var/folders/9s/c2psyzzd6g73bn_7kth3cqvm0000gn/T/buildda9acfd3e334df2868c83c8c224f82f1.tmp/oak_blink.ino.bin
Config file not found at: undefined\oak\config.json - please run the oak tool from the command line with no arguments to configure.So this is looking good - compilation seems to have worked, just now unable to run the oak tool - it is mentioned in the tutorial that you need to run the oakcli one-time to set up the Particle credentials, so ran the oakcli tool from the version I had installed i.e. at:
~/Library/Arduino15/packages/digistump/tools/oakcli/0.9.0/oakI was prompted for Particle username/password and selected my device from the list - the configuration was written:
Adrians-MBP:0.9.0 apowell$ ./oak
Particle Username/Email:particle.io@xxxx.xx.xx
Particle Password:************
[1] Unnamed Device (Device ID: )xxxxxxxxxxxxxxxxxxxx77f6
Which device would you like to use? [1/0] :1
Configuration saved. You can now use this tool to upload files to your device.4. Re-compiling and uploading then gives the following - still saying config not found:Sketch uses 254,820 bytes (24%) of program storage space. Maximum is 1,040,368 bytes.
Global variables use 50,710 bytes (61%) of dynamic memory, leaving 31,210 bytes for local variables. Maximum is 81,920 bytes.
/Users/apowell/Library/Arduino15/packages/digistump/tools/oakcli/0.9.0/oak /var/folders/9s/c2psyzzd6g73bn_7kth3cqvm0000gn/T/buildda9acfd3e334df2868c83c8c224f82f1.tmp/oak_blink.ino.bin
Config file not found at: undefined\oak\config.json - please run the oak tool from the command line with no arguments to configure.I notice now that the path that the tool is using is undefined\oak\config.json - this looks to be the issue, but not yet found a solution - doing a find across my whole system does not find an config.json file.
Does anyone have any ideas on the last issue?