-
-
Hi Martin,
check this out: http://forum.espruino.com/conversations/365203/#comment16079255-Maxi
-
-
https://github.com/espruino/EspruinoWebIDE/pull/254 ;)
not sure if you approve
async functions
ordestructuring
or any of the other stuff I used. Disclaimer: it's not very thoroughly tested. -
Hi Everyone,
is it correct and intended thatsetTimeout
prevents the screen to turn off, whilesetInterval
isn't?
Also there is an error in the API Reference ofsetTimeout
(http://www.espruino.com/Reference#l__global_setTimeout)If you want to stop the function from being called, pass the number that was returned by setTimeout into the clearInterval function.
I think the function
clearTimeout
is meant here. Also if my statement above is correct it would be nice to have it documented :) -
I guess you could just re-use the existing alarm code and set an alarm at the correct time?
Mh good idea, but the Alarm App would need "self destructive alarms" that remove themselves after triggering. Since the current implementation works, I will add this as an optimization to my todo list ;)
edit: Also with the planned pomodoro feature I think I need my own implementation anyways ;-(
-
So you mean if it doesn't define the area field it'll break everything? If so I could add a tweak for drawWidgets that fixes this.
Yes, my test widget didn't define the
area
(or had a faulty value) field. The default battery widget was not rendered. Did do any other tests regarding that behaviour tho. -
Hi Everyone,
a while ago I got my hands on a used Banglejs I can finally present my first project :DFeatures
Configurable Segment Time
- The images show a few examples.
- The Segments on the bottom indicate bluetooth connectivity (blue), presence of an alarm (white), low device battery (red)
Gadgetbridge Notifications
- They scroll to the left if they are to long..
Simple Timer
- It shows on "swipe left"
- Timeup notification works in all apps that load widgets
Gadgetbridge
- Find Device
- Buzz on Bluetooth connect / disconnect
- Report Batterylevel
Upcoming features
- Gadgetbridge weather
- Gadgetbridge music info/control
- Gadgetbridge incoming calls
- Configurable color palettes
- Pomodoro for timer
- The images show a few examples.
-
I think I didn't expressed it correctly:
If a widget fails to define a valid area no widget will get rendered.
What I meant is:
if a faulty widget fails to define a valid area no widgets at all will be rendered.You can always add code in appname.boot.js if you want it to run at
Will the code here also run when another app (e.g. the launcher) is loaded?
-
-
-
Hi Everyone,
theBluetooth Widget
(https://github.com/espruino/BangleApps/tree/master/apps/widbt) is creating graphic glitches in my app.The app uses
doublebuffered LcdMode
.
The Widged callsg.flip()
because it turns the screen on as a sideeffect.-Maxi
edit: The app isn't even calling
Bangle.drawWidgets()
but the Bluetooth Widget is shown. -
So I did some research. We could use the new "File System Access" API -> https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle
The WebApi would need to poll for filechanges tho. After a set interval it would check if
lastModified
of the file changed and would reload if needed.Would that solution be accepted?
-
-
-
-
Hey again,
looks like it was a bug in my implementation ;) I wasn't sure ifnotify-
was supposed to fire everytime, thats why I asked ;).For some reason my mail/calendar app is not triggering a
notify
tho. How is gadgetbridge deciding when to fire anotify
? And where can I find the impl. of the bangle.js in gadgetbridge? -
-
-
The Website where I saw it working is http://www.pokerstoker.com. Its not an Chrome Web App. It loads a HandHistory.txt file. And everytime a new hand is added to the file the view updates.
ATM I just want to code my Bangle to fit my needs, maybe after that I will take a look at the IDE :)
-
Okay, if i run the CLI with
--verbose
I get the following output:edit: I want to connect w/ bluetooth.
node node_modules\espruino\bin\espruino-cli.js --verbose 0.1.38 Espruino Command-line Tool 0.1.38 ----------------------------------- Acorn library not found - you'll need it for compiled code Found C:\Projekte\banglejs\test\node_modules\espruino/libs/targz.js Found C:\Projekte\banglejs\test\node_modules\espruino/libs/utf8.js Found C:\Projekte\banglejs\test\node_modules\espruino/espruino.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/codeWriter.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/config.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/env.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/flasher.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/flasherESP8266.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/modules.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/notifications.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_chrome_serial.js No chrome.serial - Chrome Serial disabled Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_chrome_socket.js No chrome.sockets - Chrome Socket disabled Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_frame.js serial_frame: Not running in a browser Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_noble.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_node_serial.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_node_socket.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_websocket_local.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_websocket_relay.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_web_audio.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_web_bluetooth.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_web_serial.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/serial_winnus.js 'winnus' module not found, no Windows Bluetooth Low Energy Error: Cannot find module 'winnus' Require stack: - C:\Projekte\banglejs\test\node_modules\espruino\index.js - C:\Projekte\banglejs\test\node_modules\espruino\bin\espruino-cli.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15) at Function.Module._load (node:internal/modules/cjs/loader:772:27) at Module.require (node:internal/modules/cjs/loader:999:19) at require (node:internal/modules/cjs/helpers:93:18) at eval (eval at loadJS (C:\Projekte\banglejs\test\node_modules\espruino\index.js:12:11), <anonymous>:10:14) at eval (eval at loadJS (C:\Projekte\banglejs\test\node_modules\espruino\index.js:12:11), <anonymous>:124:3) at loadJS (C:\Projekte\banglejs\test\node_modules\espruino\index.js:12:11) at loadDir (C:\Projekte\banglejs\test\node_modules\espruino\index.js:24:7) at Object.init (C:\Projekte\banglejs\test\node_modules\espruino\index.js:97:3) at Object.<anonymous> (C:\Projekte\banglejs\test\node_modules\espruino\bin\espruino-cli.js:844:24) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\\Projekte\\banglejs\\test\\node_modules\\espruino\\index.js', 'C:\\Projekte\\banglejs\\test\\node_modules\\espruino\\bin\\espruino-cli.js' ] } Found C:\Projekte\banglejs\test\node_modules\espruino/core/terminal.js Found C:\Projekte\banglejs\test\node_modules\espruino/core/utils.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/assembler.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/boardJSON.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/compiler.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/getGitHub.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/localModules.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/minify.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/pretokenise.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/saveOnSend.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/setTime.js Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/unicode.js UTF8 Library loaded successfully Found C:\Projekte\banglejs\test\node_modules\espruino/plugins/versionChecker.js Initialising CodeWriter Initialising Config Initialising Env Initialising Flasher Initialising FlasherESP8266 Initialising Modules Initialising Notifications Initialising Serial - Initialising Serial Noble Bluetooth LE - Initialising Serial Node Serial - Initialising Serial Node Socket - Initialising Serial Web Audio - Initialising Serial Web Bluetooth - Initialising Serial Web Serial Initialising Utils Initialising Status Initialising Assembler Initialising BoardJSON Initialising Compiler Initialising GetGitHub Initialising LocalModules Initialising Minify Initialising Pretokenise Initialising SaveOnSend Initialising SetTime Initialising Unicode Initialising VersionChecker Initialising CoreModules Searching for serial ports... Noble: getPorts - initialising... undefined:55 } else throw err; ^ Error: LIBUSB_ERROR_NOT_SUPPORTED at Device.usb.Device.open (C:\Projekte\banglejs\test\node_modules\usb\usb.js:38:7) at BluetoothHciSocket.bindUser (C:\Projekte\banglejs\test\node_modules\@abandonware\bluetooth-hci-socket\lib\usb.js:94:19) at BluetoothHciSocket.bindRaw (C:\Projekte\banglejs\test\node_modules\@abandonware\bluetooth-hci-socket\lib\usb.js:47:8) at Hci.init (C:\Projekte\banglejs\test\node_modules\@abandonware\noble\lib\hci-socket\hci.js:120:18) at NobleBindings.init (C:\Projekte\banglejs\test\node_modules\@abandonware\noble\lib\hci-socket\bindings.js:93:13) at C:\Projekte\banglejs\test\node_modules\@abandonware\noble\lib\noble.js:61:24 at processTicksAndRejections (node:internal/process/task_queues:78:11) { errno: -12 }
-
If it were possible to detect changes in a file using a web file API then we could make some changes and it'd be possible for you to use the Web IDE as just a terminal/upload tool for whatever editor you wanted - but it seems it isn't right now
With which browser did you test this behavior? I think I used an application a few years ago which detected changes in a textfile on disk and it only worked w/ chrome.
-
Hi Everyone,
I am trying to get the EspruinoCLI to work, but dependency Winnus (https://github.com/espruino/winnus) is not building on Windows10.I am getting a bunch of c++ errors:
npm install npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 > winnus@0.0.6 install > node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@7.1.2 gyp info using node@16.4.0 | win32 | x64 gyp info find Python using Python version 3.9.6 found at "C:\Python39\python.exe" gyp info find VS using VS2019 (16.10.31410.357) found at: gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" gyp info find VS run with --verbose for detailed information (node:12068) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only. (Use `node --trace-deprecation ...` to show where the warning was created) gyp info spawn C:\Python39\python.exe gyp info spawn args [ gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-I', gyp info spawn args 'C:\\Projekte\\banglejs\\winnus\\build\\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\\Users\\Arbeit\\AppData\\Local\\node-gyp\\Cache\\16.4.0\\include\\node\\common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=C:\\Users\\Arbeit\\AppData\\Local\\node-gyp\\Cache\\16.4.0', gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Arbeit\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.4.0\\\\<(target_arch)\\\\node.lib', gyp info spawn args '-Dmodule_root_dir=C:\\Projekte\\banglejs\\winnus', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'C:\\Projekte\\banglejs\\winnus\\build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe gyp info spawn args [ gyp info spawn args 'build/binding.sln', gyp info spawn args '/clp:Verbosity=minimal', gyp info spawn args '/nologo', gyp info spawn args '/p:Configuration=Release;Platform=x64' gyp info spawn args ] Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "-m" hinzufügen. winnus.cpp C:\Projekte\banglejs\winnus\cpp\winnus.cpp(107,3): error C2664: "v8::Local<v8::Value> v8::Exception::Error(v8::Local<v8::String>)" : Konvertierung von Argument 1 von "v8:: MaybeLocal<v8::String>" in "v8::Local<v8::String>" nicht möglich [C:\Projekte\banglejs\winnus\build\winnus.vcxproj] C:\Projekte\banglejs\winnus\cpp\winnus.cpp(107,3): message : Kein benutzerdefinierter Konvertierungsoperator verfügbar, der diese Konvertierung durchführen kann, oder der Operator kann nicht aufgerufen werden [C:\Projekte\banglejs\winnus\build\winnus.vcxproj] C:\Users\Arbeit\AppData\Local\node-gyp\Cache\16.4.0\include\node\v8.h(7469,23): message : Siehe Deklaration von "v8::Exception::Error" [C:\Projekte\banglejs\winnus\build\w innus.vcxproj] C:\Projekte\banglejs\winnus\cpp\winnus.cpp(134,113): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 2 Argumente [C:\Projekte\banglejs\winnus\build\wi nnus.vcxproj] C:\Projekte\banglejs\winnus\cpp\winnus.cpp(138,116): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 2 Argumente [C:\Projekte\banglejs\winnus\build\wi nnus.vcxproj] C:\Projekte\banglejs\winnus\cpp\winnus.cpp(139,38): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 2 Argumente [C:\Projekte\banglejs\winnus\build\win nus.vcxproj] C:\Projekte\banglejs\winnus\cpp\winnus.cpp(160,40): error C2664: "v8::Local<v8::Value> v8::Exception::Error(v8::Local<v8::String>)" : Konvertierung von Argument 1 von "v8: :MaybeLocal<v8::String>" in "v8::Local<v8::String>" nicht möglich [C:\Projekte\banglejs\winnus\build\winnus.vcxproj] C:\Projekte\banglejs\winnus\cpp\winnus.cpp(161,28): message : Kein benutzerdefinierter Konvertierungsoperator verfügbar, der diese Konvertierung durchführen kann, oder der Operator kann nicht aufgerufen we
-
There is no example code^^ The question boils down to this: If I use the
doublebuffered
mode, can I get a reference to the buffer that is currenty visible (a.k.a. the buffer that got drawn after callingg.flip()
in order to access it's contents (and then copy it to the other buffer to avoid redrawing identical parts).