First Steps with ESP-01S and HW-305

Posted on
  • Hi there,
    I have ordered some esp chipsets and got it last week.
    Today I found Espruino and was totally flashed, that I can code with JS on the chipset.

    I have the Mini-Breadboard HW-305 and ESP-01S plugged on it. (It's the same hardware like in this Video (from 0:00 till 0:30) : https://www.youtube.com/watch?v=6uaIWZCR­Sz8

    ).

    Now I try to connect it to the Espruino-Web-IDE, but without success. Because I use Linux, I've followed the instructions to add my user to plugdev group and re-login to get this new permissions active.

    Then I've opened the Espruino-Web-IDE in Chrome and click the yellow Button above.
    I see an Popup with the USB-Port, but if I choose this, I got an error:"Connection failed".

    In the Settings ⇒ Console, I see this:

    We have chrome.serial - not using 'serialport' module
    serial_audio: Audio Sample rate : 44100
    serial_audio: Audio Serial Baud 9600 Bit time 4.59375
    UTF8 Library loaded successfully
    GET chrome.storage.sync = {"AUTO_SAVE_CODE":true,"BAUD_RATE":9600,­"BLOCKLY_EXTENSIONS":"|bluetooth|robot|"­,"BLOCKLY_LANGUAGE":"en","BLOCKLY_TO_JS"­:false,"BOARD_JSON_URL":"http://www.espr­uino.com/json","CODE":"var  on = false;\nsetInterval(function() {\n  on = !on;\n  LED1.write(on);\n}, 500);","COMPILATION":true,"COMPILATION_U­RL":"https://www.espruino.com/service/co­mpiler","DISABLE_CODE_HINTS":false,"ENAB­LE_Testing":false,"ENV_ON_CONNECT":true,­"FONT_SIZE":12,"KEYMAP":"sublime","MINIF­ICATION_DeadCode":true,"MINIFICATION_LEV­EL":"","MINIFICATION_Literal":true,"MINI­FICATION_Mangle":true,"MINIFICATION_Unre­achable":true,"MINIFICATION_Unused":true­,"MODULE_AS_FUNCTION":false,"MODULE_EXTE­NSIONS":".min.js|.js","MODULE_MINIFICATI­ON_LEVEL":"ESPRIMA","MODULE_PROXY_ENABLE­D":false,"MODULE_PROXY_PORT":"","MODULE_­PROXY_URL":"","MODULE_URL":"https://www.­espruino.com/modules","OFFLINE_DATA":"",­"OFFLINE_DATA_DOWNLOAD":"","OFFLINE_DATA­_UPLOAD":"","OFFLINE_ENABLED":false,"PRE­TOKENISE":false,"RESET_BEFORE_SEND":true­,"SAVE_ON_SEND":0,"SERIAL_AUDIO":"0","SE­RIAL_FLOW_CONTROL":true,"SERIAL_IGNORE":­"/dev/ttyS*|/dev/*.SOC|/dev/*.MALS","SER­IAL_TCPIP":"","SERIAL_THROTTLE_SEND":fal­se,"SET_TIME_ON_WRITE":false,"SHOW_CODE_­LINK_ICON":false,"SHOW_WEBCAM_ICON":0,"S­TORE_LINE_NUMBERS":true,"Sound_Error":""­,"Sound_Info":"","Sound_Success":"","Sou­nd_Warning":"","Speak_Error":false,"Spea­k_Info":false,"Speak_Success":false,"Spe­ak_Warning":false,"UI_MODE":"Normal","WE­BCAM_CONSTRAINTS":0,"WEB_BLUETOOTH":true­,"WEB_SERIAL":true}
    Initialising SettingsConsole
    Initialising Utils
    Initialising Config
    Initialising Notifications
    Initialising Status
    Initialising App
    Initialising File
    Initialising Code
    Initialising Serial
      - Initialising Serial Chrome Serial
      - Initialising Serial Chrome Socket
      - Initialising Serial Web Audio
      - Initialising Serial Web Bluetooth
      - Initialising Serial Web Serial
    Initialising Terminal
    Initialising CodeWriter
    Initialising Modules
    Initialising Env
    Initialising Flasher
    Initialising EditorBlockly
    Initialising EditorJavaScript
    Initialising Send
    Initialising MenuPortSelector
    Initialising MenuSettings
    Initialising MenuFlasher
    Initialising SettingsAbout
    Initialising SettingsFlasher
    Initialising BoardJSON
    Initialising VersionChecker
    Initialising Compiler
    Initialising Assembler
    Initialising GetGitHub
    Initialising Unicode
    Initialising Minify
    Initialising Pretokenise
    Initialising SaveOnSend
    Initialising SetTime
    Initialising Tutorial
    Initialising Webcam
    Initialising FontSize
    Initialising UiMode
    Initialising URLHandler
    Initialising CodeLink
    Initialising Project
    Initialising Testing
    Initialising Notification_Sound
    Initialising Tern
    Initialising Debugger
    Initialising Tour
    Initialising SettingsProfile
    Initialising HelpLinks
    Initialising Offline
    Initialising CoreModules
    Loaded code from storage.
    GET chrome.storage.local.OFFLINE_DATA = 0 bytes
    No navigator.bluetooth - Web Bluetooth not enabled
    No navigator.serial - Web Serial not enabled
    >>> Connecting...
    Set Slow Write = true
    Unable to open device (connectionInfo=undefined)
    ERROR: Unable to open device (connectionInfo=undefined)
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    >>> Connecting...
    Set Slow Write = true
    Unable to open device (connectionInfo=undefined)
    ERROR: Unable to open device (connectionInfo=undefined)
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    

    Can anybody give me a helping hand to start with my first IoT and Espruino? I would love to do it with Espruino and not with Arduino, becauese I'm still familiar with JS-Coding.


    1 Attachment

    • screenshot_ 8_54_12.jpg
  • Fri 2020.02.07

    Welcome @user109345 to the world of Espruino and your keen and eager interest to get started!

    sidebar
    'was totally flashed'

    Thank you for the introduction to a new phrase. Unable to locate an idiom that closely matches that. Please explain the origins and meaning. . . .

    off sidebar


    'I've followed the instructions to add my user to plugdev group'

    Please provide link so that we may follow along!



    For ESP8266, were all the warnings observed on this page?

    https://www.espruino.com/ESP8266_Flashin­g

    under heading Initial Flashing
    'Use esp-12 modules if at all possible, avoid esp-01 modules: . . . .    . . . . The esp-01 has barely any usable I/O . . . . '

    Please read through that entire page.

    Incidentally, I've had moderate success with the ESP-12E, at the expense of a massive time commitment but abandoned it's use as it is not an official supported board, and has too few I/O to be practical for my projects under development.    caveat emptor



    'give me a helping hand to start with my first IoT and Espruino'

    While I admire the tenacity to start with a device that might be inexpensive and currently understood from previous Arduino projects, what is the ultimate goal here?

    Should it be to learn/understand Javascript with Espruino, then might I suggest the easy to get started with Pico. Just plug it in to a USB port and you are up-and-running in minutes.

    Have the tutorials been reviewed?

    http://www.espruino.com/Tutorials

    Quick four minute intro using one of the older style boards

    https://www.espruino.com/Quick+Start+USB­


  • @Robin "flashed" means something like: happy, overwhelmed, impressed ....
    As I'm a Mobile & Web-Developer, I'm very familiar with JS, so I'm glad to see that it's possible to use it for ESP-programming too.

    This was the link I've missed to add... means the HowTo I've followed: https://www.espruino.com/Quick+Start+USB­

    I've also ordered some other chipset like esp-12, NodeMCU... but first I wan't to start with this tiny one. The single gpio-Output on the esp-01 fit's my needs (I think so) for a tiny first Project.

    So maybe you can give me some general hints for the first Steps.
    For the ESP-01 (and maybe other chipsets), what are the steps to work with it?
    Is it like this:

    1. Put Chip in Flash-Mode
    2. Upload firmware especially for this Ship
    3. Upload Espruino firmware
    4. Upload code, which do something on the chip (for espruino it's js, arduino it's C ?)

    I've still ordered a bunch of esp-Chipsets before I was aware that Espruino exist. So I wan't first go with this stuff, instead of buying additional Stuff like Pico or other thinks.
    Because I'm at the very beginning of this hobby... You know what I mean?

  • Hi,

    Because I use Linux

    looks like you are missing that serial device

    on mac os x it is named /dev/tty.usbserial-14610

    Next is get esptool.py and read details from the ESP01S like

    • chip_id
    • flash_id

    to eg. determine the --flash_mode and other otherwise it does not boot.

  • Sat 2020.02.08

    "flashed" means something like: happy, overwhelmed, impressed ....

    Good Morning @rethus thank you for that explanation. May I ask which continent that is used or may have originated from? I've not heard it hear in North America.


    'but first I wan't to start with this tiny one' ref ESP-01

    I'm not a Linux or Mac OS user, so please follow @MaBe suggestion in post #4 There are several that have years of experience on that platform, and I'd only muddy the waters with my input.



    Regarding the four steps outlined in post #3, step 2 and 3 are basically the same thing, unless creating a custom build, but uploading/flash of Espruino loads the Espruino interpreter, which is easily accessed using the WebIDE.


    'I'm glad to see that it's possible to use' ref Espruino Javascript

    Yes, and you'll really grasp it's ease of use with the code file upload panel and command line console input to send immediate commands. Along with the 'debugger' the environment is much faster than attempting the same using Arduino for instance. Limited debug - code, compile, fix syntax, edit, compile, fix logic, wash , lather, rinse, repeat within that environment.


    'I'm at the very beginning of this hobby... You know what I mean?'

    Yes, the authors of the Espruino environment constantly struggle with how to earn an income supporting eagar users such as yourself, while keeping the entire works open-source. Then how to appease the unpaid end-users providing forum support, such as this thread. Although the ambition to start with other devices is understood by all, should it take more than the weekend to get the device you have up and running, IMO you will be light year ahead with an official supported device. I was in your shoes three years ago attempting to do more with less, but found the amount of time required to refactor all the tutorials and forum examples just isn't worth the ten additional dollars or so for an official board. I suppose if you are in your twenties, and 'short on money but long on time', it may be a fun and inexpensive learning experience. But, should you be like myself, 'closer to pushing up lillies than from birth to ones twenties', then time is the limiting factor. (unless you know of someone selling 'time') I have learned that the amount of effort wasted required to make the mods to the tutorials in an attempt to save a few dollars with an off brand board - Just Isn't Worth It!!

    Case in Point:

    R-Click on my name in this post to open a new tab. Click on the 'conversations' link and work backwards from panel 'last' to see my struggle(s).

    or; http://forum.espruino.com/search/?author­Id=116219&offset=50&type=conversation

    My first exposure was with the Pico. Plug-n-go. I had a wild idea that using an inexpensive ESP8266 would solve some coding time. You'll see in those initial threads however, I burned up a ton of time proving myself wrong. Tough to own up to!! I also have learned by getting involved in helping others in the forum is the fastest way to get up and running. While that may seem far feteched, yes I made a few suggestion blunders along the way, but it forces one to 'look the stuff up'. After doing it for quite a while now, I have an innate ability to remember where I 'saw' that documentation, speeding not only assisting others, but also knowing where to get a tid-bit to solve an issue I've had.


    'Because I'm at the very beginning of this hobby'

    And you're excitment will grow, just take a look at some of the forum threads within 'Projects'

    In the mean time, while not an ESP8266, get started with some programming using the emulator on the Bangle. Just came across this '8-Ball' demo another individual is working on.
    It's not a perfect solution, or even a substitute for coding on the device you currently have, but it does provide some basic interaction to get the juices flowing!!

    Runs in the browser.

    Launch link at:

    http://forum.espruino.com/comments/15091­996/

    1. Remember to ground GPIO0 when you insert it to the USB to get in the bootmode.

    With esptool:

    1. Have you erase flash?
      Unplug and repeat 1.
    2. Have you written flash?
      as written in "README_flash.txt".
    3. Unplug and reinsert.
    4. Run ESPRUINO WEB IDE and set Baud rate to 115200.
    5. Then you are running.


    1 Attachment

  • @Frida Thanks a lot for your step-by-step introduction.
    I've now

    1. erased the flash
    2. download and unpack this Package: https://www.espruino.com/Download
    3. Re-Plugin the Stick

    If I start the ESPruino Web-IDE and connect the Chip, I see that the Chip output something... all the time:

    But uploading the example-blink-Script doesn't work. Returend Prompt not detected - upload failed. Trying to recover...

    If I do the following:

    1. run esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_freq 40m --flash_mode qio --flash_size 1MB 0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 0xFC000 esp_init_data_default.bin 0xFE000 blank.bin
    2. Re-Plugin the Stick
    3. Connect to Web-IDE.... but even if I re-plugin, or start in Flash-Mode (by pressing button on Plugin), I can't upload the example-script. I always got Prompt not detected - upload failed. Trying to recover...

    So what I've done wrong?

    BTW: I didn't found the place to change Baud-Setting in Chrome-Web-IDE.

  • Sun 2020.02.09

    @rethus, what is the WebIDE Baud Rate set at?

    WebIDE >> Settings >> Communications >> Baud Rate

    and

    WebIDE >> Settings >> Console

    might reveal some much needed detail. . . .



    Confirming

    'download and unpack this Package'

    Which device was selected? The link in post #7 only points to the download page.

  • I use this:

    *** To flash a 512KB esp8266 (e.g. esp-01) using the serial port use:
    esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash \
      --flash_freq 40m --flash_mode qio --flash_size 4m \
      0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin \
      0x7C000 esp_init_data_default.bin 0x7E000 blank.bin
    
    

    because it is only 512KB

  • And I grab it from here:

    http://www.espruino.com/binaries/travis/­master/
    
  • I have one ESP-01 and one ESP-01S Chip. (Wikipedia say, it has 1MB ?!)
    The Command you post is for 4MB, isn't it?

    If I use your command, I got this response:

    esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash \
    >   --flash_freq 40m --flash_mode qio --flash_size 4m \
    >   0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin \
    >   0x7C000 esp_init_data_default.bin 0x7E000 blank.bin
    WARNING: Flash size arguments in megabits like '4m' are deprecated.
    Please use the equivalent size '512KB'.
    Megabit arguments may be removed in a future release.
    esptool.py v2.8
    Serial port /dev/ttyUSB0
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Crystal is 26MHz
    MAC: dc:4f:22:5a:85:86
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Compressed 3856 bytes to 2762...
    Wrote 3856 bytes (2762 compressed) at 0x00000000 in 0.2 seconds (effective 124.4 kbit/s)...
    Hash of data verified.
    Compressed 459684 bytes to 320164...
    Wrote 459684 bytes (320164 compressed) at 0x00001000 in 28.2 seconds (effective 130.4 kbit/s)...
    Hash of data verified.
    Compressed 128 bytes to 75...
    Wrote 128 bytes (75 compressed) at 0x0007c000 in 0.0 seconds (effective 80.9 kbit/s)...
    Hash of data verified.
    Compressed 4096 bytes to 26...
    Wrote 4096 bytes (26 compressed) at 0x0007e000 in 0.0 seconds (effective 4105.0 kbit/s)...
    Hash of data verified.
    
    Leaving...
    Hard resetting via RTS pin...
    
    

    But now I got a connection. Thanks a lot. I'm so happy now to get the first connection :)

    Do you have a tiny test-script for me to upload something?
    Is there a documentation to see which commands are supported for the different Chip-types like esp-01, esp-01s, esp32-cam, node-mcu and so on?

  • Sun 2020.02.09

    'Do you have a tiny test-script for me to upload'

    Has the sample script on the R-Hand side of the WebIDE shown in post #7 been tried?

  • Yes, this crashed the Chip :) It output some error that LED1 wasn't found. But I've created now an WIFI Connection and played a bit around with some API commands. Works like a charm.

    @Frida @Robin @MaBe Thanks a lot for helping hands.

  • WARNING: Flash size arguments in megabits like '4m' are deprecated.
    Please use the equivalent size '512KB'.
    As you can see '4m' is megabits
    and '512KB' is in kilobytes
    as 1 byte is 8 bit.

    Happy coding.

  • @Frida yes, I see now. Thank you.

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

First Steps with ESP-01S and HW-305

Posted by Avatar for rethus @rethus

Actions