-
-
For starters, have a look at: http://www.espruino.com/File+IO
From the espruino docs:
On the original Espruino board there's a Micro SD card slot built-in,
or on the Espruino Pico you'll have to wire a card up externally and
then tell Espruino about it with E.connectSDCard:Once you have wired a SD card to the appropriate pins on your Pico, tell the Pico about it, like so:
// Wire up up MOSI, MISO, SCK and CS pins (along with 3.3v and GND) SPI1.setup({mosi:B5, miso:B4, sck:B3}); E.connectSDCard(SPI1, B6 /*CS*/); // see what's on the device console.log(require("fs").readdirSync());
-
-
@Gordon are you testing out other website themes for other websites by using the Espruino's home?
-
@Gordon looks like the website went back to normal.
-
-
@hygy that is awesome. Maybe now I can put my nextion screens to good use :-)
-
@Gordon Ahhh I see and understand. Thanks for the explanation.
-
@Gordon is it possible to half(terminology?) the pin sections for castellations like you did on the Pico?
-
@Gordon I will take a trip to goodwill to see if they have any cheap second hand nic cards. If not I'll end up having to purchase a cheap nic card from ebay or some other store.
-
I'm working on a project that will at some point require the use of a PCI Ethernet bracket. I can't for the life of me find one while searching google. I came across tuns of links to blank pci plates but, nothing for Ethernet. I don't have an old network card that I could pull one off of either.. Does anyone know where I can get one? I would prefer to purchase from a US store because I'm impatient while waiting for a shipment from China.
-
I would like to charge 3 18650 batteries and the batteries need be married (or is it called balancing?) I'm using 3 single 18650s cells for my vape.
Building a battery charger with built in WiFi or Bluetooth would be a neat project to keep me busy and learn :-) I could always purchase a charger, I already have one, but it doesn't have WiFi or bluetooth.
Thanks for posting the link. It had tuns of good info :-)
-
-
@tage I was wrong about the 4.7v the efest charger says 4.2v not 4.7v.
I'll edit my original post..
-
I wonder if this will work to charge 18650 batteries? The batteries that I use for my vape can be found here: http://www.amazon.com/Sony-US18650VTC4-2100mAh-Rechargeable-Batteries/dp/B00J470LTA
My goal is to implement battery marrying, Bluetooth/WiFi status for updates.
Right now I'm using an efest charger to charge my batteries which takes care of draining and charging. The charger also has the capability to charge either at 0.5amps or 1.0amps. I charge at 1.0amps for a faster charge. The batteries are rated at 3.7v but the charger shows 4.2v while charging. So im not sure if the charger is actuall charging using 4.2v. Is charging at 4.2v a trigger to tell the chip in the batteries to turn on charging mode? I don't completely know all the specs used to charge the batteries or the technology/science used in battery charging.
-
@DrAzzy I had a look at digikey and they seem cheaper than mouser by a few cents. Looks like I will be using digikey now :-)
-
@Gordon That is exactly what I was expecting... Each test function output something so I can see the crypto in action. I was able to see all of the test functions execute.
OUTPUT:
Expecting dd469421e5f4089a1418ea24ba37c61b Got
dd469421e5f4089a1418ea24ba37c61b Expecting
b7e812f9a05778e9fb2a09b9edf49e1f12e7543e609fa8bec3d9ab82b5b206f59ff23b5614175f59d66918a1f271e5eb
Got
b7e812f9a05778e9fb2a09b9edf49e1f12e7543e609fa8bec3d9ab82b5b206f59ff23b5614175f59d66918a1f271e5eb
Expecting Lots and lots of my lovely secret data Got Lots and lots of
my lovely secret data Expecting
66a140b8d735597643d4dfeb1f5b8f23516363e9f7760d6a5bbc8659f0a9bccf7fdd55dfc1fc84945443fdfe877238ed
Got
66a140b8d735597643d4dfeb1f5b8f23516363e9f7760d6a5bbc8659f0a9bccf7fdd55dfc1fc84945443fdfe877238ed
Expecting Lots and lots of my lovely secret data Got Lots and lots of
my lovely secret data DoneNow to utilize the crypto module for my real life project :)
-
@Gordon below is the code that I am now demoing out. The console says Done however, I don't see(know of) any of the test functions execute.
ArrayBuffer.prototype.toHex = function () { var s = ""; for (var i=0;i<this.length;i++) s += (256+this[i]).toString(16).substr(-2); return s; }; ArrayBuffer.prototype.toStr = function () { return E.toString(this); }; function fromHex(hex) { var arr = new ArrayBuffer(hex.length/2); for (var i=0;i<hex.length;i+=2) arr[i>>1] = parseInt(hex.substr(i,2),16); return arr; } function test(a, b) { tests++; var ar = a(); if (ar!=b) { console.log("Test "+tests,a,"did not equal",b,", it was ", ar); } else { testPass++; } } var tests = 0; var testPass = 0; test(function() { return require('crypto').PBKDF2('Secret Passphrase', fromHex("cbde29d15836ce94e34a124afe1094e2")).toHex(); }, "dd469421e5f4089a1418ea24ba37c61b"); test(function () { var key = fromHex("dd469421e5f4089a1418ea24ba37c61b"); var msg = 'Lots and lots of my lovely secret data '; return require('crypto').AES.encrypt(msg, key).toHex(); }, "b7e812f9a05778e9fb2a09b9edf49e1f12e7543e609fa8bec3d9ab82b5b206f59ff23b5614175f59d66918a1f271e5eb"); test(function () { var key = fromHex("dd469421e5f4089a1418ea24ba37c61b"); var msg = fromHex("b7e812f9a05778e9fb2a09b9edf49e1f12e7543e609fa8bec3d9ab82b5b206f59ff23b5614175f59d66918a1f271e5eb"); return require('crypto').AES.decrypt(msg, key).toStr(); }, 'Lots and lots of my lovely secret data '); var iv = "Hello World 1234"; // 16 bytes (can be an array too) test(function () { var key = fromHex("dd469421e5f4089a1418ea24ba37c61b"); var msg = 'Lots and lots of my lovely secret data '; return require('crypto').AES.encrypt(msg, key, {iv:iv}).toHex(); }, "66a140b8d735597643d4dfeb1f5b8f23516363e9f7760d6a5bbc8659f0a9bccf7fdd55dfc1fc84945443fdfe877238ed"); test(function () { var key = fromHex("dd469421e5f4089a1418ea24ba37c61b"); var msg = fromHex("66a140b8d735597643d4dfeb1f5b8f23516363e9f7760d6a5bbc8659f0a9bccf7fdd55dfc1fc84945443fdfe877238ed"); return require('crypto').AES.decrypt(msg, key, {iv:iv}).toStr(); }, 'Lots and lots of my lovely secret data '); console.log("Done");
-
@Gordon yes, the error is an orange warning.
-
-
I'm trying to implement aes in my project by reading the test_crypto.js file. However, I am getting Module crypto not found. I'm using the 1v84 firmware. Is there a custom firmware that I should be using instead?
code:
ArrayBuffer.prototype.toHex = function () { var s = ""; for (var i=0;i<this.length;i++) s += (256+this[i]).toString(16).substr(-2); return s; }; ArrayBuffer.prototype.toStr = function () { return E.toString(this); }; function fromHex(hex) { var arr = new ArrayBuffer(hex.length/2); for (var i=0;i<hex.length;i+=2) arr[i>>1] = parseInt(hex.substr(i,2),16); return arr; } function test(a, b) { tests++; var ar = a(); if (ar!=b) { console.log("Test "+tests,a,"did not equal",b,", it was ", ar); } else { testPass++; } } var tests = 0; var testPass = 0; test(function() { return require('crypto').PBKDF2('Secret Passphrase', fromHex("cbde29d15836ce94e34a124afe1094e2")).toHex(); }, "dd469421e5f4089a1418ea24ba37c61b"); test(function () { var key = fromHex("dd469421e5f4089a1418ea24ba37c61b"); var msg = 'Lots and lots of my lovely secret data '; return require('crypto').AES.encrypt(msg, key).toHex(); }, "b7e812f9a05778e9fb2a09b9edf49e1f12e7543e609fa8bec3d9ab82b5b206f59ff23b5614175f59d66918a1f271e5eb"); test(function () { var key = fromHex("dd469421e5f4089a1418ea24ba37c61b"); var msg = fromHex("b7e812f9a05778e9fb2a09b9edf49e1f12e7543e609fa8bec3d9ab82b5b206f59ff23b5614175f59d66918a1f271e5eb"); return require('crypto').AES.decrypt(msg, key).toStr(); }, 'Lots and lots of my lovely secret data '); var iv = "Hello World 1234"; // 16 bytes (can be an array too) test(function () { var key = fromHex("dd469421e5f4089a1418ea24ba37c61b"); var msg = 'Lots and lots of my lovely secret data '; return require('crypto').AES.encrypt(msg, key, {iv:iv}).toHex(); }, "66a140b8d735597643d4dfeb1f5b8f23516363e9f7760d6a5bbc8659f0a9bccf7fdd55dfc1fc84945443fdfe877238ed"); test(function () { var key = fromHex("dd469421e5f4089a1418ea24ba37c61b"); var msg = fromHex("66a140b8d735597643d4dfeb1f5b8f23516363e9f7760d6a5bbc8659f0a9bccf7fdd55dfc1fc84945443fdfe877238ed"); return require('crypto').AES.decrypt(msg, key, {iv:iv}).toStr(); }, 'Lots and lots of my lovely secret data ');
-
I really have no idea why i'm having so many issues with the sparkfun ESP shield. So, I stopped using the sparkfun ESP shield and switched back to soldering the shim v2 of the esp shim to the pico. I soldered 0.1" Female Headers to the ESP through hole section of the shim. Luckly I chose that method instead of soldering the ESP directory to the shim, because the first ESP I had for whatever reason wouldn't work. I swapped it out for another ESP and it worked as expected :-)
I'm hoping that by using the female headers, it will allow me to stay up to date with the new ESPs and swap them out for future R&D.
-
@Gordon thanks! I purchased a bunch of caps from mouser. I have yet to purchase from farnell. It looks like farnell is based out of the UK. I wonder if farnell has a distribution center in the US...
Hrm, interesting. My question had risen from my curiosity about how vaporizers (ecigs) measure the ohms, wattage and etc of its coils.