Basically, It’s An ESP8266

Before the Arduino, there was the Parallax Basic Stamp. It was an easy-to-use PIC chip on a PCB that you programmed in BASIC — a story of those humble beginnings was published earlier this week. Before that, even, legions of small computers from TRS-80s to Commodore 64s and even Altairs were commanded primarily by the BASIC language. BASIC was easy to run on a small machine and very simple to learn. Old fashioned BASICs are difficult to use to write huge systems, but a lot of small computers aren’t going to run very large programs anyway.

The ESP8266 is more than a just a WiFi peripheral for a microcontroller. It is its own little computer in its own right. While it is common to run the “AT” firmware, Lua, or program the device yourself, you can now load the beast with a version of BASIC.

Of course, just running BASIC wouldn’t be very interesting by itself. The real kicker is the extra keywords that allow control of the device’s WiFi hardware, I/O pins, and a dynamic Web page interface. You could very easily and very quickly set up prototypes using the simplified BASIC language and its extensions.

As an example, here’s one of the examples from the project’s home page:

cls
print "hello world"
let bla = "Test contents of textbox"
textbox bla
button "This is my button 1" [test1]
button "This is my button 2" [test2]
button Exit [TestExit]
wait
[test1]
print "You Clicked on 1"
print bla
wait
[test2]
print "You CLiked on 2"
let bla = "number 2 was clicked"
wait
[TestExit]
end

You can probably deduce that the first wait statement will generate a web page with a text box and three buttons. Clicking a button leads to a different part of the code that either generates a new web page or exits. Simple like BASIC should be.

There’s clear instructions about how to flash the software to your board (but be prepared to use Windows). There’s also strange warnings about not using multiple spaces, so apparently the parser for the language still needs a little work.

If you don’t like BASIC and you want a more direct route to program the CPU, we covered that earlier. Or perhaps you’d like to know more about using the Arduino IDE support for the module. If BASIC isn’t your speed, you can always try Lua, by following the instructions in the video, below.

26 thoughts on “Basically, It’s An ESP8266

        1. ESP8266s are like $1 in bulk. It’s only a matter of time before we start seeing $15.00 wifi lightbulbs, and at the same price they’ll sell far better than zigbee versions for obvious reasons.

          1. Zigbee was a huge deal 10 years ago when wifi anything cost >$50. It was going to be everywhere!!1 … but since it was niche silicon companies priced it accordingly, and soon enough NRF24 took over, and wifi got ridiculously cheap making it a proprietary expensive non standard standard joke.

          2. @badger
            ZigBee is mostly a quite advanced protocol that works over simple radios, usually something similar to the NRF. It has a lot of cool stuff in it, from an engineering point of view, but it was meant to be licensed from one of the big players who were involved in it. It was supposed to replace every single type of low bit rate communication in your house: remote controls, home automation etc.
            However it did not work out as planned: different players still implemented it differently which meant that devices were not 100% compatible between them. The mesh ideas was great util you get frustrated people that don’t understand why they cannot control their garden light any more because they moved the desk lamp in the office a bit (hint: the desk lamp was the only point through which he garden lights were connected in the mesh and moving it meant it was out of range). And on top of this: the whole thing is really complex, you would need something like 64K of flash for any of the simplest devices.

            At the hobby level it is pretty obvious why something like WiFi works better: super range, lower cost, no extra hardware, no license fees. It does have a drawback… high power consumption, but some are able to get over it.

          3. ‘$1’ ??? How much bulk quantity ? Can you tell the source, is it directly Espressif ? How much is the cheapest module & where any idea ? (Though, it’d be good if we can get $1 for esp8266 itself)

  1. I still have my Basic Stamp, but for obvious reasons, it’s of little use nowadays. I have 3 ESP8266 modules bought off ebay for next to nothing, and very fine they are too. However, the chance to program them in basic is too good to resist. I’m off to try it now…

  2. This looks like an interesting approach to embedding the ESP8266. Like the Basic Stamp it’s a fairly prmitive Basic, but some of the commands especially for doing web UI are very high level, just the thing you need to set your thermostate remotely.

  3. Whatever happened to the long-standing policy of making the first link the one that the article was actually about so that we don’t go to unnecessary ones first? That was a thing, wasn’t it? I’m sure it was….

  4. Definitely looks like a v0.1 release.

    No loops (For/Next, Do/Loop etc) so it’s “GoTo 1980” time again, a bit light on functions (no string handling, no maths), can’t decide what labels look like (examples don’t match documentation) etc.

    Eh, worth a play.

  5. “…(but be prepared to use Windows)”

    Friends don’t let friends….

    Hit the “Download Source” button on the Download page to get the .ino file. You can
    then use the Arduino-IDE environment under Linux to compile and load it to your ESP8266.
    I just loaded it to an ESP-03 and it came right up on 192.168.4.1 with the initial screen (it
    wasn’t too happy about trying to change the settings – “file open failed” – but at least it boots).

    The console output is running at 9600, BTW.

  6. When ever someone complaints about the lack of features in a hack, I’m reminded about the old Russian Jewish proverb: The true wonder of the dancing bear is not how well it dances, but that it dances at all.

  7. That’s really clever, having a BASIC that outputs HTML. BASIC’s small and slow, but you don’t need fast for a bit of interface code and some simple switching on and off. Bit upset not to see “BLA$” for the string though.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.