-
Hi there :) !
Since the new year has been busy, it's been a "long time no update" on this thread, yet I have some neat stuff to share as well as, as usual, some more questions that awaits answers ;)
ps: I hope you did indeed have the well-deserved rest ;)
So, onto the good stuff:
- On the "hacked CNC project", I finally have some work done:
-> after receiving a drill, a drill support, some drill heads, some M3 standoffs of different lengths & corresponding nuts ( still waiting to receive M2 & M2.5 stuff yet .. ), I was able to build the structure of the CNC as well as have 2 of the 3 axis mounted ( and a power source from a scavenged dvd reader that fits inside the bottom of the structure, with access to the button on the front side of the CNC ).
-> while the 3d pen is hacked to provide the bare minimum in terms of fcnality ( in other words, "extrude" & "release", from the 2 push buttons already present on the pen ), I still have to investigate the pins on which I've soldered some headers ( ^^ ) as well as think about possible ways to modify stuff like feed rate, ..
-> still on the 3d pen side of things, modifying G-Code files to handle preheat/|status & wiring some stuff to the pen indicator LEDs || having the color(s) detected seems like some ways to walk along for a better yet still easy use of such off the shelf device ( .. )
-> on the more general hardware side of thing, I posted the complete schematic of the project at the following address:https://123d.circuits.io/circuits/1528073-yahc-yet-another-hacked-cnc-based-on-atmega328-grbl
-> I also had some thougths about the animated SVG: it could be quite nice to "simulate" the different layers of matter being added ( by splitting a drag&dropped 3d model into several SVGs, being animated in the way they're filled along with the movement of the different axis for ex ), as well as have the CNC SVG reflect the current position & status of the real one ( ex: to have a cam following the head is one [ nice ]thing, visualizing the movement & status at a glance in a
cute*crude SVG is another .. )-> also, while I did follow the link you provided on your GCode reader, I didn't took the time yet to digg into your code & see how I could add another axis & stuff ( .. ) :)
-> last but not least, I seriously plan to make the CNC wireless ( considering a WiFi serial bridge is easily done with our beloved ESP8266 ), but doing so I'd want to use this opportunity to add some simple yet useful features to the device:
- being able to either be driven using USB or WiFi ( probably an electron app / chrome app)
- control it & update the animated SVG in regards ( using websockets on the Espruino ? )
- updates the files on an attached SD card / list them ( for download or printing ) in the UI
- provide terminal-like interface to execute commands over serial / WiFi
=> the Espruino 'd "replace" the laptop ( streaming Grbl code to the ATmega328 ) as well as provide some control over Grbl remotely ( thx to Esp8266 ) & provide "SD file server" to list files, init prints, .. and a UI with said fcnality ;D
-> few pics of the current state of the CNC build & the 3d pen attached ;p
- On the "Resistor" project ( NodeJS module ), I plan to try applying what I could read on genetic algorithms ( the guy writing the tut used it to deduce the most compact ways to pack different shapes, or even where could fit the largest possible circle among other circles & how big 'd it be ) to find the possible solutions that'd most suit the needs ( be the closest possible value while keeping item count the lowest ) --> more on this soon ;p
*- Talking about cute, I have yet another project for which I have few questions, mainly focusing on power handling & battery charging ( I don't wanna mess with those .. ;p ):
You'll see in the attached pics a teddy bear I'm sewing ( name's Me4e ;p ), and that 'll be stuffed with a pico as well as a pienoze||speaker & a battery, as well as the sensors that are already built for the body & arms, the goal being to enter a pattern of squeezes on the arms & body which 'd trigger a sound playing ( & pausing the sensors while playing to resume them afterward ).The schematic is already done for the most part, but I'm not entirely sure of the best way to power the Pico as well as recharge the battery safely without software to do so ( handled on the hardware side by an Adafruit LiPo backpack ): in other words, I don't know whether to build the powering part of the circuit as the version hosted on the 123d circuit link below:
https://123d.circuits.io/circuits/1545230-i-me4eor as: ( "LiPo" is the Adafruit LiPo backpack circuit ), without shorting the FET/B0 jumper
Pico 5V <---> LiPo 5V ( charge )
Pico Bat <---> LiPo BatFrom what I currently understand, it would be simpler than in the circuit hosted, which relies on a USB port line ( -> btw: relation to B0 ? )
Anyway, I need to provide a female USB port to the device, so the Pico 'll have its USB port plugged as well ( the USB part of the circuit let untouched, except for the part that checks if we have a voltage on the USB line), so it's more a question of knowing what to do than of trying not to touch the USB line(s) ;p
( although, the most simple/tiniest circuit are always welcome as usual ;p )Lastly, I was wondering how to keep a uC powered up after some switching off had occured ( ex: to play a goodby sound & do some cleanup/halting routines before actually powering it off ). You'll see a quickie of the idea in the bottom-right corner of Me4e's schematic, from which I'm sure you'll think of a [ wayyy ? ] simpler version considering the Pico as the only hardware on which this 'd be tested ( by now, yet these sort of stuff could be indeed useful on the RPi & others as well, where I'mm pretty sure they're already been implemented .. anyway ;) )
And, "what needed to be done" [ and what 'll have some rework ]: as I couldn't import the Eagle files of the Pico on 123dCircuits ( need the .sch file it seems -->https://123d.circuits.io/eagle/import ) , I added it* ( https://123d.circuits.io/components/1544978-espruino-pico ) to have clearer schematics ;P
- the PCB view pinouts are WRONG ( MY fault --> I didn't take the time to get the correct alignments, I just wanted the schematic view for now ;p )
- On the "hacked CNC project", I finally have some work done:
-
Hi there !
[ I hope you won't see this message after I write it but instead keep on resting ;p ]
A few [ very little ] updates on the project:
- I bought myself a drill (!) for Xmas ^^ ( Ryobi rpd500-g ) + a stand, so now I'll be able to drill holes in stuff without borrowing someone's tools :D
- As I'd need that later, I wrote down a little doc on the main dimensions of my version of the Hacked CNC ==> http://stephaneadamgarnier.com/HackedCNC/HackedCNC_tefDoc.pdf
- Then, as I couldn't do much on the hadware-side of things ( aka, I'm still waiting the standoffs & other stuff I need to have those axis correctly & properly positioned ), I had a littl' fun with the SVG I had from Illustrator ( & also learn a bunch of stuff on how Illustrator DOESN'T handle stuff as you'd expect when applying 3d effects ( I could do da whole writeup on this by now .. ) ) ..
.. so I wrote a quick [ & very naïve ] CNC js obj & had it "pseudo-parse" pseudo-G-Code ;p
==> http://stephaneadamgarnier.com/HackedCNC/wip2.mp4
nb: It doesn't hang on the actual animation, juste when recording the screen at the same time with all the stuff I have open ( .. you'll even see some Chrome Packaged App crashing while screencasting ^^ .. ) ;p
As you 'll see in the video, one of the nice thing is the ability to toggle between a 2d & a 3d representation while the SVG is being animated
I plan to add the ability to rotate around the "global" Y axis ( not the SVG's Y axis ), but this 'd require a different handling of stuff in code ( aka having one SVG for each axis frame, and not only one holding everything as by now ), although I'm pretty sure it'd work "right out of the box" ( being only matter of mapping keyboard keys / mouse || touch D&D to update some CSS transform's rotateY() value ( .. ) )As soon as I receive the stuff needed [ & come back from the new year's stuff ;p ], I 'll update the project ( as usual ^^ )
See ya +
- I bought myself a drill (!) for Xmas ^^ ( Ryobi rpd500-g ) + a stand, so now I'll be able to drill holes in stuff without borrowing someone's tools :D
-
Hi there everyone, and a merry Xmas for yall :)
Gordon, thanks for the Espruino project, and all the work you put at it: it's been really a fun tool to tinker with, and I can't wait to see ( / help building ! ^^ ) what's coming :D
I agree with @Ollie, and Espruino is already part of "my" mainstream ;p
ps: I'd have d been happy to port the Arduino keyboard library to Espruino ( as a Xmas present for us all ^^ ), but I didn't have to do so ..
.. so, see you next year ? ;pHave a BIG rest, you deserve it .. and you'll be more than ready to overflow us with niceties ;p
+
-
Hi there !
I just took a "somewhat quick" look at what you've done so far using that plotter as laser cutter & the code beneath it ( loading from SD card is a neat feature ;p )!
Nice work done on that !When you say "wouldn't be quite as good", do you implicitely suggest the many / skilled people behind the Grbl project ( & the many version updates ) or think hardware-side ( aka an Espruino implm of Grbl would be a little less fast / introduce unwanted delays ? )
I guess for now, I'll complete my wip setup ( in the photo ) with an ATmega328 to replace the currently used Ar. UNO, but I'd find pretty neat to gave some Grbl Node module to control some Espruino Grl module .. ;P
My current setup ;pOn the "Resistor Calculator" side of things, don't you worry, I may get hints from friends of mine with a scientific background if not too busy themselves .. or I'll just do as usual .. digg deeper & hack a way* out ;P
*understandable for my skillset ;)
Also, I still have to add the 'SVG generating stuff' to the module's code (..)Last but not least, as I wrote this little tool to help fix the "over voltage" warning messages I was getting with my tests with the SIM800L, I'd better finish that SIM800L module first before thinking about "upgrading" the Resistor Calculator code ;p
ps: I'm about to digg the Espruino graphic lib ;p
Keep up the good work +
On the picture:
- 3 hacked steppers scavenged from DVD drives
- 3 EasyDriver boards to drive them
- 1 ATX PSU with PS-ON jump-wired to Gnd, providing +5V
- 1 no-brand cheap 3d pen
- DVD casing to make the structure
To be done: - screw everything together
- build "spindle direction & enable" logic on protoboard to allow forward/backward feed
Nbs:
- no laser by now, but I have some littl' drilling set & "shaft chuck collets" coming
- 3 hacked steppers scavenged from DVD drives
-
Hi there !
Sorry for the delay, 'didn't have time to do personal stuff recently ( .. )
for the
still_waiting_for_more_infos
stuff, I got it from http://www.espruino.com/AT
Concerning the modules you bought, I'm sorry to hear you didn't get those to work using the link provided on the SIM900 module page :/
( I did also purchase one SIM900 module while getting those cheap SIM800L, but I didn't take time to test it, although I was & still am quite interested in the tts capability available on those .. and not, sadly, on the SIM800L .. )Whenever I'm back to interfacing the SIM800L with Espruino, I'll post updates on this thread & also on https://github.com/stephaneAG/SIM800L#espruino-sim800l-module-api
For the SMS thing, if I recall correctly I was about to / done implm some working code thanks to one of our prev talks, so I'll just digg my notes/code & update that as well as reflect the update on the github repo ( .. )
Nevertheless, I'll digg what you suggest to see if some have tried some fancy chars in their SMS, or even MMS ? ( .. )ps: after opening 8 dvd drives, & collecting 3 stepper motor-driven mechanism, I may be able to hack myself those tiny 3 axis thingy ;P
nb on the ps: it makes me wonder: would it be feasable to implement a Grbl in js ? ^^ps2: while not currently working on it ( I need more tiiiiime ... :/ .. ), I recently done some experiments with both NodeJS ( write a basic module, & learn how to write a C++ one ) & Electron ( github's NodeJS-based app framework ), and it was quite frustrating not being able to make that nodeJS module you wrote for Espruino working within Electron ( & looking online, it seems I'm not the only one experiencing this issue .. ): any lucky guess ?
Also, on a near subject, I really have to digg how to 'mix' some aspects of Chrome Packaged Apps with Electron apps: being able to handle weblinks is a must, while having native-like top menus is really neat & 'feels' native ( contrary to the way ChPaApps & node-webkit worked .. ).I think it may be done in several ways, one of hich may be spawning a Chrome Packaged App that handles weblinks within the Electron app ( if we can't make the Electron app direcly recognize chrome weblinks, which could be understandable )ps3: I almost forgot ;)
The other day, I was writing some silly script to deduce which combo of resistor values from a particular stack would fit the required value or be the closest to it.
The simplest fcnality was easily done after some tinkering ( "get biggers first" ;p )
Then, while this worked 'fine', sometimes, an alternative 'combo' allows ending up with less resistors ( for a remaining difference closests to 0, aka closer to the required value ).
I consider the above achieved, and after a slight mod of my script it could do that as well ;)
Now, when I'm back at it, I'd really love to be able to get the "best of both worlds" by deducing the 'best' combo in terms of "the less resistors used the better" in combining the above 'ways' of doing so ( ..).
I wonder how complicated it can get or instead how silly it could be, but I didn't finish my logic on paper to be able to implm some test code ..
.. be my guest ? ^^
https://github.com/stephaneAG/circuits-calculator/blob/master/wip_ideas/resistorsComboWIP.js#L355
( the NodeJS module is working fine, and before that I could even generat a poster-like of the resistors I own by hacking around chrome browser javascript console logs & imagemagik ;D )
https://github.com/stephaneAG/circuits-calculator/blob/master/wip_ideas/Resistor_nodeModule.jsI'll be back with updates as christmas gifts ;P
Keep up the good work + -
"wow" ^^ !
I'm overwhelmed by all those great answers ;)
@alexanderbrevig "FPGAs are configured; not programmed." -> indeed, and maybe I'm too scared to digg in lengty docs .. although I'll sure take a look at the fpga-shield & build log stuff :)
-
Hello there!
I was wondering how much work it may take to have a way to be able to program a FPGA [ using SPI ? ] from an Espruino ?
It may need a different set of "helpers" for different manufacturers/devices, yet a module could provide some overall architecture that may then support specific hardware ( .. )
Seeing the following fleafpgauno or fpga-shield, I wondered what it 'd take to replace the Arduino/AVR sid by a Pico ;)
So, possible ? already exist ? [ actually useful ? ] hints ? ^^
( or XC6SLX9 ebay ? )
-
-
All right !
So I guess I'll feel safe trying with different powering setups including powering both the Pico & the SIM800L module from the 1500mAh battery ;)
( anyway, I just added headers to be able to have less short-prone connections than with aligator clips .. if that's what has happened to my Pico's USB :/ )For the little protection PCB on the batteries, I'm pretty sure it's what's underneath the orange/yellow-ish side, with connected wires & JST connector ;p
( see pic for the 2 types of batteries I'll have fun with )For the breadboard power supply part, I did see some simple one on sparkfun & Cie, but yet never took the time to purchase/build one ( I kinda "borrowed" power from whatever was handy in voltage, before starting to use voltage regulators & other niceties as I was diggin' deeper in the "electronic pandora's box" ;P )
Noted!
-> I really wondered what was thatstill_waiting_for_more_infos
^^On the thread's project status / aside stuff somewhat related:
- I tried the codeurl=.. stuff, that is soooo sweet :D
- I updated SIM800L with few examples & an API-like ref
- The schematic yaih was also updated but part of the connections to the SIM800L pins are not tested ( I'm not worried for the SPK+V out pin, more for what expects the MIC +V in pin ) - this part of the circuit is supposed to actually allow two individuals to speak over the phone<->intercom, whoever initiated the call, aka via SMS/Call --> intercom or Ring-pattern --> SMS/Call ^^ )
- any hint on sending a PDU SMS or at least a HEX/UCS2 Text SMS ? I remember having coded stuff on that a whiiiile ago on Arduino or Android but can't remember on which I had it working / where my snippets hides ! ^^ ( nb: that's a pretty good excuse to digg up some forgotten treasures ;p )
For the SMS/PDU/HEX/UCS2 part, I found this tool pretty useful: smssplit
This lead me to the following conclusion in terms of writing :)// this one's easy echo -e "\x68\x65\x6c\x6c\x6f\x20\x77\x6f\x72\x6c\x64" // so is this one .. echo -e "\x00\x68\x00\x65\x00\x6c\x00\x6c\x00\x6f\x00\x20\x00\x77\x00\x6f\x00\x72\x00\x6c\x00\x64" // .. hey, I didn't know this one ^^ echo -e "\u0068\u0065\u006c\u006c\u006f\u0020\u0077\u006f\u0072\u006c\u0064"
nb: still I don't know [yet] how to write octals in bash :| ..
// not working :/ echo -e "\357\243\277" // 'd correspond to the following echo -e "\uF8FF" echo -e "\xEF\xA3\xBF"
Hence, I wondered which was the less intensive way of doing str ->hex/unicode or unicode/hex->str ( example usage hexStuff.js )
For the pics:
3.7V 1200mAh PKCELL LP503562 & 3.7V 150mAh XRT 701723 20151022 20C
( I guess the Pico wouldn't last long with the tiniest one if it ever powers up, but I intend to do tests with an ESP8266, why not flashed with Espruino ;p )Have a nice day +
- I tried the codeurl=.. stuff, that is soooo sweet :D
-
yeah, and we still consider ourselves as "evolved" apes, but less pacific/peace-smart than our hairy cousins ..
fingers crossed bullshit 'll stop, but we both know, they ain't have a cat to pet to fully embrace peacefullness ( .. )For the "damn you SIM800L" issue, I don't know how it happened, but yeah, it seems like so -> when plugged in USB to my laptop, the red light keeps being lit.
I just did what you propose, and I could indeed see the light goes off as I was connecting to either a 3.7V 150mAh battery or a bigger 3.7V 1200mAh, and after plugging in USB, I could connect to it on /dev/ttyACM0 & try
1+2
;)'Need a confirmation for a dummy-question-of-mine, though: it's ok to have Bat+V to battery +V, Gnd to battery Gnd, and be connected to USB at the same time ( for Rx /Tx ) ?
I'm pretty new to using batteries in my projects ( yes, true story ;p ), and from what I could read, aside from other things those "3.7V 150mAh 20C batteries" seems, for example, to be most used for powering RC controlled devices motors than uCs ( the "20C" thing ? )In other words, I don't want to risk the same "shorting 5V to Gnd" using a battery this time ( ' don't want it to be damaged .. or explode :/ )
Anyway, I guess I'll have to work on this Pico with a battery by now, as I really can't replace that diode ;p
Good news is, I'll order another 1 or 2 to to have them handy [ & support ] ;)With the AT commands, everything was fine except for the text messages, as even when using
ATE0\r\n
, they're still being split ( the text content resides after all the other crap ).
Now, your workaround seems quite useful, as I could use it to partially construct an obj acrosscb
calls:var SMS = {}; at.cmd("AT+CMGR=1\r\n", 1000, function cb(d) { if (d===undefined) ; // we timed out! // d is now the result if ( d == "AT+CMGR=1" ) return cb; else if ( d.startsWith( "<infos on SMS>" ){ // populate SMS SMS.date = .. SMS.senderNum = .. return cb; } else { SMS.content = .. console.log('AT+CMGR=1 result: ' + SMS); } });
Also, is the following actually doing something or just a nonsense ? ^^
// ( .. ) if ( at.isBusy() ) return cb; // ( .. )
I'll retry the SMS stuff / updating the wip module in few hours to reflect the tries results, still having a solution to make sure the SIM800L doesn't make the battery explode / burnout Pico stuff 'd be nice to have ( this being said, I actually don't know how I could have those shorted in the 1st place .. )
thanks for the troubleshooting ;p
-
Hi there !
-> haha, you're welcome, [ happy to contribute .. and can't wait to use it ! ;P ]
On the SIM800L subject, I got few stuff worked out ..
First of all, as I luckily had another Pico , I tried with it on Serial1 & B4 for the RST pin of the SIM800L module ..
.. and it seems to work, after some checks, and ALWAYS after resetting the module after connecting it to the Pico ( in other words, after whenever powering on the Pico ).
This may make sense / have stuff to do with the auto-bauder set by default on the module ? ( .. )
Also, the said-tests were done while getting power from a cheap USB<->FTDI adapter ( which was previously used to debug the module using 'screen' )Concerning the LED blinking of the module:
- it shall blink 8 times & then wait & loop when the module is booting/trying to connect
- it shall blink once every 3 seconds when the module has booted & is connected
In other words, only 2 blinks when powering it up seems to indicate not enough power [ or another error / faulty sutff .. ]
I'll try other tests while powering the SIM800L module from the Pico's +5V through a diode & see if it works flawlessly, and then back on the "original" Pico to check that out too ( the only "major" differences being the use of Serial2 instead of Serial1 & the presence of the SD card, but not on the same pins ).
Now, while I could quickly write a module to wrap useful AT cmds, there's one thing that I'm sure I can do better: parsing response from said-AT cmd:
For unknown reasons [ spoiler alert: that may be obvious ones .. ], I can't get up to the content of a message retrieved simply using an 'at.cmd()' call like the following(s)/* should the following work ? it never gets to the content of a SMS :/ .. */ at.cmd("AT+CMGR=1\r\n", 1000, function(d) { if (d===undefined) ; // we timed out! // d is now the result console.log('AT+CMGR=1 result: ' + d); }); /* I tried stg inspired from the following example */ // example at.cmd("AT+CMGR=1\r\n", 1000, function cb(d) { if (d===undefined) ; // we timed out! // d is now the result if ( still_waiting_for_more_infos ) return cb; // can 'still_waiting_for_more_infos' be any of the following ? else console.log('AT+CMGR=1 result: ' + d); }); // try 1 at.cmd("AT+CMGR=1\r\n", 1000, function cb(d) { if (d===undefined) ; // we timed out! // d is now the result if ( at.isBusy() ) return cb; else console.log('AT+CMGR=1 result: ' + d); }); // try 2 at.cmd("AT+CMGR=1\r\n", 1000, function cb(d) { if (d===undefined) ; // we timed out! // d is now the result if ( Serial1.available() !== 0 ) return cb; else console.log('AT+CMGR=1 result: ' + d); });
My current "solution", which is pretty hacky & not-clean-at-all ( even more if I can't set back the 'data' listeners that were there in the first place ( .. ) ), is the following one:
var buff = ""; Serial1.on('data', function(d) { buff+=d; }); at.write('AT+CMGR=1\r\n'); Serial1.removeAllListeners('data'); // buff seems to contain everything
Any hint on a simpler & cleaner handling of data returned through at.cmd() ?
-> It's pretty much all I need to complete the following ;)
SIM800L_moduleTesting.js
APIbtw: I achieved being thrown at the following ;P
Uncaught Error: Maximum number of scopes exceeded
UPDATE:
After trying to get power from the Pico's +5V, now it seems stuck with the red light on & not connecting any more on USB :(
Also, before the Pico did put on his red led, this is what was received over serial:"\x00\x01Áprø¢ÿ\f\x00ø!\x10\x05\x00H\x00Àøþ\x00\f\x00\b\x00\x00\x00\x00ø\x00ð\x00\x00\x00\x00ð\x01\f´\x01à\x00\x00P\x01ð\x00\x00\x00æ\x1F@\x01ü\x00\x00@\x04F¼\x10\bÈ\x11\b\x00æxÀ@\x10\x1Eþ\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00BU\x0E\x0B\x00\x00\x00\x00\x00\x00\x00\x00\x00BU\x0E\x0B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00BU\x0E\x0B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" <--- "\x00"
So ..
.. any advice on how to get my Pico back from the void :| ?Hoping there's no attempts on England ( or any other parts of the world, actually ),
Your hints are more than welcomeThanks +
- it shall blink 8 times & then wait & loop when the module is booting/trying to connect
-
hello ;)
I digged a little in the Web ide source code , & added a quick update to "urlHandler.js" to have these
Load this into Espruino
buttonsSupport is added to handle "http://www.espruino.com/webide?codefile=" URLs, which seems cleaner that using the same "http://www.espruino.com/webide?code=" URL & looking for some 'http..' prefix ( I had to choose, but we could also have both a 'general' URL handler & 'dedicated' ones as well ? ( .. ) )
=> Now we can have that Cake ! :D
Send stuff to Espruino !Also, I got no luck with my tests with the SIM800L:
If I use the following code in the right pane of the web IDE, I can get a correct output .. which shows an error:Serial2.setup(115200, { rx: A3, tx : A2 }); Serial2.on('data', function(d) { USB.write(d); }); // log stuff received from SIM800L to web ide console USB.on('data', function(d) { Serial2.write(d); });
ouputs the following, when I short then release RST to Gnd:
F1: 5004 0000 F8: 380C 0000 F9: 4800 000B F9: 4800 000B F9: 4800 000B F9: 4800 000B 00: 102C 0004 01: 1005 0000 U0: 0000 0001 [0000] T0: 0000 00C3 Boot failed, reset ...
So, 'yay!' -> some output is better than no output, but I can't investigate/test AT commands if the module can't boot properly ..
What's weird, though, is that I had the same error when no providing enough power to the module, which was solved using +5V & a 1N4007 diode, but here I get the same faulty output either powering the module from Espruino's +5V through diode or another USB port + separate +5V ??!The LED either pulses twice when getting power from the Pico's +5V or 8 times when getting external power, but either way, always faulty output :(
-> I'll try diggin google to find more on this, but if you have any though/doc part I'd be interested in, feel free, you're more than welcomed ;pLast but not least, I made a commit for the said update of the web IDE -> can't wait to use it ;p
+
-
I updated the code hosted on the repo by a working one ( although I needed to add more
=undefined
than expected( .. ) ), and also added a link to send it directly to the Espruino web ide ;p-> on this: do you plan on adding another 'API-like' handling for weblinks to the Espruino ide ?
=> aka, stg likehttp://www.espruino.com/webide?codefile=<..>
additionally tohttp://www.espruino.com/webide?code=
, to be able to just pass the url of a file hosted on github, for ex ?For the above, you're right: I was tired & didn't recall one of the differences between left & right pane .. sorry for that :/
For the SIM800L stuff, as I get no troubles loading either the AT or SIM900 module(s), it may seem the SIM800L module isn't getting enough power ( I just did a loopback test beteen A3 & A2 to check if they were ok & they are, while I only have two brief pulses of the LED on the SIM800L module )
After digging the above & adding some basic code for SMS/CALL handling, all that's left to be done is finishing the circuit(s) & the project 'll be pretty much wrapped up :D
-> I'll continue diggin that tomorrow, hoping to have that baked in the evening ;p
See ya +
-
Back !
Haha, thanks, I get it now ^^ !
-> I didn't bother setting them to undefined as it worked on the browser ( & I naïvely though it 'd do the same "as is" on the Pico ), but after re-reading the original code, you DO indeed set the (unique ) timeout to
undefined
;)function onTimeout() { timeout = undefined; // check against our code // ( .. )
For the different behavior ( read "different handling of supposed-implicit-undefined stuff") on the browser, IYO does it means/implies that browsers evaluates the js code in a quite-similar-yet-different manner ?
Since the code worked flawlessly on the browser, I don't see many other possible reason(s) ? :|=> I'll update the code hosted on the repo & flash that to my Pico to check it out* :D
Also, "last but not least", I received the SIM800L module I ordered, tested it quickly with
.. BUT ! -> it seems that I can't use the "AT" module on the Pico ? When I tried quickly before having a nap, I ended up having the following logs:
var at = require("AT").connect(Serial2)
ERROR: Unable to mount SD card : NOT_READY
WARNING: Module "AT" not found
Uncaught Error: Field or method "connect" does not already exist, and can't create it on undefined
at line 1 col 23Same error when trying to use the following
var gprs = require('SIM900')
```Concerning the "ERROR: Unable to mount SD card : NOT_READY", I guess it's because Espruino tries to look for a connected SD card which may contain the module that's being loaded, but no idea why I wouldn't have the above modules
-> I see 2 possible solutions here, either DL the module & host it on the SD, or pass a remote url to therequire()
call, but wouldn't simply updating the Pico's firmware do the trick ?
( I don't know how recent is the implm of the AT/SIM900 stuff ;| )Also, concerning the SIM800L module, I don't know if it had enough power to work correctly when powered from the Pico +5V through a 1N4007 diode ( voltage required is 3.7<->4.2V ): it worked correctly using that setup when connected to a laptop, but with the Pico setup I have already an SD card to power, hence my question: did you have this type of issue when having fun with the SIM900 ? :)
- with a wire .. and with the intercom ringer ;p
The attached images are posted as an update to the project.
The repo containing stuff for the SIM800L is the following SIM800L
The other repos stays where theybelongare & 'll be updated - with a wire .. and with the intercom ringer ;p
-
yes, it SEEMS to work fine, but when entering "codes", the "inactivity timeout" throw an error, and so does the "shortestmatch timeout"
Did you logs pass well without errors when you tried ? ( or maybe you just copied/pasted to check the code evaluation? )
thanks ;p
shortest code match found ! 1 2 Uncaught Error: Unknown Timeout at line 7 col 61 ...imeout(shortestMatchTimeout); ^ in function "onPress" called from line 5 col 28 if(timeDiff>0.1) onPress(); ^ in function called from system 3 Uncaught Error: Unknown Timeout at line 5 col 35 if(timeout) clearTimeout(timeout); ^ in function "onPress" called from line 5 col 28 if(timeDiff>0.1) onPress(); ^ in function called from system 4 Uncaught Error: Unknown Timeout at line 5 col 35 if(timeout) clearTimeout(timeout); ^ in function "onPress" called from line 5 col 28 if(timeDiff>0.1) onPress(); ^ in function called from system
-
Also, here's the circuit implm of the optotriac part, and the 2nd pic is something I just received which could be part of neat nex step(s) ;P
Also, here's the circuit ( can be found at yet-another-intercom-hack )
-
hello again :)
I'm using the optotriac with a bipolar junction transistor BT138 to short the "AP" 12V to Gnd, which triggers the ground floor door opening
-> I'm going to try again with a 10k on the BT138 pin that's controlled by the optotriac to see how it goes
-> also, I'm currently using an LED runnig from a 3V cell battery to simulate the "AP" being shorted to Gnd, so not quite the same setup than for my actual/final usageOn the code side, I edited the code hosted at SingleButtonCombinationMulticodesLock_Espruino.js, but it seems something's weird with the timeouts ( in addition to jslint's
!== 0
advices ) ?
-> the weirdest part being the same code works flawlessly when running from a webpage ?!=> if you had any hint on this, we could have it all ( aka clean working code .. to update the Espruino "SINGLE BUTTON COMBINATION LOCK" page with ;P )
( code that has issue with timeouts as attached file )
-
ok, little issue with the optotriac circuit: it turns on ok but doesn't turn off,even with a 10k pulldown resistor on its LED in pin :|
the code has been simplified & can be used as a very crude audio looper ;) (nb: not eyt using what you suggested, aka bit-by-bit buffer fillin' ( .. ) )
Now onto testing the "Single Button Combination Multicodes Lock" on the Pico, and then mixing it with the rest of the code & connecting it to the intercom for some further "remote" testing ;p
+Gordon: for the finish stuff part, nevermind, silly error no my side & I thought I had removed it from my post ( the updated/cleaned code make uses of it for recursive callbacks )
-> now, I wanna know what's that tune you took as an example ^^ -
-
aha, thanks for the quick answer: I've been looking for that
= undefined
( I've been wondering how to release the file read using "readFile()" & the associated memory , but had no.close()
function, and I didn't digg .. I must have skipped that part while reading the Waveform page :/ ..)btw, anyway to call
.onfinish = fcn
if playing audio as above ? I couldn't get it to work when I briefly tried while after finding about itFor the "read waveform into waveform.buffer a bit at a time", It's a nifty idea, I'll test that after concluding the above tests ( code should be close to the double-buff example I guess )
For the SD->flash stuff, it was mainly needed as I wasn't aware of using
= undefined
to release stuff from mem, but playing audio stuff from the flash directly is still quite nice indeed ;).. onto test(s) ..
-
Hi there !
[Also, see last post on Esptruino SD card]
Yup, it's getting somewhere, but the "OUT OF MEMORY" messages from the audio part is sometimes driving me crazy ;p
-> For +Sacha's posts about the Pico flash stuff, this is truly great, and as you say it could be pretty interesting for my needs ..
.. now, what could be totally worth it 'd be being able to read a file from the SD to the free flash, ( maybe using a littl' buffer but not consuming all of Espruino's memory ) & then play it "directly" from the flash ? => aka use the flash's stuff as Waveform buffer ?
My point is: while I'm testing playing random audio files off the SD, I have two "issues"
1: can't usew.on("finish", function(buf) { .. });
when using 'readFile()' ? ( it doesn't seem triggered .. )2: "OUT OF MEMORY" error -> may be overcome by using said-"double-buffer" ?
-> the code throwing the said "OUT OF MEMORY" error is the one attached ( used for testing the audio files )-> I'll be testing the code that triggers the ground floor door's optotriac in few minutes, & then the two last steps be mixing it with the morse-like patterns matching code & finalizing the schematic part with the added RC timing circuit ( .. )
-> right after checking the optotriac's code, I'll give few tries to the buffered audio, and if I got time in the evening, I'll be digging what can be done to easily play audio from the flash ( .. )
=> Nb: what could be done, if nothing else could allow bypassing that "OUT OF MEMORY" error,is just: on code match => select appropriate random audio/load it/play it/open door/reboot ( via "save()" )
-> since rebooting the device is quite quick, it is not that cumbersome to reboot after each door lock ( nb: also, if I don't add the RC circuit, the Espruino 'll be powered off then on whener the ground floor door is opened, but in other situations, this is not considered a "feature" ;p ) -
Hi everyone !
The following thread is about hacking an intercom .. using an Espruino Pico
( aka "yet another iteration on the Intercom Hacks for the HaD readers .. ;p )Simplest functionality planned:
- watches ringer and look for codes/patterns
- trigger relay
- play sound from SD card
Further mods:
- replace original ringers beep-that-makes-my-ears-puke by a sweet-sweeet melody
- add ESP8266 to trigger a notification on my laptop
- add hacked GSM / GSM shield to send text messages
Now, this project is huge wip, considering the code parts are yet-to-be-merged, and that the actual circuit is being tested with various components ( if can do, less bulky ones, ex: replacements for the current relay .. )
The project can be tought as three main parts:
1: morse-like codes/patterns matching:
Handling this was quite easy, since the code needed for that had been provided in the "SINGLE BUTTON COMBINATION LOCK" tutorial ( Single Button Combination Lock ), although, the "NEXT STEPS" 'd have been controlling a relay in my case, not a lock ( no real difference at this abstraction level ;p ).
Last but not least, as I wanted to be able to handle multiple codes that could share same beginning codes/patterns while still being able to vary in length, I ended up writing my "1st next step" from the original code, behaving as exposed + handling an "inactivity timeout" ( & some more things to come maybe ? .. ), which is hosted at the following url:
Single Button Combination Multicodes Lock2: playing audio from an SD card to the original mic line:
Thanks to studying my intercom, the other Intercom hackers notes & having nice answers from +Gordon, this part is almost done, but still needs some code cleaning/optim not to take up too much memory on the Pico3: triggering the "AP" ( ground floor door lock ) & listening to the "CA" ( ground floor call in ):
After identifying the purpose of each wire/line, it's pretty easy to deduce how to trigger the said-"AP" ( by shorting the line which has the highest voltage present to the Gnd one ), and how to listen to the ringer/bell ( needs a cap to keep DC only & few discrete components to lower/clamp the voltage to an acceptable "digital 1", aka min 2V, max 3.3V )
Nb: if some stuff's not here [ yet ?], it may be there:
https://123d.circuits.io/circuits/1176710-yet-another-intercom-hack - watches ringer and look for codes/patterns
-
Hi there ! :D
.. talking about rushes .. I've managed to extract myself from one ;p ..
-> First of all, sorry for the late answer, & thanks for the great answer ;)
-> The "bypass original mic audio" works FINE ! ^^
I ordered 2 PAM8403 boards ( considering the price ;p ), to have them handy, but using a BC547B worked flawlessly, with a pretty good quality & being actually pretty loud ;)-> I 'll be testing the replacement for the relay this evening ( MOC3022M + BT138 )
-> "For the sake of clarity & Cie", I'm about to create a thread in Projects explaining the project, its current status & the bits that are left to be done, as well as links to the code
-> Also, the test-code I wrote quickly to get an array of audio files from SD to randomly play from 'd surely benefit from refactoring to fit in wih the rest ( more on the Project thread ;p )
This being said, last few hours of work & I'll be back uploading stuff here ( .. )
=> Also, I am working on some other handy stuff on which I'll be giving updates soon if it can be handy to one of us* :)
https://github.com/stephaneAG/circuits-calculator- no moz-.. prefixing for the moment, and is fine on tablets but 'got to re-implm the touch handling to be less "overkill" ( used a lib for quick POC ;p )
This being said, keep up the good work ++
ps: 'stumbled upon the memory page stuff you were talking about -> neat, can't wait to test that ^^
- no moz-.. prefixing for the moment, and is fine on tablets but 'got to re-implm the touch handling to be less "overkill" ( used a lib for quick POC ;p )
Oh,and by the way ( while I'm at soldering the stuffing of Me4e ;p ): do you have any hints on interfacing the following electret mike breakout ?
http://makersify.com/products/adafruit-electret-microphone-amplifier-max4466-with-adjustable-gain
-> if so, I mmay as well give ears to the littl' guy ;D
The following link is the only thing I could find on using the Espruino for audio input stuff
http://forum.espruino.com/conversations/271687/
Thanks ;)