Man, those things are still around? When I first got into the hobby we were all looking at them and wishing they were easier to use... IIRC they don't do any of the work for you, so making a driver for them to get Espruino to support it would be kind of a nightmare.
These days everyone just uses ESP8266's for LAN connectivity. I'll bet someone (not me, I have WAY too much on my plate) could take a blue-pill-like board, or an Arduino (I think there's an Arduino library for it? Might not even be that hard, if there's already a decent library to put a wrapper around... have it talk to whatever over serial, and rip off the ESP8266 AT-firmware API... The hardware would be cheap - on the other hand, they'd be competing with $2 ESP8266s, so it might be hard to get people's attention. Wires seem to be kind of passe now... I used to be a "screw wifi, give me a CAT-5 cable" type, but... I haven't plugged into the network cable since I think before the quarantimes... wifi has finally gotten good enough, and they've got the volume such that they're cheaper than dirt...
@user111618 sorry for that - hadn't known you were not native english speaker - most of my post above was totally unimportant!... And sorry for not seeing that someone had replied in this thread until now, too...
The important part of my message was just the end:
What kind of Arduino did you want to program through an Espruino?
If it is something that you had to install a "core"/"board package"/etc for, I need to know which board package.
Why do you need to use software serial? If you could use the normal hardware serial pins, this would be much easier. Even using a different set of hardware serial pins will be much easier than software serial....
I have added some boldface clarification to the start of that thread to make it clearer that the fumbling around in that thread was entirely due to user error on my part, and that there is absolutely nothing wrong with those boards (other than the decision to not support QIO in order to save money - but that's a decision that WeMos made, and the clones just copied it - which I can't fault them for, since if everyone is treating it just like an official wemos board, nobody would get any benefit from the fancier flash chip. And no clone maker is going to spend money for a feature their customers wouldn't be able to use)
I wholeheartedly recommend buying any old clone WeMos D1 mini, and would have absolutely no reservations with recommending that.
The boards you linked as "not this one please" are ONE HUNDRED PERCENT FINE and DO NOT NEED ANY RESISTORS ADDED OR REMOVED! THEY WORK WITHOUT ANY MODIFICATIONS!!!!
THOSE ARE THE BOARDS YOU WANT TO USE!
His suggestion was (unnecessary, inappropriate) debugging advice as I tried to fumble through a problem I was having because I was trying to flash the Espruino firmware in QIO mode, when the D1 mini modules only support DIO mode. That was my mistake, and his debugging advice wasn't even good advice. "Take your head out of your ass and go learn how flashing an ESP8266 works" would be what he should have said to me there, because that's all I needed to do.
I sincerely apologize for starting a thread which led people to the mistaken conclusion that those boards were bad. They are perfectly fine. Unless you happen to need to performance of QIO mode, of course.
As it happens, DIO mode did not meet my performance requirements (the project in questions's performance is right at the limit of espruino-on-esp8266 performance - losing QIO mode imposed a nearly 2:1 penalty, and since in QIO mode I had already done every trick I knew, plus some Gordon tipped me off to, in order to boost performance and still wished it were faster - so DIO mode was a total non-starter), leading me to take a torch to those boards to remove the module from the top so I could solder in an ESP-12 module with QIO support on a few of them, before I found a listing on AliExpress for D1 mini boards without the ESP module mounted on them, so I could just buy those, and put the good ESP-12 modules on them, and leave the torch in the closet. It didn't really save much money to do it that way, surprisingly, but definitely saved time.
Well, you said you were using the power supply it came with right? And that you had it hooked up to power the uC - and if it was an AC supply, and you had it hooked up to a microcontroller board, you would know, because the board would be emitting smoke and no longer responding to attempts at programming it
Hmm... I would expect that to work, provided it really is 6v DC, not AC (if it was AC, you'd be able to tell pretty fast as the poor microcontroller you were powering with it failing with smoke.
I would suggest a round of sanity checks - ie, wire it up, but without the microcontroller, manually connect gate to ground, light should now be off, connect to +6v, light goes on. Okay, is my code actually even turning on the pin, or is something silly wrong there? that kind of thing.
How is it wired?
I mean, I can take a guess that the answer is "wrong" but with a drawing of how it's wired up would help me be more specific.
A hand-drawn picture, photographed with your cellphone is better than a fritzing diagram any day. Also, maybe a photo of the guts of the thing you're controlling just so I can give a quick reality check that it's what we think it is and should work how we think it should.
Oh ho ho! Finally a thread on here that is really in my wheelhouse! (I joined the electronics hobby with Espruino - the ease of the live console eliminated the barriers that had kept me from the hobby previously. But then I needed the real-time processing of Arduino, and started dabbling in that, then found my niche with ATTinyCore, and have since dove headfirst into low-level AVR stuff. I love programming so close to bare metal that I can feel the silicon under my fingertips... but I just don't have sufficient mental bandwidth to handle the complexity of STM32 at that depth (besides, their datasheets, particularly the separate manual and datasheet structure, are hell to navigate compared to the AVRs.) However, I still program with Arduino IDE, not the Microchip tools (good lord, I wasted three days just trying to get their thing to read the signature of their new part, using their own programming tool, without getting anywhere, before giving up and modifying the opensource firmware of jtag2updi so I could just use AVRdude like a normal person), and I still use Espruino whenever I have to touch a modern network. The internet, with it's world of variable length strings, was just not made for the fixed length character arrays of embedded C (with 512~2k (occasionally as high as 16k) of ram, and no way to clean up ram fragmentation, dynamic allocation on classical Arduino parts should be avoided like the plague). This generally means that when I use Espruino, I usually have an ESP8266 handling the network tied to an Arduino doing the timing-critical stuff.... Which sounds like about what you're doing!
Can you clarify what you mean by "Arduino" in this case? What hardware?
Which Arduino board package is used to support it (github link or board manager json), if it is supported by a third party board package? Which exact Tools -> board and Tools -> bootloader (if present in that board package)
These details matter a great deal, as the programming methods used on Arduino-supported boards differ greatly with the hardware and bootloader on the board.
When you say "soft serial", which side do you want to be using the software serial for that upload you mentioned?
Also, you are running Espruino on the ESP8266?
Heads up! Only through-hole (TO-220) power MOSFET that switches with 3.3v on gate is being discontinued!
Well funny you should mention that ;-) I do sell beefy SMD MOSFETs on breakout boards. Including with driver chips that not only put a supplied 5~10V on the gate with a low voltage signal, they can dump a slug of current into it to slam the gate open and minimize switching losses, so you can PWM stuff at high current and insane frequencies without overheating the FETs. https://www.tindie.com/products/drazzy/4-channel-logic-level-mosfet-driver-100a-up-to100v/
Even if you're willing to use SMD parts with really nasty (as in, don't even think of using them without a reflow oven nasty, because you can't solder them realistically with an iron, nor with hot air if you have enough 2 oz copper to help pull the heat away), the there just aren't that many decent power MOSFETs that can hold off more than 20V and switch at 2.5 (the numbers you want to use for 3~3.3v logic level signals). The IRFR3708 (also discontinued - was just a different package) was one of the real standouts on that list, and you could solder it with an iron! At 20V, there are a few good options in DPAK though, thankfully, but if you need to hold off 30v because you're using 24V devices, that doesn't help you. All the good 30V FETs that turned on with 2.5 on the gate and handled tens of amps are discontinued!
How much current are you able to put through them?
They look like pretty lousy FETs at 3v... (like, well, basically every other through-hole MOSFET). I reckon you'd see a volt across drain and source with only 2-3A flowing, at which point you almost might as well use a BJT! On an IRF3708, even with 10A, you'd see around 0.15v between drain and source.
Quick back of envelope suggests that without heroic cooling measures, you'd at best be able to get maybe 4A through them, probably less, with a significant portion of the power being dissipated in the FET and wasted as heat.... 4A is within the capabilities of a rice-grain sized SOT-23 MOSFET, even with only 3V on the gate, top end FETs in SOT-23 are up to that, with up to 30Vds (I just so happen to sell some nice FETs in SOT-23 mounted on breakout boards too! https://www.tindie.com/products/drazzy/simple-sot-23-mosfet-six-pack-logic-level/ ). SOT-23 FETs are insanely good up to a few amps, especially for the price - and that's even if you're buying my assembled boards with my margins! Also, unlike the beefier packages, they almost always spec max current at Ta (ambient temperature) not Tc (case temperature), so the datasheet numbers are actually realistic without heroic cooling measures...
Edit: Oh, and I couldn't help myself. I bought the 381 IRF3708's in TO-220 that Rochester Electronics had on close-out special (they are weird - the moment something gets marked last time buy, it's like it turns radioactive and they feel an urgent need to get rid of it - whereas I have a desperate desire (at least when there's nothing as good available otherwise, like now) to buy a stockpile). Assuming someone else doesn't start making baller low-voltage 30V+ FETs in nice beefy throughhole packages (in which case I would be left holding the anti-static bag), I'll wait 'til they're out of stock from all the usual suspects and try to flip em :-P
Heads up! Only through-hole (TO-220) power MOSFET that switches with 3.3v on gate is being discontinued!
The IRF3708PBF has long been my go-to through-hole MOSFET - a beefy TO-220 FET, good to 30Vds, and can handle tens of amps with added cooling.... but the real magic was that it was rated for Vgs = 2.8V, meaning you could comfortably control it with a 3.3v device and count on Rds(on) of 29 milliohm (max, 15 typ) (and that's at 2.8v, so it would be even better). A perfect power MOSFET for 3.3v boards like Espruino.
Well, unfortunately, Infineon is shutting down the line they make them at, and discontinuing the product. Their recommended replacements don't switch at 3.3v, and there aren't any other beefy through-hole MOSFETs that switch at 3.3v... at all. In fact, there aren't even any easily-soldered (ex, DPAK) SMD power MOSFETs that switch at 3.3v and can handle more than 20v (though the MCC90N02, recently released, has specs to die for in DPAK, but 20Vds maximum), as the DPAK version is being discontinued too.
So, if you think you ever might want to switch a load too heavy for a SOT-23 FET (those cap out at ~6A, manufacturer-spec-numbers, which one should never expect to push to the max) with an Espruino, and don't want to commit to the expense and complexity of a gate driver, and don't have the means to solder weird parts like Power-TDSON-8, you should order some with a sense of urgency!
Yes, I am aware that $parkfun says that you can use an FQP30N06L with a 3.3v gate voltage. The performance curves in the datasheet say otherwise - at least for loads that couldn't be handled by the top-end, much smaller, SOT-23 fets...
Just thought I'd let y'all know the bad news over here, since I clearly remember talking about it here - I think it's even in the MOSFET guide in the docs, assuming it hasn't been edited.
It looks like some functions are available - but it doesn't look like things were ever fully implemented - or if they were, they were not documented... http://www.espruino.com/Reference#ESP32
Damn, I've been away so long...
Once it gets going, the popularity is self-sustaining because everyone and their mom is making them in uber-mega-bulk. If you see a garbage-can shaped crystal in basically anything you scrap, you're basically guaranteed that it will be that frequency, even the el-cheapo ones from china with no markings on them. I think I have only twice (out of pulling like 20-30 of those things) found ones that weren't, and those had the frequency clearly marked. Also, the black 4-pin SMD ones (you know the ones I'm talking about) that you see all over the place are also, almost always, 32.768k too - just depending on whether their process is better suited to SMD. You also see garbage-cans on their side with the pins bent into a shape such that they can be surface mounted pretty often too (though I wouldn't use one in a board I designed - I'd use a black 4-pin one (note that there are only two unique pins - I forget whether they're tied together in pairs, or if two are NC - they're not a powered oscillator like many of the flat ones with 4 pins and that distinct shiny metal case (though some of those are just crystals too; for a while I used to pull those - they're surprisingly expensive, actually). But since I started making and selling boards, I have turned against using pulls - literally the only time I will use pulls now is if something mission critical failed, and I had no choice. Like the time I brought everything I needed to do a bunch of AVR development over my 1 week summer vacation, specifically some stuff regarding external crystals - but then realized I'd forgotten the 22pf caps for the crystals! So we went to the dump and raided the e-waste trailer (we = my father and I... thinking back, I'll bet back then he was just getting into his obsessive focus on SMPS's, so he wanted to get stuff to examine the SMPS modules anyway - dear god, at one point he literally had 30 computer power supplies stacked up. Eventually he decided he understood it well enough after obsessing for a year or so, and disassembling a dozen or two SMPS's - the computer supplies are kind of boring, because they're all the same inside anyway - what was a lot more interesting was random consumer electronics), and tore them apart when we got home, and I found my pair of 22pf caps and proceeded with my project... or the time when I was going from the summer place straight to my first job interview, but we lost the charger for my shaver... so we pulled a pot and a 5v supply and manually adjusted it while monitoring voltage to charge the battery so I could look sharp for the interview... (now we have a stash of parts there, of course - including at least one Espruino!)
And yeah, the fact that a binary counter can be used with them and easily convert to seconds is HUGE.
The one annoying thing is that there are 1000ms in a second instead of 1024; I do one thing where I prescale the clock by 32, then (since it's on an 8-bit AVR - no hardware division (like, I was thanking my lucky stars we had hardware multiplication :-P), so in a timing function, doing that to an unsigned long is right out the window! I think I right-shifted it 6 places, subtracted that from the original, then rightshifted the already right-shifted one one more place, and subtracted it again, and that gave me my millis() implementation...
But what was interesting when I tested it... it was WAY off, and I deduced that the half-assed way in which I;d connected the crystal was killing the accuracy because the stray capacitance was way wrong. That's one thing I wish I had a heuristic for, calculating how much stray capacitance I have, so I know what value caps to use (the datasheet warns several times of the importance of getting the capacitance right - at least for parts I'm working with now) - since I'm now making and selling boards, I kind of want to not completely bung it!
And the final aside I was getting to... the part I am focusing on now, it doesn't have a high-speed external crystal, it's internal oscillator only (atmel-now-microchip's AVR team broke up with MHz crystals a couple of years ago), but obviously they have watch crystals, and a proper 16-bit RTC timer now so they can use them (instead of the old atmega halfassery with the async 8-bit timer2)... naturally, customers buying their new flagship product want accurate clocks... they have what they call "autotune" (lol) - you put a watch crystal on it, and it counts clocks, and dynamically recalibrates the internal oscillator! Haven't played with it, since I went down a rathole with programming tools that I'm just emerging from - but if it works, it's damned cool. My breakout boards for those take garbage-can-shaped through-hole ones (all I could route) but I really wish I was able to calculate whether I had the right caps on it...
My god, why did I write this essay in a 2-week old thread, lol... I think I wanted a break from what I was doing (I feel bad for switching to Arduino for most tasks - I do still use Espruino for web stuff - but I'd have never gotten into the hobby and had all this fun if it weren't for Espruino. It is such a great way to get comfortable with how digital electronics work... but I've come to absolutely love the parts where I can work really close to metal, which requires the parts be simple enough that I can hold the concept of them in my head. Those who remember me may recall that quickly gravitated to getting low level within the Espruino VM....)
You will also probably have better luck with a PC instead of a mac. Macs are really picky about stuff, and they hate people doing anything other the basics with it.
Also - how confident of your soldering to the mic wires? That kind of wire is insanely hard to solder to - the enamel on the wire is nigh impossible to remove.... we have tried chemicals, a guy I knew (for whom a sololution meant several thousand dollaert of otders) did a chloroform synth (where you mix pool shock solution and ice, in an ice bath, and slowly add acetone to it; if you keep it from getting so hot that it boils off the chloroform (it's highly exothermic solution), when you're done, there's chloroform at the bottom of reaction vessel). it didn't work - I have no idea what the now-banned enamel stripper contained (if anyone knows, please tell me), but whatever it was, it was good stuff!
The only way that I know that will definitely work to strip it is to melt a pot of eutectic NaOH/KOH mixture and dip the ends in that; you of course need to make sure the container can hold it; it will attack almost anything, including glass (i worked with this doing my masters thesis - it would dissolve the glaze on the crucibles I tried to melt it in, and it trashed a YSZ crucible too). And of course, then you have a pot of molten lye on your desk (and, by the way, when not in use, you need to protect it from moisture in the air, as the hydroxides are extremely hygroscopic..... I have thought a lot about this, and it bites the big one.
Waaaaay back in the day there was a long discussion about this, IIRC. I remember discussing this behavior on the original espruino board not long after I got it...
I really wish the STM32 datasheets were a little easier to work with (I remember looking at it back then) where all the info you needed was in one document, with sections only present for the peripherals on that part, like Atmel's datasheets - the STM32 peripherals absolutely bury the ones on the AVRs, and they're not really more expensive or anything.
If I had more time to work on my own projects, I would be using the hell out of that, heh... It's a really awesome tool. We gotta get more people using Espruino! Quite honestly, I think Espruino would be an amazing "my first hobby electronics platform" - the live console was just amazing when I was getting into electronics. I might well not have stuck with electronics long enough for it to get really fun, had I started with Arduino instead of Espruino - and that would have sucked, because I love electronics now.
It's kind of a pain to build Espruino firmware myself, since I don't have a convenient linux machine in my apartment, so I have to ssh into a linux machine (I use one on AWS, as that's less work than sorting out my home linux machine so it's not such a pain in the arse to use)
"i don't always test my code but when i do i do it in production"
That's how I do it :-P Lately on my Arduino cores, I've had 50/50 success rate with recent releases >.>
I dislike testing software - I always assume because I do that for my job. When you have a large enough crop of users, they test everything for you!
I don't know this is the answer here - but I know of one manufacturer - with the least creative company name in the semiconductor industry, possibly the entire world - whose serial numbers for at least some product lines, despite being stored as bytes, consist entirely of values between 0 and 99.
That said, if I ever saw a serial number printed by anything, and it started with a numeral zero followed by a lowercase b, I would have to excuse myself from any conversation I was having at the moment, becuase I wouldn't be able to hear the other person speak over the alarms blaring in my head....