-
@Robin Thank you for the Pointer (https://chrome.google.com/webstore/detail/espruino-web-ide/bleoifhkdalbjfbobjackfdifdneehpo). That’s the IDE Variant I was looking for.
I tried the chrome web store before posting here. However, when I enter “Espruino” in the search field the only app that shows up is a fake. It's strange that the in-store-search does not work, at least on my system/language setting.
-
I've been absent for some years. Coming back a lot has changed. Many new cool features :-). However, one seems to be gone:
https://www.espruino.com/Modules states "If you set a project folder with Web IDE -> Settings -> Project, the Web IDE will automatically create an empty modules folder inside it. Put a module there and you can load it with require("myCustomModule");.I'm executing the IDE in Chrome on Mac OS X by visiting https://www.espruino.com/ide That version does not have this option. Is there a version with this feature available for download? I've checked Googles Chrome-Appstore but the IDE does not seem to exist there anymore.
-
-
I never submitted a PR for
NFCvCard.js
since it didn't felt polished enough (especially since the vcard hat to be < 220 bytes). So the detour of downloading and copying to module directory is necessary. I've just double-checked. Using the https://www.espruino.com/modules/NFCTag.js and the NFCvCard.js from above still works for me...That sed I rarely have issues when the BLE connection is also open. What might also break the system is creating multiple instances of
NFCTag
by callingrequire("NFCvCard")
multiple times without a reset (note an upload performs a reset, so that should be fine in your case).My RAW data ends up to be:
tag._record = new Uint8Array([95, 112, 172, 11, 153, 120, 250, 81, 74, 3, 255, 255, 225, 17, 124, 15, 3, 135, 194, 12, 0, 0, 0, 117, 116, 101, 120, 116, 47, 120, 45, 118, 67, 97, 114, 100, 66, 69, 71, 73, 78, 58, 86, 67, 65, 82, 68, 10, 86, 69, 82, 83, 73, 79, 78, 58, 50, 46, 49, 10, 78, 58, 68, 111, 101, 59, 74, 111, 104, 110, 59, 59, 77, 114, 46, 10, 70, 78, 58, 74, 111, 104, 110, 32, 68, 111, 101, 10, 84, 69, 76, 59, 87, 79, 82, 75, 59, 86, 79, 73, 67, 69, 58, 40, 49, 49, 49, 41, 32, 53, 53, 53, 45, 49, 50, 49, 50, 10, 69, 77, 65, 73, 76, 58, 106, 111, 110, 100, 111, 101, 64, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109, 10, 69, 78, 68, 58, 86, 67, 65, 82, 68, 10, 254]);
Except the first 10 bytes (unique device id) this data should be identical on your Puck.JS.
-
-
I've started to port old code that uses the (deprecated) Flash-Module to the Storage-Module.
With the Flash-Module I could disable features like NET, GRAPHICS and thereby increase the Storage available to me. (As far as I know, the Flash-Module uses the pages between the executable and the reserved area).
The Storage-Module, on the other hand, seems to use the pages defined by
pages: 10
.Can I simply increase
pages
and decreaseflash_available
by the same amount to move the free space from the Flash-Module to Storage-Module?
What are the 2 pages reserved forFS
for? -
Can you be a little more specific?
The documentation for the NFCTag module is available here:
https://www.espruino.com/NFCTagI've tested the library with iOS13 (now also featuring write!!!) using a recently released App (not by me): https://apps.apple.com/ch/app/nfc-tools/id1252962749
iOS is a little more picky than Android so tuning some static data is required:
var data = new Uint8Array(16+872); data.set("\x00\x00\xE1\x10\x6D\x00\x03\x00\xFE\x00", 0x0A); var tag = require("NFCTag").create(data);
-
I'm not an expert but likely you will hit in cold temperatures the limitation of the CR2032 cell or almost any other battery first. The chemical process within a battery is significantly more temperature dependent as any other component.
Next to the battery your only other concern should be condensation since it may lead to shorts or corrosion.
-
The button connects (if pressed) VCC (3.3V) to Ground producing a short.
If you want to pull a pin to ground you should always use a resistor e.g. 10k and not tie it directly,
see: https://en.wikipedia.org/wiki/Pull-up_resistor for details.
Note: The article describes pull-up, but the same principle applies to pull down. -
-
-
I've a pretty large application consisting of 5 modules (loaded with require) and a main.
I've enabled "Save on Send" and set "Minification" as well as "Module Minification" to "Closure Simple".The upload kind of succeeds but the execution fails with
>Uncaught InternalError: NRF ERROR 9 at line 1 col 7573 ...bounce:50,repeat:!0})});\n");load();
Further more the saved code is garbage:
dump(); // Code saved with E.setBootCode ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ... require("Storage").read(".bootcde"); ="\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF....
If reduce my code size by deleting functions, everything turns back to normal.
Can this be fixed? I'm also happy with a solution where I upload the modules and the main separately.
-
I vote for handling
undefined
and missing the same way. Default function parameters are implemented in javascript using a check for undefined - an example:function multiply(a, b) { b = (typeof b !== 'undefined') ? b : 1; return a * b; }
Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters
I believe adding a distinction between undefined and missing breaks the spec too.
-
@MaBe The documentation to setTimeout states:
Returns An ID that can be passed to
clearTimeoutTo answer your question calling a function without an argument is identical to calling it with
undefined
-
-
I'll open a pull request for
NFCTag.js
on the weekend.About downloading arbitrary data using NFC:
It's generic and works for text, images, js... for this reason the data is wrapped in a NDEF MIME Record. Andoird features an API for wrap und unwrap.Wrap and unwrap is missing from Pucks JS-Engine, namely:
- Parse and skip NDEF Message Header. (Usually 2 or 4 bytes)
- Parse and skip NDEF MIME-Record Header. (Here length greatly depends on the payload type string e.g. "text/javascript" is already 15 bytes on it's own.)
If there is interest I would invest some time into a MIME record wrap unwrap module.
- Parse and skip NDEF Message Header. (Usually 2 or 4 bytes)
-
Yes, iPhone 7, 8, X with iOS11 (released in September 2017) feature a NFC reader API for NDEF records. (No write support and no arbitrary tag type support, just NDEF read.)
I'd like to have
NFCTag.js
listed. Should I open a pull request?
SinceNFCTag.js
implements write support, it opens up additional possibilities. In theory you could download code to a Puck using NFC...I've come up with an additional example:
var data = new Uint8Array(16+768); data.set("\xE1\x11\x60\x00", 0x0C); var tag = require("NFCTag").create(data);
This code creates an empty tag with 768 bytes of writable storage.
The
data
can be initialized with an Android App, i.e.
https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter -
-
I've implemented a PoC for NFC vCard support.
My implementation consists of two modules. A NFC card emulation
NFCTag.js
and a NDEF vCard wrapperNFCvCard.js
.NFCTag: Features READ and WRITE support.
NFCvCard: Its a pretty crude application example for NFCTag that can be altered to support various MIME-Type based NDEF tag types.I've tested my vCard example below using https://itunes.apple.com/us/app/nfc-reader-for-iphone/id1249686798?mt=8
var tag = require("NFCvCard").create("BEGIN:VCARD\n"+ "VERSION:2.1\n"+ "N:Doe;John;;Mr.\n"+ "FN:John Doe\n"+ "TEL;WORK;VOICE:(111) 555-1212\n"+ "EMAIL:jondoe@example.com\n"+ "END:VCARD\n");
-
short version:
With the new systems the processing fee is just more visible and hence might stop people from pledging - especially in the 1$ - 2$ range. However the service costs remain almost identical.longer version:
I've looked ad EEVblogs eevBLAB #42 Patreon rant. He is showing his numbers at 4:45.
https://youtu.be/LDt_WXnEnw0?t=285
According to Dave, Patreon charged him with ~12% for the entire service.
Looking at this raw data, I deduct Patreon's cut in % remains unchanged:
- Patreon still deducts a %5 fee from the creator.
- The processing fee was previously payed by the creator and is now added onto of the pledge:
i.e. 20$ pledge + 0.35$ + 0.58$ = 20.93$ => ~5%.
Yes, charging 0.35$ multiple times is wrong. That sed I assume this practice was previously hidden and is now obvious.
- Patreon still deducts a %5 fee from the creator.
-
-
-
-
@Gordon Yes
Storage
is one of the cool features, I'm looking forward to using.