-
Hi! I've tried to build ESP32 branch, and I have no success.
First of all, I have found that 'source scripts/provision.sh ESP32' (as in docs) gets app and esp-idf from master branch of EspruinoBuildTools while code uses newer version already. I have corrected it to get ESP32 branch.
Then I have got an error about unknown gcc option '-mfix-esp32-psram-cache-issue'. After removing it from makefile (in any case I have no board with psram) I have all files compiled. But at linking stage I have got "undefined reference to `esp_ble_gap_set_security_param'" error.
While I think the build will not work without the call, I have commented all calls of esp_ble_gap_set_security_param() to look for next stop. It is "cp: cannot stat '/home/serge/Projects/ESP32/Espruino/app/build/partitions_espruinoBLE.bin': No such file or directory"
My build commands are:source scripts/provision.sh ESP32 make clean && BOARD=ESP32 DEBUG=1 USE_BLUETOOTH=1 make
-
Thank you.
I think I have asked my question in bad form.
I know about clearTimeout() without arguments.
But I call it with 1 argument. But the argument is undefined. And I see the same result. I do not know if it is a bug or not.
For example:var timNum; clearTimeout(timNum); timNum=setTimeout(.....);
And I think it depends on JS implementation does on all devices, not only ESP8266. Usually I try to test my code for Puck.JS with ESP8266 first, because it is much easier to connect peripherals to it and to send code to it as well - espruino-server falls each second connection and can not work together with EspruinoHub.
-
-
Hi!
I try to use Lolin32 Lite modules (or something similar- I am not sure) and I have permanent problem with WiFi connection - it is often in AUTH_EXPIRE state.
Here I have found that there is a bug in ESP32 Wifi library - it can not reconnect to AP automatically.One possible workaround is to call disconnect() every time and then call connect(SSID, options) again. Another one is to implement it inside Espruino code.
What do you think about it?
-
I have tried to program ESP8266-based clock using Android TV-box with HDMI display, USB keyboard and mouse - my children often use it as yet another computer if all normal computers are in use. The TV-box has powerful processor, big memory and storage. Now I am going to use Espruino WebIDE in Linux VM on the TV-box, as workaround.
If it is possible and not too dificult to support such devices as Espruino Web IDE hosts in future, it may be interesting, because millions are already in use. -
-
-
@Gordon
Here is a version of VL53L0X module with some small additions. It is compiled from a few working parts but not tested (I have no device now). In any case, additions from previous version are very small so I do not think there are too many bugs here.
Main problem with readRangeSingleMillimeters() - it can not work after setGPIOConfig (1) - GPIO mode set to on when low threshold is crossed.
I have not checked accurately if performSingleMeasurement() can still work - it waits for another flag in 'while'. May be that flag is better and may be it will be better to change readRangeContinuousMillimeters() to use the flag. -
Hi!
@PaddeK
It seems to me that I use command register at 0x00, it was 0x80 at first version (and it works - may be the chip does not read upper bits) but I have changed it at second one (and it works, too). Or may be I do not see something. -
Hi! Sorry, I had no time at all before and have too little time now. But I hope tomorrow I will have enough.
About VCNL4200: I have removed "0x80|addr" in last version of my module from r and r2 funtions, but I am not sure I sent it here. But it works with it and without it. While it is better to remove it to comply documentation.About readRangeSingleMillimeters/readRangeContÂinuousMillimeters and the original performSingleMeasurement. Yes, I forget to remove one because had both in my test, and had already not enough time. By the way, both functions looks like can not work if switch GPIO to other modes and I even know why (I did not implement setGPIOMode() still and did it by accessing registers using w2(). Moreover, it was my general goal to test effects of GPIO modes).
-
It was epic battle!
Nearly impossible for me: I do not know JS, I have never seen Closure compiler before, I have never even heard about it... And 1000 lines of code, which can work only in minificated form... And, of course, bugs, bugs, bugs...
I am really like an ancient hero!
Do not only sure, which one - Heracles or Sisyphus :) -
Now I have version with most bugs fixed which passes Closure minification in advanced mode and works after.
Unfortunately I do not know if it works without minification - it looks like it is too big for my current device (while I am out of home and so can not use some other device).
After calibration the sensor is more stable and does not report very small distance when in open space. Also you may use some mode setup functions. It is great for me. But I need also GPIO setup to try switching it to trigger mode, when GPIO turns on if object is too close and turns off when it is far again.
The module is still big enough even after advanced minification - about 7600 bytes. I can load it only in 'Modules uploaded as functions' mode. In normal mode it results to LOW_MEMORY error.
I have not still fixed I2C address (it is 8 bit in the module and need to be shifted) while it is easy for me, because I think it is up to @Gordon to change it or leave as is for compatibility. While I think now is good time for the change.
Also I think it may be interesting to have both modules for the complex sensor - old and new one, because they have different areas of usage. Really I have no good idea what to do with that. -
-
-
-
I have just done translation of some part of VL53L0X library to JS. But I can not check it. May be because of small memory on ESP8266 - I am not sure. Or may be there are many bugs there. Could you help me?
Here is console output after I try to load the module._____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95.4 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:1024/1024, manuf 0x5e chip 0x4016 >Uncaught SyntaxError: Got UNFINISHED STRING expected EOF at line 1 col 31 Modules.addCached("VL53L0Xmy","var C={SYSRANGE_START:0,SYSTE... ^ New interpreter error: LOW_MEMORY,MEMORY Uncaught Error: Module "VL53L0Xmy" not found at line 1 col 32 ...or[0] = require("VL53L0Xmy").connect(i2c,{address:0x52,addre... ^ 1 =undefined >process.memory() ={ "free": 1496, "usage": 104, "total": 1600, "history": 608, "gc": 5, "gctime": 1.99 } >
-
-
I am working on VL53L0X module and I have seen a potential holywar: these modules have different semantic of I2C addresses. One uses 7-bit address, as in Linux and in some datasheets while another uses 8-bit shifted address like in some other datasheets.
Are you going to save current state when different modules have different meaning of I2C address or to change it (may be not just now) to be uniform? -
The register is to set not only the time but a few other parameters as well. So I can write function to set time only, of course. It can get register, then add time and set the register back. But may be it is easier to users to look at the datasheet, isn't it? While the datasheet is not well-understandable, but I do not think adding separate functions or parameters with strange names makes it more understandable.
So may be it would be better to remove the names from the module. Please do that if you think it will be better in Espruino environment. -
-
The code have at least one problem - bit fields for registers are not shown for module user (or I do not know how to use it). I do not know JS so I do not know how to correct the code. Could you help me?
I think I can not write description in style of "Writing Modules" because I use own board with a few sensors and do not know about boards available to others. But. of course, I can write code example:var i2c=new I2C(); i2c.setup({ sda:D12, scl:D13} ); //var sensor = require("VCNL4200").connect(i2c,{address:0x51}); //0x51 is default address so may be omitted var sensor = require("VCNL4200").connect(i2c); //sensor.Configure(); //It is possible to use it for some default mode, but it should be investigated what to set as default sensor.setAmbiConf(0); sensor.setProxiConf12(0x2A,0x0B); sensor.setProxiConf3MS(0x70,0x27); //0x27 to use INT pin as proximity signal, 0x7 to use INT as interrupt sensor.setProxiLowThreshold(1000); sensor.setProxiHighThreshold(3000); sensor.logAll(); function log (){ console.log( " Proximity: " + sensor.getProximity() + " Ambient: " + sensor.getAmbient() + " White: " + sensor.getWhite() + " Int: " + sensor.getInterruptFlags().toString(16)); } setInterval(log, 1000);
-
-
-
Hi!
I want to make tiny modification of VL53L0X module - add an option that means "address is changed already, use new address but do not send address change command to device" - I try to use few VL53L0X thru I2C address changer and one without changer and the address change command will prefer the last one from correct work.
The code is easy so I can make the modification in local copy. But my JS skills are not good so I think I can not write well-readable code in JS and Espruino tradition.How to write it in good style? Well-designed interface is important in the place.
May be the option will be useful for other modules as well.I am going to modify the module further to add features I need - continuous measurement mode etc. And I think I can put the code somewhere - GitHub branch or even here - and somebody who know JS can modify my code to add good JS style.
By the way, it seems to me, Mongoose OS Pololu VL53L0 code looks to be better for reverse-engineering then original ST.
Thank you. My idea is to transfer Puck.JS BLE-MQTT bridge from Raspberry-like system to ESP32 and use one of public MQTT services with it. It may be cheap and simple solution.