kaluma-project / kaluma-cli Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Hello, I'm trying to use the brain.js module with my Pi Pico, but when I try to flash it, it gets stuck and eventually says "Verification failed." Is there anything I can do to fix this?
Time required to re-recognize serialport after changed to firmware update mode (.firmup
).
But the time is varying from time to time, so try to open the serial port multiple times (e.g.: x10 for every 2 seconds).
Check:
https://www.raspberrypi.org/forums/viewtopic.php?f=144&t=304964&p=1842576&hilit=javascript#p1842576
Maybe serialport
module not works in ARM architecture
Allows port query with VID and PID for --port
option.
$ kaluma flash --port <port-or-query>
# allows port path (/dev/tty*, COM*) or port query (@<vid> or @<vid>:<pid>)
# default: @2e8a (Raspberry Pi's VID)
Port name is changed when rebooting in firmware update mode (COM3 --> COM4).
CLI and firmware should be enhanced to meet the follows:
Try to copy package.json
to Kameleon.
It will not report error, but empty string returns when try to read source at terminal. (process.readSource('/usr/package.json')
).
No prebuilt binaries were found (NodeJS v18.12.1 / Windows 11 build 22621.1265)
Wasn't able to build with VS 2022 and Win11 SDK
After installing Win10SDK_10.0.20348 in Visual Studio, I was able to npm install @kaluma/cli
successfully.
Looks like this is related to the NPM serialport dependency.
error C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.22000.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\jd\Projects\MemCard2040\node_modules\@serialport\bindings\build\bindings.vcxproj]
I would like to start an effort to build a node interface for Kaluma CLI. I am thinking about working on a pull request, feel free to add any ideas to how to achieve this.
A node interface allows you to bypass the usual cli tool and automate it with a script. Examples include:
Basically, rather than using the typical cli tool, one could write a script that would do everything. For example, My current workflow involves bundling with esbuild and then using kaluma to do things like load the main file, making sure everything is working / connected, etc. Automating this would be quite interesting and useful.
Nothing much! Just a way to interact with it from a node script. Having both the cli and the interface would allow for a great workflow & productivity.
See oven-sh/bun#5789 . I think we need to pin the latest node-serialport
(12.0.0+) but can't get it to fully work yet.
Allow shell connecting to a serial port. Redirect serial to/from standard I/O.
$ kaluma shell --port <port>
Issued by @einrock.
Running .ls
shows no files, and .pwd
shows we're in root. Where is the usercode which is sent to the Pi Pico via kaluma flash -w
stored?
If putting MicroPython on the Pi Pico, the usercode is stored in main.py
in the root. It would be very useful if Kaluma did something similar (suggest index.js
instead). The .ls
command etc would then make more sense.
I'm asking because I'm thinking of flashing files to Kaluma in a similar way to how it works with MicroPython, which is much quicker!
Try https://www.mathsuniverse.com/pico for Kaluma JS and https://www.mathsuniverse.com/pico/python.html for Python. Try flashing a file with both and note how much quicker it is with Python.
With Kaluma JS, the file is sent using a ymodem implementation. With MicroPython, raw repl mode is entered and the code is just pasted in, then saved to main.py
by MicroPython itself, then a command is then sent to soft-reset.
So I'm thinking if the usercode is stored in the repl-accessible folder as index.js
then we could use a similar method, using fs = require('fs')
etc. The ymodem implementation could then be deprecated. My guess is that this would be much faster as well, like it is with MicroPython.
I tried to update firmware using the below command in windows 10 PC
"kameleon update kameleon-core.bin -p COM6"
It showed "Updating firmware..." message but there's no progress any more.
it works if Kameleon Core is in FW upload mode (tune on with pressing BTN0)
$ kaluma ports
$ kaluma flash [options] <file>
--port, -p
--bundle, -b # bundle before flash
--no-load, # skip .load after flash
--minify, -m # bundle option
--sourcemap, -s # bundle option
$ kaluma erase [options]
--port, -p
$ kaluma bundle [options] <file>
--output, -o
--minify, -m
--sourcemap, -s
$ kaluma put [options] <src> <dst>
--port, -p
$ kaluma get [options] <src> <dst>
--port, -p
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.