-
played around looks like I had to
- select device to Nordic NRF 52840 DK in the beginning
- ignore that NN stuff
- train without changes
Now I've got a file
TensorFlow Lite (int8 quantized) 22 KB
22KB is a big file for a clock
Anyway, copied this to .tfmodel and created .tfnames
reset bangle2 and checked.
I've 2 gestures (leftright and updown) leftright is recognized perfect
Updown of the clock gives leftright very often.At the end, I got something running, but I'm not really satisfied, because
- steps for EdgeImpuls are complicated, there is no way to automate this
- resulting file is very large, at least in my eyes
- gives wrong results very often
- select device to Nordic NRF 52840 DK in the beginning
-
-
-
I tried to create my own gestures. Somehow I got this in github
https://github.com/nearform/nodeconfeu-gesture-models
There is a file create_gesture_model.ipynb which I got running on COLAB
First problem was circular loading around AccelerationReader
Got rid of that by changing directory to nodeconfeu-gesture-models before importing reader and go back
Next problem was in converting to tflite, functions SPACE_TO_BATCH_ND and BATCH_TO_SPACE_ND have been unknown.
Added these commands to builtin_operator_version_support in export_tflite.py
At least I got it working this way. Training etc ran fine.
Next created .tfnames and .tflite and added a handle for aiGesture
Now I get an error Didn't find op for builtin opcode 'SPACE_TO_BATCH_ND'
Is there any idea, what to do or how to do it better ? -
-
-
-
Hmm, I tried to figure out, how to use graphicsInternal, .....
and found only something in lcd_st7789-8bit where setPixel is not set again.Next try was to add JSGRAPHICSTYPE_OTHERS in JsGraphicsType (graphics.h)
and an if-statement in graphicsSetCallbacks(graphics.c) to skip xxxSetCallbacks.
In my own driver, this worked fine, but in all functions from jswrap_graphics(for example setPixel) I've got runtime error. Looks to me like setCallback is necessary (?)My actual solution for my problem is to add a weak function for JSGRAPHICSTYPE_OTHERS, which can be overroled in my driver. My driver for ILI9341 now is much faster compared to JS-solution.
See following sources.
If this is of interest for Espruino, I would create a pull request.graphics.h:
typedef enum { JSGRAPHICSTYPE_ARRAYBUFFER, ///< Write everything into an ArrayBuffer JSGRAPHICSTYPE_JS, ///< Call JavaScript when we want to write something JSGRAPHICSTYPE_FSMC, ///< FSMC (or fake FSMC) ILI9325 16bit-wide LCDs JSGRAPHICSTYPE_SDL, ///< SDL graphics library for linux JSGRAPHICSTYPE_SPILCD, ///< SPI LCD library JSGRAPHICSTYPE_ST7789_8BIT, ///< ST7789 in 8 bit mode JSGRAPHICSTYPE_MEMLCD, ///< Memory LCD JSGRAPHICSTYPE_LCD_SPI_UNBUF, ///< LCD SPI unbuffered 16 bit driver JSGRAPHICSTYPE_OTHERS ///< Driver that support callbacks only } JsGraphicsType; bool graphicsSetCallbacksOthers(JsGraphics *gfx);
graphics.c:
/// Set up the callbacks for this graphics instance (usually done by graphicsGetFromVar) __attribute__((weak))bool graphicsSetCallbacksOthers(JsGraphics *gfx){ return false; } bool graphicsSetCallbacks(JsGraphics *gfx) { if(gfx->data.type >= JSGRAPHICSTYPE_OTHERS){ return graphicsSetCallbacksOthers(gfx); }
Last not least in myOwnDriver.c:
bool graphicsSetCallbacksOthers(JsGraphics *gfx){ gfx->setPixel = myOwnCallbackSetPixel; gfx->fillRect = myOwnCallbackFillRect; return true; }
-
-
-
@SimonGAndrews
Good news- got a pico w
- got it connected from Espruino to my wireless
Bad news - don't get my hands on a http-server. There is a first step in Github, but my understanding is poor. My way right now is a mix of trial/error and copy/paste
BTW, Gordon already offered to help changing from cmake to espruino like make, once the port is kind of stable. For me this port is having some fun, don't have to make money for the family.
- got a pico w
-
Well.. could be me ;-)
May be, this can help for audio output http://forum.espruino.com/conversations/363093/#comment15963863
I used it for some simple speech, but it can be used for sound, music etc.
last not least its cheap. -
@TheLogan
are there any news (even bad news) about your talking hat ? -
-
Save the module in Storage.
See more here http://www.espruino.com/Modules#from-storage -
@fanoush, based on your comments I changed adressing.
Flash.getFree now returns real address in Flash.
Flash.erasePage, .read and .write also use real address and are recalculated to match API
Sideeffect: found and fixed a problem in jshWriteFlash and got save() running.BTW, interest in this port is not really overwhelming ;-)
-
-
@fanoush, thanks for feedback.
Advantage in my eyes is handling of flash.
Moving calculation of real addresses in flash from Firmware to each Javascript project adds burden to the user.
I'm pretty sure only a few guys will know XIP-address, or are willing to search for
Anyway, I don't see the reason for this test.
IMHO testing for negative numbers would be a good solution. -
Some weeks ago, I started a project to get Espruino running on PI Pico (RPI2040)
I had no idea how to do, but gave it a try.
Target was, not to change Espruino code itself, no additional ifdef etc.
Right now I'm somewhere around pre-alpha. Simple version is running.
Development is based on pico-examples, not on Espruino make
https://github.com/jumjum123/Espruino4PicoAs expected tons of problems/question are on the road.
In my implementation flash starts at virtual addr 0, which is translated to 2nd MB in flash
This makes Flash-commands easy to understand. Require("flash") runs fine.
Actual problem, one of a lot is jsfGetFileHeader.
Unfortunally addr is tested with this line: if (!addr) return false which stops some other functions.
Any idea, how to get around without changes in jsflash.c ?BTW, if some body wants to help in this project, you are welcome.
-
Just checked an idea for "format only the selected code" in my environment.
At the end it is extremly easy to implement.
Should be similiar for prettiervar code = Espruino.Core.EditorJavaScript.getCode(); var selected = Espruino.Core.EditorJavaScript.getSelectedCode(); if(selected) code = code.replace(selected,js_beautify(selected,options) + "\n"); //had to add linefeed for beautify, don't know wether prettier needs this else code = js_beautify(code,options); Espruino.Core.EditorJavaScript.setCode(code);
-
@neshanjo great to see what you did. Your point of adding setCursor, great idea.
Looking forward to see a pull request for github ;-)Thanks for your nice feedback. Applause is what keeps artists going ;-)
Beautifier was the first I used and it worked.
At the end, using prettier or beautify does'nt matter (to me).
BTW, could it be an option/help/possible to use prettier for selected code only ? -
@MaBe
thanks but it would need some more work.
For example:- add settings page
- add options based on settings
- is there a better tool, prettier for example ?
- find a better icon
My intention was to give a starting point ;-)
- add settings page
-
@neshanjo
A simple example how to add a formatter.
I used beautifier, because its so easy to add.
And it does not need an internet connection.
Steps:- add a file to js/plugins with following code
- add a script tag in main.html to the new plugin
- add beautify folder in js/libs
- add beautify-file from github into this new folder
add script tag in main.html to beautify-file
"use strict"; (function(){ var iconFolder; function init() { showIcon(); } function showIcon(){ iconFolder = Espruino.Core.App.addIcon({ id: 'formatCode',icon: 'snippets',title: 'Prettyfie',order: 510, area: { name: "code",position: "top"}, click: prettyfie }); } function prettyfie(){ var code = Espruino.Core.EditorJavaScript.getCode(); code = js_beautify(code); Espruino.Core.EditorJavaScript.setCode(code); } Espruino.Plugins.FormatCode = { init : init, }; }());
```
- add a file to js/plugins with following code
-
Implementation of BLE on ESP32 became incomplete.
Know this because most of it was done by me.
Espressif changed ESP-IDF and specially BLE a lot with each new (sub) version.
Last not least there was no support by Espressif for Espruino over the years.
Therefore my decision was to concentrate on other targets.
@Ganblejs
AFAIK, data is loaded to memory which takes away a lot of vars. Correct me, if I'm wrong.
And I would like to have some more complex gestures.
For example lift the arm and draw a right circle, something like lifting umbrella by tourist guides.
My expectation for complex gestures is much larger file compared to the simple UpDown, LeftRight in my example.
Last not least, if I compare size of EdgeImpuls with nodeconfeu, size of nodeconfeu file is about 30%. Even compared with an JS building, which has 14kb for Keras Model, its a lot.