Pixl.js with Wifi (ESP8266 ESP01s) - SOLVED

Posted on
Page
of 3
Prev
/ 3
Next
  • @Robin,

    not at all: filter / block cap would be to small... 47u is a lot or more than enough... in some other place - same chips -Espruino on ESP8266 ESP-09 - 1 powerful cm2 I went even more over board: 2202u - haha - but the powering was different...

    150mA is for sure not enough since the spike pushes towards 500mA - more details at ESP8266 killing itself? on http://www.ondrovo.com - Article published 2017-02-05 by Ondřej Hruška. (Was first useful link I found... and turned out quite a good catch, because:) Even more details on this site: Determining the ESP8266 power consumption. Attached a visual summary...


    1 Attachment

    • ESP8266_PowerUpDraw.png
  • Any idea what changed? I thought you said you had it working?

    Is it possible that it got pushed around in your bag and one of your solder joints came loose?

  • @gordon Nothing changes.
    1) I had it working perfectly at home.
    2) Went to work (and did "throw" it into my backpack. but it looks fine
    3) tried to connect it to my phone wifi. and it started giving the error. Tried work's wifi same error
    4) Got home (said maybe there's something it likes about home) Same error (no 'reset')
    4a) tried reapplying the solder iron to make sure everything was well connected and I hadn't moved it away.
    5) went to the convention (no password on the wifi). Didn't work
    6) Tried a bunch of different options. debugging debugging. BLAM it starts working. Try it again. still working. "save()"
    7) turn it off and on again. NOPE.
    8) and I cannot get it to work.

    I tried lightly pushing it to see if it was slightly off. No good.

    @Robin - This is the "new" badget, not the pixl.js with a wifi shield. (I didn't get to that since I was still trying what should have worked)

    @allObjects I can try what you suggested with the capasitors. but haven't had a minute to do it.

  • Sat 2019.12.07

    Geez @Damian that must have been quite a "throw" ;-)

    It is most unfortunate that the electron God's are not with us on this one. It has been quite a while since I have seen such sticky troubleshooting required like this in an electronic device.

    Confirming: So that we are all on the same page, by "new" badge we are referring to the first Nodeconf badge with the new 8266 soldered in attached to a WiFi shield? (rules out the under sized regulator path)


    Does removing the WiFI shield allow any code at all to run reliably?


    'Got home (said maybe there's something it likes about home)'

    Maybe it's the thought of actually 'having to go to work' ;-)


    '4a) tried reapplying the solder iron'

    I checked the images from post #14 and a very nice solder job (solder flowed and shiny) there, so it most likely isn't a cause, but was smart to at least consider and try.


    'Try it again. still working. "save()"'

    Could it be in the way the init function is called when using save()? Would you mind posting the few lines of code section for E.on('init'

  • @robin
    1) By "new" I meant the NodeBadge but not from the conference. the one from the espruino shop but that (like we established) has the pins in the correct location for a simple ESP01S to be soldered in easily

    2) The Espruino Badge DOES seem to be working perfectly. And I would guess the ESP8266 does two but it just looses power (my guess)

    3) I've love to try anything you'd like. I wish I could leave it turned on and open to the public for anyone to run things on it (guess that'll be ver two of the IDE gordon made)
    Just tell me what you'd like me to run and I'll run it.

  • Sat 2019.12.07

    Line #6 in post #28 is the puzzling one. If 'save()' is truly killing the ability to then power up consistently, it seems that the 'init()' may not be running on power up.

    'debugging debugging. BLAM it starts working'

    I suppose there might be something in the WiFi section, is there any additional detail in:
    WebIDE >> Settings >> Console

    Other than that, it might be time to post all the code for others to take a peek at.

  • @Robin
    'save()' is not affecting anything. Sorry I mentioned it. you can ignore it. I was simply trying to share that it seemed to work for a second or two.

    day 1 - working flawlessly for hours. Went to sleep happy.
    day 2 - not working all day (no changes. getting error: "No 'ready' after AT+RST")
    day 3 - still not working all day. I try different things. No go. try one silly thing. It worked. Did a "Save()" then power cycled it (turned it off then on again) it no longer works. Try a bunch of things and cannot get it to connect to ANY network any time any where.

    Here's the code:

    var WIFI_NAME = "ValidWIfiSSID";
    var WIFI_PASS = "CorrectPassword";
    D9.set(1); // power on
    Serial1.setup(115200,{rx:D0,tx:D1});
    console.log("starting wifi");
    var wifi = require("ESP8266WiFi_0v25").connect(Seri­al1, function(err) {
      if (err) {
        console.log("oh no" + err);
        throw err;
      }
      LED1.write(1);
      LED2.write(0);
      console.log("Connecting to WiFi");
      wifi.connect(WIFI_NAME, WIFI_PASS, function(err) {
        if (err) throw err;
    
        // I don't get past here. I error out
    
        LED1.write(0);
        LED2.write(1);
        console.log("Connected");
        getPrice(); // I get the price of bitcoin and display it.
        setInterval(function (){
            getPrice(); // get it and display it
        },120000);
    
      });
    });
    
    
  • Damien, my apologies, just don't have enough time right now. Hoping someone else has some ideas.

    In the meantime, some thoughts to process:

    I do see suspicious code L6 and L14 with the nested connect() function. Do you have an example or tutorial link that is being worked from?

    I remember STA and AP mode being an issue for me and several were able to provide ideas that got me running with the 8266. These might give some ideas to try, until someone else is able to respond.

    http://forum.espruino.com/conversations/­300549/
    http://forum.espruino.com/conversations/­299987/#comment13465364

    Also noticed function getPrice() isn't defined, maybe because of personal security, but could that be locking everything up? Suggestion to place console.log() statements to see if execution progresses passed L21. Comment out L22 and L24 and replace with console.log()

    Is var wifi equal to anything, or is it null/undefined after L14

    L4 are D0 and D1 defined somewhere else and pointing to correctly wired pins? What is the result of pinMode()?

    and, no init() function should save() be used.

  • @DamianMontero,

    your code id correctly structured:

    1. connect is for connecting Espruino serially with the ESP8266
    2. connect is for the wifi connection of the ESP8266 with WLAN

    Code is taken from a different board and example.

    digitalWrite(B9,1);
    Serial2.setup(115200, { rx: A3, tx: A2 });
    var wifi = require("ESP8266WiFi_0v25").connect(Seri­al2, function(err){
      if (err) throw err;
      console.log("Connecting to WiFi");
      wifi.connect("SSID", "PASS", function(err){
        if (err) throw err;
        console.log("Connected");
        require("http").get("http://www.pur3.co.­uk/hello.txt", function(res){
          console.log("Response: ", res);
          res.on('data', function(d){ console.log("--->"+d); });
        });
      });
    });
    wifi.at.debug();
    

    Try using wifi.at.debug(); to get more details out of the communication between Espruino and ESP8266.

    I hope the your .getPrice() thing close the http request everytime you make the access and tries not to start over all again.

    What I personally do not like is that wifi stuff is not in an onInit(). If you put it in one, declare the variables outside of onInt() and used inonInit().

    Then upload the code. Nothing will happen yet... intentionally. Then you save "save()" in the console: this will save the code in the flash (assuming you have 'no save on upload configured in your IDE), and when done, it invokes onInit(). This way you make sure that nothing runtime is saved that is not run thru and initialized when power-cycle it.

    I had no issues... the code structure is solid with the error handling... What you could think of is to do retries on error with a setTimeout() (and clearing stuff up that may be pending). I think the connect to ESP8266 is repeatable, for the connect to Wifi I would first issue a real/complete disconnect and catch eventual errors...

  • I'm very appreciative of the help, but I'm pretty sure the code is not the issue.
    I say this because the code hasn't changed between it working and not working.
    I've started with the code from the example provided by gordon that on day one worked perfectly but now the exact same code has the same error as all the other codes:
    http://www.espruino.com/Pixl.js+Multicol­our#esp8266-wiring

    @allObjects I have tried your code but I do believe it's not for the Pixl.js (correct me if I'm wrong) and Wifi.at.debug() was not a method in the ESP8266WiFi_0v25 module.

    I haven't tried the capacitor which in my mind has the best chance since it's a hardware fix.

    Help me understand what could have gone wrong. I'll have to buy a new Pixl.js badge. Are they still available? And brand new ESP8266's and try this whole thing again.... :'-(

  • Thanks @allObjects the original example source and your explanation clears that up for me.

    What about testing to see if the Pixl is still sound?

    Try non-WiFi stuff such as the ready to go clock. Let it run all night and see if still active hours from now. Maybe the 8266 is flaky?

    http://www.espruino.com/Pixl.js+Clock


    'I haven't tried the capacitor'

    Wasn't the capcitor fix for the Pixl only flavor as it has a smaller regulator than the NodeConf Badge which was designed with a beefier regulator for this purpose?

  • @Robin
    I've put that on the pixl.js badge and will run it all night. There's no reason it won't but I do appreciate the help and I'm willing to try anything.

    The Pixl.js badget has shown no signs that anything is wrong with it. it's just cutting the power to the esp8266. I can see that.

  • it's just cutting the power to the esp8266

    Do you actually see the red led on the ESP8266 go out?

  • @gordon Yes.

    Here's the order of things.
    I turn on the Pixl.js badge (with the switch on the Pixl.js badge)
    The Pixl.js front red lights quickly blink.
    The ESP01S BLUE light blinks around the same time and pauses for about a second.
    Then the ESP01S BLUE light blink several times (I would say trying to connect) then suddenly STOP.

  • Hmm, that's really odd. As other have said a capacitor might help, but I thought I'd put some reasonable caps on-board to try and account of that.

    @allObjects suggestion of wifi.at.debug() is definitely worth trying as the ESP8266 might be trying to say something.

    Other thing I can think (which might be backed up by wifi.at.debug() is that if the board is dirty around the contacts, GPIO0 on the ESP8266 might be getting pulled down to 0v (you could try shorting it to 3.3v?) and the ESP8266 could be entering bootloader mode rather than WiFi mode.

  • wifi.at.debug() 
    

    gave me an error. The module looks to have a "debug"
    http://www.espruino.com/modules/ESP8266W­iFi_0v25.js

    but wouldn't I call it like:

    wifi.debug()
    

    I'll try that when I get home. and yes I have to find a capacitor and place it on there to see if it helps.

    ALSO I did measure the 3.3 and ground (using a regular multimeter) and I see it turn on. stay on and when the lights go out it goes down to 0v so it's being killed (or it's shorting)

    Please correct me if I don't understand anything hardware wise. I'm just reporting what I see.

  • Mon 2019.12.09

    'I'm just reporting what I see.'

    Yes and thank you Damian. We need exactly that. Imagine what is going through my mind attempting this without seeing/being there? Your responses are concise and complete. I believe we are at a point where most common options have been considered.

    The latter image post #14 showed nice clean shiny soldering. I'd still take yet another look with a magnifyer, both bottom and topside to see if there might be a hairline blob between pins. Image not at best angle for me to determine.



    Where are the voltage measurements taken? At J3 the 8266 8pin connector?

    Presumably there is content on the display. Does the LCD go blank at the same time the 3.3v measurement 8266 power pin goes to 0v?

    https://github.com/nearform/nceubadge201­8/blob/master/sch/nodeconf2018_sch.pdf

    Damian, does the display go dark along with the 8266 going dead, without any code running reset(1); save(); at all? e.g. Apply power and how long until 0v is detected? Maybe this is what is done in #39, but with code running?



    @Gordon, what are the chances the mfg made a substitution for the regulator, such as using the original Pixl one? and, . . . could this be going into shut down on an over current condition?

    As resistors are (in case being too aggressive smokes one or more) inexpensive, time to start hanging different loads on in order to determine what the regulator actually puts out before voltage droops? (hunch that when 8266 kicks in WiFi, the regulator is going into an over current condition)

    SIDEBAR: Any chance a table of datasheets for the regulators for each of the supported board types could be generated? If time too limited right now, DM the links and I'll create one similar to the Neopixel one to place in the Tutorial section. There has been a dozen or so requests over the last two years for uP pin source (is in STM dtasheet) and whether Neopixels can be powered off the board. Never have found that (regulator) detail on the site.

  • The regulator types are in the schematics, for example the regular Pixl.JS has a MIC5225 -> 150mA max.
    Unless it'a for example the nodeconf2018 badge, that is not there.

  • I did measure the 3.3 and ground (using a regular multimeter) and I see it turn on. stay on and when the lights go out it goes down to 0v so it's being killed

    That's perfect. Sounds like a hardware issue then, and I'd hope a big capacitor would go a long way towards fixing that. It's strange that it doesn't cause the Pixl itself to reboot?

    What happens if you measure the battery voltage when it happens? It's possible that there's an issue with the battery itself rather than the voltage regulator.

    You could try turning the RGB LEDs off (or dimming them) if they were on?

    I forget what's on the Pixl badge now. It was supposed to have an MCP1703T like is on the Pico (250mA average, 400mA peak) but I accidentally ordered the wrong package and we had to use another part in a hurry. As it happens that actually had a pretty good spec, it just had a higher quiescent current (but that's not a big deal for the badge).

  • You know @gordon the pixl.js badge doesn't even seem to flicker.
    and just a reminder on the first day it was FLAWLESS for several hours as I was coding.
    It wasn't until the next day.

    Now to be sure I'm no soldering expert so although I'm incredibly humbled if @Robin thinks I did a good job I had put in the ESP8266 wrong and had to unsolder and resolder so I know I very well may have damaged it.

    But there's no red light (the red light or buzzer or NOT on by the time the ESP8266 seems to turn on. and like I said it SEEMS to be happening.

    I haven't had the time to put on that capacitor. But I LOVE this group because everyone is making suggestions and working with me which is Why I'm already on my 4th Espruino products (love them all) and using a bunch of the full ESP8266 modules to do a big presentation at the next South Florida Dev Camp that get's about 1,5000 people to that conference. (I'm on the IoT track so I don't expect all 1,5000 people to show up. but if they knew what I know they would show up)

  • But there's no red light

    Is there not a red light on the ESP8266?

    It might be that the 3.3v rail for the ESP8266 got damaged. You could try wiring it in manually - maybe the easiest is to go across to the 3.3v on the DBG header.

    Also, great news about the dev camp - hope it goes well!

  • Mine has blue lights.
    One quick blink as everything is turned on. then about a second later nice flashing (like it's communicating. and then dead. like someone pulled the power cord less than a second after it did it flickering dance.

    ok. so you think I should botch a wire from the top 3.3v and ground down to the esp8266's 3.3v and ground.

    I was thinking that of that and was trying to hold wires (but I only have two hands so I don't think I got it working.

    As for the dev camp. It's in Feb and I'll make sure to post videos and photos on youtube and here for anyone interested.

  • Thr 2019.12.12

    I have been secretly hoping someone that has performed this upgrade would have piped in by now.

    'had to unsolder and resolder so I know I very well may have damaged it'

    If the iron was only in contact a second or two, I highly doubt it. As there is at least the blink of an LED, then the board seems to want to run. Damian, how long in seconds is this duration. To the others, what are the chances the 8266 hardware watchdog is resetting?

    For clarification, when the lot goes dead, as Gordon requested, does the Pixl attempt to reboot, or are we completely dead at that point? (I think the answer is YES as zero volts was measured with no additional comment - meaning no reboot)


    Damian do you have access to a regulated (bench supply) power supply? . . . . or, . . . do you have access to discreet parts such as voltage regulators and caps? Do you know anyone nearby or have access to students at an Electronics Tech school that have substantial troubleshooting skills?



    It could be that we are dealing with two issues. My biggest worry is the article that @allObjects posted in #26 with the 8266 requiring over the 250ma limit, even with caps, if only for the 40msec interval.

    Before doing the following, I'd get confirmation from others first

    I've not played with either but, if these were my boards, I'd try running off a bench supply to rule out battery/connector issues. Then if continuing, sacrifice a copper run adjacent to the power pin on the 8266 or pull/desolder the power pin to isolate power. Leave the grounds in place. Then run the 8266 off a separate supply so as not to affect the Pixl. The 8266 would then draw as much current as necessary without worrying about the Pixl.



    One final thought would be to post some super close up shots of the header to see if any of us are able to observe something out of the ordinary. We only have the underside in #14 post but that appears good, so the assumption is the flip side is okay too.



    Worst case - both boards are dead - not likely as it was indicated it worked for one evening

    Salvage case - cut out the 8266 and have a working NodeConf badge - chalk it up to an unresolved education

    Hopeful case - continue until the culprit is revealed



    I'll continue to hang in there until no other options reveal themselves or time/cost starts to bleed us both.

  • Fri 2019.12.13

    Well, this has been buggin' me all day. Until Damian responds. . . .

    Making an assumption that the power on cycle until shut down is around two seconds, it would not be possible to attempt the suggestion I outlined in #42 post. 'without any code running reset(1); save();'

    In this particular situation, the Pixl is never alive long enough to attach to and replace the existing code that was previously saved.

    As the parts are still attached as when they first ran a week ago, the board pair ran for a full day, save() was then executed and on re-power up, the failed condition now exists.

    Before any further hardware mods are made, it is time to look at the EXACT COMPLETE SORUCE that was last uploaded, unedited (exception - overwrite p/w with 'x''s). As a suggestion I made a while back indicated that the init mechanism wasn't properly being called before the save, it is quite possible that the 8266 never gets the proper start up code or is stuck in a setInterval() that never exits. Should WiFi be turned on continuously, (more than 50msec) the regulator will never keep up.

    Proving this however will mean having to separate the 8266 from the Pixl, either by cutting the trace or removing the board. Then after the Pixl boots, use reset and save to start with a cleared memory. Then apply a solder dob across the cut trace to re-apply power to the 8266. Reboot and see if both stay active with absolutely no code running. The simplest next step is to first revisit the code. (and as it is Friday the 13th)

    @DamianMontero, please post the entire file.

  • AHHHHHH!!!!
    I hadn't had any time lately (holiday and all) to do all the things you all suggested, but I had to do something. So I thought I'd record the lights. And BLAM it's of course working.
    https://youtu.be/Y5T9Tj9XmiU

    OF COURSE UNTIL THE NEXT Day (actually until the next Save() but I don't think that's a factor)

    It's dead now
    https://imgur.com/gallery/Ud6wKhX

    I've bought 3 more ESP-01s (the ESP8266 modules for this) and I'll buy another badge and solder in some headers instead. I don't want to damage the Pixljs again.

    @Gordon is there pins equal to all the required ones in the footer for me to cut the existing ESP module and try on another pins at the top?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Pixl.js with Wifi (ESP8266 ESP01s) - SOLVED

Posted by Avatar for DamianMontero @DamianMontero

Actions