-
In a project some data should be stored for later use.
My decision is to use an SD Card, to be open for a lot of data.
Problem is E.connectSDCard, I get an error message.
Somewhere in my mind is a feedback like "you have to build your own binary"
After some jumping through sources, I could see FLASHFS and FILESYSTEM.
This is where some confusions starts with different boardfiles for ESP32
First is ESP32.py having both set
Next is ESP32_IDF4.py where both are commented
And for different boards
ESP32C3_IDF4.py, both are commented
ESP32S3_IDF4.py, only FLASHFS is commentedWhat is the reason for different handling.
What should I do to build a version which supports SD Cards and runs on a standard ESP32 ?
I could use ESP32 WROVER oder WROOM and would prefer the WROVER with additional memory -
@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. -
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
Flashfs needs to be disabled to have E.connectSDCard running (see jswrap_file.c)
Comparing the comfort of having a file system for flash memory (storage), and not having the chance to use an SD Card, my winner is SD Card.
Last not least looks to me Flashfs being a special function for ESP32 only.