-
-
@tbd Yes, after hours of trial and error, this finally worked for me:
Install Xcode
Run sudo xcode-select -s /Applications/Xcode.app/Contents/Developerunfortunately it requires to install Xcode (5GB or so).
here is full thread: https://github.com/nodejs/node-gyp/issues/569
-
yes, updated node and npm...
Inspired by your suggestion I decided to reinstall
espruino
andespruino-cli
, I believe there is something wrong withespruino-cli
itself.Anyways, a clean install of
espruino
npm package and fixing XCode has solved it.
As I noticedespruino
package goes withespruino-cli
and installingespruino-cli
by itself creates havoc. Not mentioning thatnode-gyp
has its own problems with XcodeThank you for help!
-
Sad to say, but look like Command line tool is dead for me, I've spent 5 h or so trying to fix it..
I've been using command line. I prefer my own editor and I'm not a fan of copying large chunks of code from my editor into web IDE...
Updated npm packages and tried to connect like always, but got this:
https://gist.github.com/ancienthero/1e6d2e66350f20a393d73c0caa3ffda4Seemed like
espruino-cli
I decided to updateespruino-cli
but I got this:
https://gist.github.com/ancienthero/16f801d83d871b1e0b8997d0b386146aPlease help!
I've opened issues https://github.com/espruino/EspruinoTools/issues/66 , https://github.com/gzip/esp-cli/issues/2
-
Thank you!
Setters are the same but range of variables vary,
readDateTime()
is different because it returns date object instead of string, new features obviously don't break backward compatibility.By the way, how to make minified version on module? is this okay:
espruino -m DS3231.js -o DS3231.min.js
-
Hello
here is my version of DS3231 module, compatible with the javascript date object.
https://github.com/ancienthero/espruino/tree/master/modules/DS3231use it if you will ;)
feedback welcome as wellcheers
-
-
-
-
I've used this one https://www.espruino.com/binaries/travis/master/espruino_1v92.80_pico_1r3.bin
works like a charm!
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v92.80 Copyright 2016 G.Williams > >t = new Date; =Date { "ms": 949363217722.27758789062 } >t.toString(); ="Tue Feb 1 2000 00:00:17 GMT+0000" >t.setHours(10); =949399217722 >t.toString(); ="Tue Feb 1 2000 10:00:17 GMT+0000" >t.setMinutes(10); =949399817722 >t.toString(); ="Tue Feb 1 2000 10:10:17 GMT+0000" >t.setFullYear(2022); =1643710217722 >t.toString(); ="Tue Feb 1 2022 10:10:17 GMT+0000" >t.setDate(29); =1646129417722 >t.toString(); ="Tue Mar 1 2022 10:10:17 GMT+0000" >t.setMonth(4); =1651399817722 >t.toString(); ="Sun May 1 2022 10:10:17 GMT+0000" >
Thank you!
-
This is what I was thinking , pico rev 1.5 or pico pro if you will :)
- build in watch crystal
- micro usb instead of type A
- replace 0.05 GPIO pins with extra 0.1 GPIO pins (0.05 are hard to access unless you surface mount unpinned pico ). I would definitely back it on Kickstarter ;)
On the other hand a low cost very basic board would be an affordable option for people with limited budgets
- build in watch crystal
-
Thank you for checking @Gordon
Soldering these subatomic capacitors ain't going to be easy... ;)if there is going to be pico rev 1.5 soldered clock crystal and capacitors would be a good idea
-
-
-
the js Date object is marvelous
https://www.w3schools.com/jsref/jsref_obj_date.aspbut it's espruino implementation is very limited so far, to be specific, we can only read from the Date object once it has been created.
>t = new Date; =Date { "ms": 949363947471.30676269531 } >t.setHours(10); Uncaught Error: Function "setHours" not found! at line 1 col 3
Im working on a time switch, I've been using date class all around, finding out that set-methods are not implemented made me (almost :P ) depressed
setDate() Sets the day of the month of a date object setFullYear() Sets the year of a date object setHours() Sets the hour of a date object setMilliseconds() Sets the milliseconds of a date object setMinutes() Set the minutes of a date object setMonth() Sets the month of a date object setSeconds() Sets the seconds of a date object
Extending espruino's Date class would be extremely beneficial:
1) easy, date, time manipulation - clocks, timers, time switches
2) clock module wouldn't be necessary
3) if it's about memory, we can add set-methods and remove some of these:- function Date.getTimezoneOffset - doesn't make sense on espruino since it's always 0;
- Date.getTime() is almost identical with Date.now() and Date.now() makes more sense on embedded
- Date.toUTCString is kind of useless when our timezoneOffset is always 0
Let me know what do you think of it!
- function Date.getTimezoneOffset - doesn't make sense on espruino since it's always 0;
-
I have soldered
ABS06-107
but I'm still gettingLSI
:/Connected >Loading 2484 bytes from flash... > >(function() { : console.log("LSEON",peek32(1073887344)&1); : console.log("LSERDY",peek32(1073887344)&2); : console.log("LSION",peek32(1073887348)&1); : console.log("LSIRDY",peek32(1073887348)&2); : console.log(["NONE","LSE","LSI","HSE"][((peek32(1073887344)&768)>>8)]); : console.log("RTCEN",!!peek32(1073887344)&32768); : // RTC subsecond : console.log("Subsecond:", peek32(0x40002828)); :})(); LSEON 0 LSERDY 0 LSION 1 LSIRDY 2 LSI RTCEN 0 Subsecond: 26177 =undefined >
do you think this is caused by absence of 4pF capacitors?
-
I haven't thought about it that way, good point
as I found, these tiny rtc modules are designed to work with Raspberry Pi (https://goo.gl/hwqD8I) moreover they all have soldered 4.3k pull-ups, I dont think they all manufactured broken with wrong pull up value.
I suspect 4,7k is okay for stm32 but anything below (like 4,3k) is not -
Hi @Gordon
I don't think so, I've tested the module dozen of times, I think 4,7k would work but anything below 4,7 is hazardous, I assume it was working on a breadboard because of the extra resistance of pins, wires etc (my guess), anyway 10k is a safe option.
-
-
after 2days battle with the DS3231 RTC I want to share my thoughts
If you get this kind of error
Uncaught InternalError: Timeout on I2C Write BUSY
It's most likely because I2C pull-up resistor value is too low, it should be 10k not 4,7k
4,7k is a default pull-up value in many schematics but it's not enough for stm32, of course in many cases 4,7k would do the job but if you want to avoid hazards always pull-up 10k on I2c.In my case, a cheap DS3231 module had soldered 4,7k resistors, funny enough it was working on a breadboard but not on my custom made PCB lol....
-
I was wondering how to code given behaviour:
increment counter when button is pressed
keep incrementing when button is held downsuch a behaviour is often implemented for setting hours etc.
I've tried this:
var presses=0; //presses count pinMode(A7, "input_pulldown"); // software pulldown setWatch(function(){ clearInterval(); presses++; setInterval(function(){ if(digitalRead(A7)) { presses++; console.log(presses); } else {clearInterval();} }, 500); console.log(presses); },A7,{ repeat : true, debounce : 30, edge : "rising" } );
It works... but it's clearing other intervals.
Is there a cleaner/better way to code this?
If you know how to code it better, or have your own solution please shareThanks
-
Thanks @Gordon
am I getting it right?
btw, is there a way to check if it's successfully detected and used?
-
Hi
I'm building a Programmable Timer Switch (Synchronizing time with DCF77 - from time to time) on espruino Pico so I need a quite accurate clock.
Do I need a external RTC (like DS1307 or DS3231) or internal crystal is accurate enough for a clock?
I'm quite confused because here we've got: https://www.espruino.com/Pico+ClockWhile the Pico has an RTC built in, by default it doesn't have an accurate watch crystal and so uses its internal oscillator which isn't that accurate. It won't keep proper time over a month
but, on the other hand, there is a clock frequency crystal in schematic - which should generate very accurate time
Thanks for your help
Interesting eslint configuration. I use very simple eslint config for espruino, but I'll consider using your file.