digistump / oakcli Goto Github PK
View Code? Open in Web Editor NEWOTA Upload tool for Oak and the Particle Cloud
OTA Upload tool for Oak and the Particle Cloud
Reading this: http://digistump.com/wiki/oak/tutorials/arduino
Download:
Due to usage of readlineSync.keyInSelect() to display the device list and get input, Particle accounts having more than 32 devices will cause OakCLI to crash, as readlineSync.keyInSelect() has a limit of 35 entries. Some processing needs to be added to split the device list into more management chunks, which should then mitigate the issue.
The compiled exe will throw the following message
nexe.js:43674
{ throw '`items` must be Array (max length: 35).'; }
^
`items` must be Array (max length: 35).
Whereas the source run through node will throw the following (similar) message:
C:\Users\Peter\Desktop\OakCLI\node_modules\readline-sync\lib\readline-sync.js:1263
throw '`items` must be Array (max length: 35).';
^
`items` must be Array (max length: 35).
http://digistump.com/board/index.php/topic,2489.msg11969.html#msg11969
Greetings,
I just wrestled with building this for probably an hour. Would you kindly take a look at my observations/experience and consider updating the documentation if they're legitimate? I don't use nodejs
, so I'm not sure if I just missed something obvious or if there are actually some missing steps in your procedure.
I'm using arch linux so the contents of build-essential
are not known to me. Since I have general make tools installed, I assumed I was good. While Ubuntu is obviously quite common, it would be nice to list out what's required for other distros.
Install of nexe
went fine, but upon running nexe -r 0.12.10 -i ./oak.js -o ./oak
, I kept getting errors about missing modules. Being a noob, I just relied on the npm install -g nexe
command to install the module named in the error (readline-sync
, spark
, ...) and re-run the nexe
command. Through this cycle, it would return to complaining about a previous module I'd installed (couldn't find readline-sync
, so I'd install it with npm install -r ...
, then complain about spark
, install that, and then back to saying it couldn't find readline-sync
). In digging around I found the linux_build.sh
script and saw that it didn't feature the -g
option (and also I saw the general npm install
which I guessed pulled in everything in one shot). Running that (npm install
) worked. I'm sure you're aware of this, but I'm writing it out as it might not be obvious to others.
Are you aware of how other distributions install python
? For example, is it typically installed with symlinks to python2
and/or python2.x
? On arch linux, python
defaults to python3
, so I got a bunch of barf about print
statements not being valid. I tried hunting around for any #!/usr/bin/python
commands to change them to /usr/bin/python2
, but couldn't seem to track them all down. I ended up just deleting the default /usr/bin/python
symlink and re-creating it to point to python2
.
Now that I write all of that, it really doesn't seem like much but I promise it was a headache! I thought I'd note my experience here in case it can help others or serve to improve the documentation. I'd be happy to add something like a troubleshooting
or other distros
section to README.md
if you'd want any help with the docs?
i'm working on it
After upgrading to 0.9.3, kept getting Config file not found at: /home/(my home dir)/.oak/config.json. Confirmed the file was writing successfully, logging in fine.
Finally tracked down that the IDE on my system was calling it at:
~/.arduino15/packages/digistump/tools/oakcli/0.9.3
Even tried the latest oak-linux-64 binary from #1
(https://github.com/digistump/OakCLI/files/128755/oak-linux-x64.zip) same issue.
Replaced ~/.arduino15/packages/digistump/tools/oakcli/0.9.3/oak binary with old copy, message doesn't show issue, confirmed upload works after replacing bin.
Builds clean with nexe - if anyone has a chance to build on these platforms and upload it would be much appreciated.
Install node.js
Install python
"npm install -g nexe"
Download this repository, cd to it
"npm install"
"nexe -i ./oak.js -o ./oak"
Upload executable here
With the OakCLI 1.0.0 I get this
Logging in to Particle...
No devices available.
Press enter to exit.
With OakCLI 1.0.2 I get this
Logging in to Particle...
nexe.js:43520
if(err.code !== undefined){
^
TypeError: Cannot read property 'code' of null
at nexe.js:43520:13
at Spark.emitAndCallback (nexe.js:31377:42)
at null. (nexe.js:31505:10)
at Request.self.callback (nexe.js:28860:22)
at Request.emit (events.js:110:17)
at Request. (nexe.js:29697:10)
at Request.emit (events.js:129:20)
at IncomingMessage. (nexe.js:29624:12)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
I really want to use my oaks. Why am I getting these errors? I'm on OSX 10.11.4 and my oak has a local IP address.
I get this error when I run ./0.9.1/oak on my system:
./0.9.1/oak: /usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./0.9.1/oak)
It looks like it's compiled for a different version of glibc than I have.
$ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17.2
DISTRIB_CODENAME=rafaela
DISTRIB_DESCRIPTION="Linux Mint 17.2 Rafaela"
$ dpkg -l | grep libstdc
ii libstdc++6:i386 4.8.4-2ubuntu1~14.04.1 i386 GNU Standard C++ Library v3
I got final 6 OAKS today.
I assume I did the right URL to rawgit - it was stored in my phone, did a timeout countdown to allow the update to complete?
I've got a few minutes again - I'll go through the six and see if they are powering up as ACORN_XXX or joining the network?
Using OakCLI 1.0.0 on Max OS X 10.11.4
Logging in to Particle...
nexe.js:42967
if (config.devices[activeDeviceIndex].device_name !== undefined && activ
^
TypeError: Cannot read property '-1' of undefined
at nexe.js:42967:25
at Spark.emitAndCallback (nexe.js:31179:42)
at null. (nexe.js:31307:10)
at Request.self.callback (nexe.js:28662:22)
at Request.emit (events.js:110:17)
at Request. (nexe.js:29499:10)
at Request.emit (events.js:129:20)
at IncomingMessage. (nexe.js:29426:12)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
I thought maybe there was an old /home/user/.oak/config.json but I couldn't find anything. I then rebuilt the file from source and had the same error.
With nodeJS don't use double quote (") for text, only single quote.
I have a pull request ready but, my oak seem to be dead and i cannot test for now (i will reset oak when i will back to home).
Other changes :
Remark : keep the content test for 'spark/flash/status' message because you can have a failed here, not always success (i saw this message only once in the particle dashboard).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.