-
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. -
Defining the property would loose documentation.
And it would not be available in jswrapper.c, whatever this means at the end.
AFAIK, calling jswrap_object_defineProperty expects a JS function for get/set, correct ?
Let me give another example, getPixel and setPixel, myGraphics.pixel(x,y) = newColor and var pixelcol = myGraphics.pixel(x,y) , how can I do this ?
At the end, there are lot of ways to do this, but to me it looks more elegant to set/get :-)Line 452 in jswrap_object.c has this in JSON-definition for defineProperty
And it takes its way to reference you sent, see note at the end
Note: configurable, enumerable, writable, get, and set are not implemented and will be ignored. -
To take Graphics as an example only.
My intention is not to change Graphics. But in myownClass it would be nice to have.
We have functions to set bgColor and to get bgColor.
Is there a way to define a writeable property in jswrap_xxx file ?
So instead of using myGraphics.setBgColor(newColor); it would be myGraphics.BgColor = newColor;
And instead of var x = myGraphics.getBgColor(); it would be var x = myGraphics.BgColor;
Following API-description for Object.defineProperty, writeable and get/set are not supported.
Hmmm, but in jswrap_object_defineProperty get and set are used to create getter and setter -
Could this be something for you ?
http://forum.espruino.com/conversations/363093/#comment15963863 -
Take a closer look at this:
http://www.espruino.com/Extending+Espruino+2
http://www.espruino.com/Extending+Espruino+1another example how to build extensions is here
https://github.com/jumjum123/EspruinoExtensions/tree/master/General/LEDBoard
There are some unusual args used for make -
-
-
-
strange behaviour with color.
With source below, text is blue and rect is green
Looks like drawString expects color from 1 to 8 and drawRect expects 0 to 7require("Font8x16").add(Graphics); var grf = Graphics.createArrayBuffer(128,32,4,{interleavex:true}); grf.setBgColor(0); grf.clear(); grf.setFont("8x16",size); grf.setColor(2); grf.drawString("my test",10,5);´ grf.drawRect(0,20,127,24);
-
Modul is this
https://de.aliexpress.com/item/32666340925.html?spm=a2g0s.9042311.0.0.38ad4c4dMBzc5s
I've no idea about the chip itself.
Manual is here
https://cdn.instructables.com/ORIG/FGT/H5J3/IUKEZCYF/FGTH5J3IUKEZCYF.pdf -
-
Yes, its just the sending.
It's 3 to 6 times faster, depending on board.
EspruinoBoard still has to set bit by bit, correct me if I'm wrong.
ESP32 and mdbt42q sets register for 32 ports.I'm creating my own build, see https://github.com/jumjum123/EspruinoExtensions/blob/master/General/LEDBoard/makeESPRUINOBOARD.sh
Executing in an interrupt, this might help for ESP32. There I have a delay from time to time as I can see with logicanalyzer. Will take some time, but I will check this.
This does not happen with your boards, at least I never found. -
Some time ago, Gordon added some functionality to espruino which coud be used to control LED Panels.
Today some more panels, up to 128x64 are available for low money. Badly, they need 4 times the data of a 64x32 panel, and we reach a limit what can be done with Espruino itself.
Therefore I gave it a try to add new commands, written in C. Tested and running are versions for Espruino Board, ESP32 and MDBT42Q.
Status is "kind of working for me"
https://github.com/jumjum123/EspruinoExtensions/tree/master/General/LEDBoard
There are some problems with a few flickering pixels. Second problem is powersupply, my old one is working fine, but all I bought last months cause extremly flickering. -
In a maker magazin I found some ideas how to create a speech output.
To me it looked complex and expensive in terms of power, money etc.
So I created my own solution.
At the end its a small and cheap MP3 board which holds short mp3 files and is controlled by Espruino. Actual status is "working fine for me".
See more on github https://github.com/jumjum123/EspruinoExtensions/tree/master/Javascript/text2speech -
got it running at the end (HIP HIP HURRAY)
IMHO at the end its all about PYTHON version hell. No idea, why python3.6 did not accept nrfutil 6.1.0. Testing with TensorFlow and Opencv might have been the root of problems
I'm pretty sure people with more knowhow around python could explain. People like me, that want to compile Espruino only, have to walk through dessert to find some water_This is my way to find water:
- installed python3.8
- added an alias for python to python3.8 in .bashrc for user espruino
- logged out and logged in again
- installed pip with python -m pip install pip did this because pip before still pointed to python3.6. Therefore all installation had been done to .local/lib/python3.6
- installed nrfutil with python -m pip install nrfutil
now I've a folder ~/.local/lib/python3.8/site-packages.And nrfutil is installed in version 6.1.0
Next switched to folder with Espruino-installation and called - RELEASE=1 DFU_UPDATE_BUILD=1 BOARD=MDBT42Q make >tmp/stdout 2>tmp/stderr
and it worked fine. I've got my zip for uploading to MDB42Q board
- installed python3.8
-
I used pip install nrfutil==5.2.0
See https://pypi.org/project/nrfutil/#history for moreBut as long as I don't get it running, I would not suggest to change provision.sh
-
After doing some searching in the web, BTW I'm working with ubuntu 18.04.4 LTS
Actual nrfutil version is 6, but with that I get errors around installing pc-ble-driverFigured out, that nrfutil V 5.22 can be installed.
Actual installation according to pip list is..... ..... nrfutil (5.2.0) .... .... pc-ble-driver-py (0.11.4) .... ....
I've got an error and somewhere I found to do this
export LC_ALL=C.UTF-8 export LANG=C.UTF-8
But now I'm running into problems inside py-sources.
Sometimes life is not as friendly as it could be ;-( -
-
I've tried to compile firmware for MDBT42Q.
Installation of nrfutil, copied from provision.sh, fails.
Any idea?sudo pip install --ignore-installed nrfutil .... .... Collecting pc_ble_driver_py>=0.14.2 (from nrfutil) Could not find a version that satisfies the requirement pc_ble_driver_py>=0.14.2 (from nrfutil) (from versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4) No matching distribution found for pc_ble_driver_py>=0.14.2 (from nrfutil)
-
At least in my test, it did not matter, writing data or an empty string.
writing undefined or nothing gives an error, but, surprise,surprise, a file is created.
@fanoush, Data cannot be overwritten, thats a good point. I did not read this before.
BTW, try this:st.write("a","",0,10); =true >st.read("a"); ="\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" >st.readArrayBuffer("a"); =new Uint8Array([255, 255, 255, 255, 255, 255, 255, 255, 255, 255]).buffer >st.write("a","AB",0); =true >st.read("a") ="AB" >st.readArrayBuffer("a"); =new Uint8Array([65, 66]).buffer >st.write("a","CD",2); Uncaught Error: Too much data for file size at line 1 col 20 st.write("a","CD",2); ^ >st.write("a",[66,67],2); Uncaught Error: Too much data for file size at line 1 col 23 st.write("a",[66,67],2); ^ >st.read("a"); ="AB" >
On the other hand, this works
>st.write("a","abcd",0,10); =true >st.readArrayBuffer("a"); =new Uint8Array([97, 98, 99, 100, 255, 255, 255, 255, 255, 255]).buffer >st.write("a","efg",4); =true >st.readArrayBuffer("a"); =new Uint8Array([97, 98, 99, 100, 101, 102, 103, 255, 255, 255]).buffer >st.read("a") ="abcdefg\xFF\xFF\xFF" >
Anyway, it works for me now ;-)
-
Supporting size again did not help.
I've a different hack ;-)I'm using Storage to save some images data from GraphicsBuffer.
Creating the file was seperated from writing data.//initialization of file storage var st = require("Storage"); var fn = "b"; st.write(fn,'X',0,1024); ...... ...... //write data to file for(y = 0; y < height; y++){ st.write(fn,data_for_one_line,y * width); // write one line of graphics data }
My hack is to remove write in initialization, and add size to write of first line.
-
My idea was to define a file in storage and use it free like this:
var st = require("Storage"); var fn = "b"; st.write(fn,'X',0,20); print(st.read(fn)); st.write(fn,[64,65,66],0); print(st.read(fn));
This only works fine, if 2nd write does not use 0 for offset.
Otherwise, size is reduced to data written. In this case 3, and not 20 as defined in first write. -
-
@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 script tag in main.html to beautify-file
```