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.
Someone needs to make a ZHA Zigbee module like this. it will utterly explode the home automation market in tons of cool and cheap devices.
Because so many more households have a Zigbee router than a WiFi router?
If you have home automation? yes you have a zigbee mesh. Unless you want to buy $80.00 lightbulbs that use wifi instead of $15.00 lightbulbs that use zigbee.
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.
This is first time I’ve ever heard of Zigbee, would you care to explain what are those obvious reason?
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.
@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.
‘$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)
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…
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.
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….
yeah, I thought of that too, maybe [Al Williams] is too new to remember that.
Actually, I added that link in editing, but thanks for playing ;-)
Yes, I recall you mentioning a while back that it isn’t a Hard and Fast rule.
I find lately it is the oldness that keeps me from remembering things ;-)
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.
“…(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.
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.
Still adding new features to this project.
Only been about 3 weeks in development and I think it has come a long way in that time.
Working on i2c and all of those string and trig functions we know and love.
Keep up the good work! The concept of writing the code in the browser on a page served by the ESP8266 itself is nifty :) Looking forward what else you have on your roadmap.
I have made a Users Project area at http://www.esp8266.com and have created a space for MMISCOOL’s project http://www.esp8266.com/mmiscool. Come share your ideas with him and help him build his project from the ground up!
Isn’t arduino TX is 5V output, while ESP RX input is only 3V tolerant?
The ESP8266 definitely runs on 3.3v, but IIRC the inputs are 5v-tolerant. Might depend on the specific board you have.
best if you treat the ESP8266 inputs as NOT 5v tolerant. Some folks get away with it, some not.
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.
Variables are not defined as strings or number values. They are interchangeable. It is still fine to use bla$ if desired but to the basic interpreter it makes no practical difference