With this new branch subdomain I can provide cooler, shorter, and secure download links, like the new install script, which is available at https://master.po-util.com/install.
To install po-util on macOS or Linux you can now run the following to use the install script to automatically download the correct po-util version for your operating system:
I've also been making many improvements recently and I would recommend joining the po-util community on gitter to directly engage in discussing the development of po-util.
I’ve addressed my feature request for particle-cli and now made it a feature of po-util. Using the following function, po-util will attempt to find the URL of a library, and if it is a github link it will ask you if you’d like to download the library repository using git instead of downloading a release with particle-cli:
Here is how/where getLibURL is actually used within po-util when downloading a library:
getLibURL "$LIB_QUERY"
if ( echo "$LIBURL" | grep "github" ) > /dev/null ;
then
green_echo "$LIB_QUERY is availiable on GitHub!"
read -rp "Would you prefer to download it this way? (yes/no): " answer
if [ "$answer" == "yes" ] || [ "$answer" == "y" ] || [ "$answer" == "Y" ];
then
echo
cd "$LIBRARY"
git clone "$LIBURL" "$LIB_QUERY"
echo
blue_echo "Downloaded $LIB_QUERY from GitHub."
return 0
fi
echo
fi
There is still more to be done with po-util and I plan to work on it a lot more this summer.
There is a front end of sorts. If you use Atom you can use the keyboard build shortcuts po-util generates for you or add your own on a per project basis. Po-util is open source so feel free to make any suggestions or contributions. I’d like to create a more end user friendly front end for po-util if there was demand for it.
For device dependent commands the device type comes before the option, so it would be po duo dfu
Once you have made a project with:
po duo init PROJECT_NAME
cd PROJECT_NAME
You should be able to run commands like:
po duo build
Update:
@ParticleIce, based on that error message it looks like you are using an older version of po-util, possibly before I fully added duo support. I would highly recommend updating via reinstallation or by running:
po update
Did you install po-util using Homebrew?
Also, are you running po-util on macOS or on Linux?I checked your post history and you are likely on macOS. Recently po-util has not been able to build firmware for duo on linux and I have no idea why, but everything works fine on macOS.
Well considering the reason it is faster (by a fraction of a second) is because there isn’t any NodeJS overhead I don’t know how I could merge my bash scripting into NodeJS.
I’m also terrible at NodeJS and wouldn’t know where to start with contributing to particle-cli.
text data bss dec hex filename
5148 8 2616 7772 1e5c /Users/mac/downloads/po-util/someProject/bin/firmware.elf
../build/platform-id.mk:72: *** "Unknown platform: duo. Stop.
$ po duo dfu
Device not found!
Your device must be connected by USB.
$ dfu-util -l
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Deducing device DFU version from functional descriptor length
Found Runtime: [05ac:8215] ver=0208, devnum=5, cfg=1, intf=3, path="250-1.1.1", alt=0, name="UNKNOWN", serial="78CA3xxxxxxxx"
Found DFU: [2b04:d058] ver=0250, devnum=5, cfg=1, intf=0, path="253-1.3", alt=2, name="@Serial Flash /0x00000000/192004Kg,128004Kg,64004Kg,128004Kg", serial="1C005200095xxxxxxxxxxxxx"
Found DFU: [2b04:d058] ver=0250, devnum=5, cfg=1, intf=0, path="253-1.3", alt=1, name="@DCT Flash /0x00000000/01016Kg", serial="1C0052000951353338363332"
Found DFU: [2b04:d058] ver=0250, devnum=5, cfg=1, intf=0, path="253-1.3", alt=0, name="@Internal Flash /0x08000000/02016Ka,02016Kg,01064Kg,07*128Kg", serial="1C005200095xxxxxxxxxxxxxx"
node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/bin/node',
node-pre-gyp verb cli '/usr/local/lib/node_modules/serialport/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli 'install',
node-pre-gyp verb cli '--fallback-to-build' ]
node-pre-gyp info using node-pre-gyp@0.6.32
node-pre-gyp info using node@6.9.1 | darwin | x64
node-pre-gyp verb command install
node-pre-gyp info check checked for "/usr/local/lib/node_modules/serialport/build/Release/serialport.node" (not found)
node-pre-gyp http GET https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v48-darwin-x64.tar.gz
node-pre-gyp http 200 https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v48-darwin-x64.tar.gz
node-pre-gyp info install unpacking .deps/
node-pre-gyp info install unpacking .deps/Release/
node-pre-gyp info install unpacking .deps/Release/obj.target/
node-pre-gyp info install unpacking .deps/Release/obj.target/serialport/
node-pre-gyp info install unpacking .deps/Release/obj.target/serialport/src/
node-pre-gyp info install unpacking .deps/Release/obj.target/serialport/src/serialport.o.d
node-pre-gyp info install unpacking .deps/Release/obj.target/serialport/src/serialport_poller.o.d
node-pre-gyp info install unpacking .deps/Release/obj.target/serialport/src/serialport_unix.o.d
node-pre-gyp info install unpacking .deps/Release/serialport.node.d
node-pre-gyp info install unpacking obj.target/
node-pre-gyp info install unpacking obj.target/serialport/
node-pre-gyp info install unpacking obj.target/serialport/src/
node-pre-gyp info install unpacking obj.target/serialport/src/serialport.o
node-pre-gyp info install unpacking obj.target/serialport/src/serialport_poller.o
node-pre-gyp info install unpacking obj.target/serialport/src/serialport_unix.o
node-pre-gyp info install unpacking serialport.node
node-pre-gyp info tarball done parsing tarball
node-pre-gyp info validate Running test command: '/usr/local/bin/node --eval 'require('/usr/local/lib/node_modules/serialport/build/Release/serialport.node')''
[serialport] Success: "/usr/local/lib/node_modules/serialport/build/Release/serialport.node" is installed via remote
node-pre-gyp info ok
serialport@4.0.7
node-pre-gyp@0.6.36
npm@5.0.3
particle-cli@1.22.0
updated 4 packages in 52.408s
Thank you for installing po-util. Be sure to check out https://po-util.com
if you have any questions, suggestions, comments, or problems. You can use
the message button in the bottom right corner of the site to send me a
message. If you need to update po-util just run "po update" to download
the latest versions of po-util, Particle Firmware and particle-cli, or run
"po install" to update all dependencies.
po duo update
This command can only be used to update the system firmware for
photon, P1, electron, or duo.