Avatar for Robin

Robin

Member since Jan 2017 • Last active Jan 2020
  • 62 conversations
  • 975 comments

Most recent activity

  • in Interfacing
    Avatar for Robin

    Wed 2020.01.22

    ' store a config file containing WIFI credentials and DNS info'

    Unless 'sneaker net' using the SD card was mandatory between the PC and the Espruino device, has the following been considered at one twentieth the cost?

    http://www.espruino.com/AT24
    http://ww1.microchip.com/downloads/en/de­vicedoc/doc0180.pdf
    http://www.espruino.com/I2C

    A half inch by one inch PCB with jumpers along with a socket'd 8 pin DIP can be had for less than $1 USD. The chip itself, 5 for $1 USD, but might need a few supporting discreet components. I have a handful of AT24xx lying around to do the exact credential store task. Mine is used with the MDBT42Q using BLE so easy O.T.A. update/save. Just a thought. . . .

  • in ESP32
    Avatar for Robin

    Wed 2020.01.22

    'Question is> is possible to use setDesetDeepSleep function in version of firmware for ESP32?'

    Hello @user106328, could this error be the result of a simple typo here?

    setDesetDeepSleep

    While I see in your other thread the correct usage:

    http://forum.espruino.com/conversations/­341440/

    Is the above a new function I am not aware?

    http://www.espruino.com/Reference#l__glo­bal_setDeepSleep

  • in Bangle.js
    Avatar for Robin

    Mon 2020.01.20

    'I added some code last week . . . .'
    'Where I can find this in source code?'

    Until Gordon is able to reply with a specific link, unless that reference was specific for the emulator which is in#2 post;

    the running list of updates

    https://github.com/espruino/Espruino/com­mits/master

    location of all source code files

    https://github.com/espruino/Espruino/tre­e/master/src



    It is much easier to navigate the source using VSCode and I had been given a tremendous amount of assistance getting started. Took me a bit to get going as can be seen from this thread, which may be used as an overview, should that choice be desired.

    http://forum.espruino.com/conversations/­339160/

  • in Pico / Wifi / Original Espruino
    Avatar for Robin

    Mon 2020.01.20

    @ScottyMT,

    I like the improved, reordered layout of the code block in revison at #9 post. Nicely done example for others requiring MQTT.

    ref last pp. of post #7

    It should be noted that, L6 and L15 will execute within microseconds of each other, not 2 seconds apart, attempting to force Espruino into potential WiFi setup conflict. This can be proven using the debugger and WebIDE to reveal this fact.

    EDIT: Tue 2020.01.21 clarification regarding Gordon's comment in #11 at least one person is actually reading and following along ;-)     Edits crossed paths and left out the qualifier: 'should the 'connected' event L15 occur near simultaneously after the first L6 setTimeout() interval has started' This would then be attempting to set up the AP at the approximate same time the server is attempted to be set up. A lot to do with WiFi simultaneously! Although that reference wasn't the perfect example, my point shouldn't be overlooked. Two seconds is not passing waiting for L8 and then L14. During development, I get around this by using prime numbers with trailing '000' so they most likely won't overlap and as to more easily track which timer trips and in which order. Having identical interval values will cloud that understanding.

    The code block suggestion that @Gordon graciously whipped together in post #8 was what I implied in the pseudo code reference in 2nd to last pp. in #7 post.

    Here is an excellent explanation:

    https://johnresig.com/blog/how-javascrip­t-timers-work/

    Although your setup may work satisfactory, using the logic layout in Gordon's code block and tweaking the timeouts, should allow for a solid working state in around a second or so, and not the ten seconds currently required.

  • in ESP8266
    Avatar for Robin

    Mon 2020.01.20

    @nistvan.86 glad that worked, but a bit of a mis-communication. My belief was that multiple upload of images was the issue, and intended to have the subsequent upload in post #7 rather than a replace of your remote account. That said, it appears the issue was with the actual file then?


    @Gordon, regarding post #12, what are the limitations, and what is the range of pulse creation using digitalPulse() please. Is the implication that only a 1msec be the shortest width pulse at a 1KHz rate be all that may be created then? I thought I read (but unable to locate, and unable to reproduce) that 1usec pulse widths were possible at a 1MHz rate?

  • in ESP32
    Avatar for Robin

    Mon 2020.01.20

    @Gordon just posted the very solution needed here within a separate thread post just this morning.

    http://forum.espruino.com/comments/15068­150/

    @Homoludens a full explanation is there also. I'd read the entire thread. . . .

  • in ESP32
    Avatar for Robin

    Mon 2020.01.20

    "Some of our readers reported that they could only upload code when
    the ESP32 was powered with 5V. However, we were always successful
    providing 3.3V supply."

    @7oo1er would you please look back through the browser history and post the link to the quote in post #3 please. Google did not return any suitable links using all or part of those exact words.


    I believe this quote is taken out of context.


    How can it be possible that driving a CPU chip with a higher (and not rated for, possibly damaging the chip, by the way) voltage be okay, but also be successful at a lower voltage?
    Running off a TTL converter perhaps?


    'ESP is more heavy, feed it more, use better and shorter cables'

    I'm not entirely sure what the above is intending to imply.

    The reason the Pico works from a 1 meter USB cable is that it's own circuit board contains an onboard regulator to convert the USB 5v output to the 3v3 volts needed by the STM32 CPU chip.

    "On-board 3.3v 250mA voltage regulator, accepts voltages from 3.5v to 16v"

    http://www.espruino.com/Pico



    While there are many flavors of ESP32 and circuit breakout board mounts,

    "2.2V to 3.6V operating voltage"

    http://www.espruino.com/ESP32

    what is intended by "better", "shorter" cables for "heavy" use? The power demands for these CPU chips are in the mA range. The restriction of a shorter cable is ridiculous at a meter length. (yes physical properties, diameter, length, wire resistance, etc. need to be considered with many tens of feet however)

    If the intent is not to drive additional boards or Neopixel strips from their on board regulator, (which any prudent project would not be doing anyway) then I would totally agree.


    Please explain the "But not here." reference to the ESP32. Thank you.

  • in ESP8266
    Avatar for Robin

    Sun 2020.01.19

    'I can't attach the other logic analyzer output'

    FYI - Only one image may be uploaded at a time. Did an attempt at a re-edit allow the ability to perform the additional upload? It's okay to re-edit to test


    Hi @nistvan.86, I'm late to this thread and wont be of much help should this truly be an ESP8266 issue, but I'm not really grasping what isn't working.

    'And this does make the modem reset work, I can query it's version number afterwards.'
    'Am I still doing something wrong?'

    Is the concern still with this msg while 2v04 is currently flashed?

    'You have pre-1v96 firmware'

    Has 'af_output' been tried for pinMode()?

    http://www.espruino.com/Reference#l__glo­bal_pinMode

    0.03 msec is 30 usec and the pulse shown appears to be documented as 29.8 usec
    Was this of concern?

    EDIT: I think I get it, the question is why is it necessary to prepend two place holders?



    Incidentally, I've been playing with digitalPulse() and ran into a similar situation. My (unresolved and unresearched at 'C' code level) belief is that the array mechanism requires whole numbers, and a decimal seems to muck things up. I was able to create narrow usec pulses at the usec level using the following as a patch: (edit as necessary)

      analogWrite( D4, 0.01, { freq : 4000 } );
      // to trun off
      analogWrite( D4, 0, { freq : 1 } );
    

    yes, I know it uses the analog flavor, . . .

    http://www.espruino.com/PWM
    http://www.espruino.com/Software+PWM

    then to create a pulse train, embed within an interval, something like: (use setTimeout() for a single pulse)

      intervalID = setInterval( function() {
        // Fire the enable pulse
        dp4once();
    
      }, freq );
    



    Not sure if this is what you are after, but I'm running short on time tonight and wouldn't be able to respond should you reply. Just thought I'd pass along some ideas. . . .

    Source code links if time allows to research
    https://github.com/espruino/Espruino/blo­b/master/src/jswrap_io.c#L201
    https://github.com/espruino/Espruino/blo­b/master/src/jswrap_io.c#L167

    If I've butt'ed in and not assisting here, please forgive. . . .

  • in Bangle.js
    Avatar for Robin

    Sun 2020.01.19

    Nicely done @Abhinav and a code block for others to emulate too! I have a feeling your technique will get used a lot!!

  • in Pico / Wifi / Original Espruino
    Avatar for Robin

    Sun 2020.01.19

    Glad it is all working @ScottyMT

    Clarification here

    'mentioned about a delay setting up SPI'
    'to wrap every startup/connection/instantiation in a delay setTimeout. Is this overkill?'

    While it may not have been entirely clear, the reference to a delay in post #5 was directed at setting up SPI after the WiFi init taking time, not a delay in the setup of SPI. As you astutely pointed out "There are quite likely several opportunities for conflict," the WiFi module would have to be fetched, the connect task and setup of the AP would take a bit of time, and at the same time SPI setup, and MQTT broker init were being performed.

    It may not have been clear that using multiple setTimeout()'s was the intent. The pseudo code: Within the init function, start SPI, inside one timeout task, init and start the AP, inside a separate timeout, init and start the connection to the MQTT broker. In that way, each timeout could be tweaked to get the optimum start delay minimum.

    Remember that Espruino will execute the setTimeout() code lines sequentially immediately, that is there is no wait for the timeout to occur before the next code line will execute, so each subsequent timeout value will have to be slightly longer, so they actually stagger an actual half second or so later.

Actions