ESP8266 BASIC Sets Up a Web Remote in No Time

One of the sticking points for us with our own Internet of Things is, ironically, the Internet part. We build hardware happily, but when it comes time to code up web frontends to drive it all, the thrill is gone and the project is only half-done.

Including some simple web-based scripting functionality along with the microcontroller basics is one of the cleverest tricks up ESP8266 BASIC’s sleeves. BASIC author [mmiscool] puts it to good use in this short demo: a complete learning IR remote control that’s driven through a web interface, written in just a few lines of BASIC.

Note that everything happens inside the ESP8266 here, from hosting the web page to interpreting and then blinking back out the IR LED codes to control the remote. This is a sophisticated “hello world”, the bare minimum to get you started. The interface could look slicker and the IR remote could increase its range with more current to the LED, but that would involve adding a transistor and some resistors, doubling the parts count.

For something like $10 in parts, though, this is a fun introduction to the ESP and BASIC. Other examples are simpler, but we think that this project has an awesome/effort ratio that’s hard to beat.

18 thoughts on “ESP8266 BASIC Sets Up a Web Remote in No Time

  1. Creating a rich web interface isn’t that hard especially with technologies such as angular and webdocket mqtt. The more challenging thing is to split the interface from the device itself and still be reasonably responsive. Many cloud based IoT companies do the UI well but being in the cloud makes the response time well above the Doherty threshold unless it is carefully designed to also have local control.

  2. Only one problem, it uses Basic. Seriously I’ve been forced to use basic on a project or two in the past and I’d never do it voluntarily even if the end result was acceptable. I would never use it for teaching either, it is a dusty dead end road of harmful habits.

        1. I used (and still do) BASIC in several flavors and it does not seem dead to me. The fact that it allows harmful habits does not equals that it enforces harmful habits. Don’t see any harm using it if it gets a job done in the time available.
          Of course, it’s not as if I would insist in writing a SQL database server in BASIC, to each problem its tool.

    1. Depends what you’re doing with it. Like most tools really. For quick ‘n’ dirty, reliable, fire and forget coding, can’t go wrong. No need to worry about memory allocations and pointers and stuff like in C. Of course you don’t HAVE to use those in C either, but chances are if there’s a bug, you’re gonna end up with your sleeves rolled up, into the guts soon enough.

      BASIC’s also really easy and small to implement, and pretty much everyone knows it. And if you’re a programmer who doesn’t know BASIC, it’ll take you all of 5 minutes to get the hang.

      Of course there’s BASIC with pointers, and doublewords, and bloody object orientation. That’s taking BASIC where it was never meant to go, and has no business being. Code like that ends up looking like C even if it’s supposedly in BASIC. For C programmers who just can’t let go, I suppose.

      For quick ‘n’ dirty hardware, but also for software where it’s a decent alternative to scripting also. Like Visual Basic, back in the early days. A lot of bespoke software was really just a front-end and a bit of simple logic tying together the libraries that did the real work. So wrap a bit of BASIC around that, Bob’s yer uncle.

      BASIC has it’s place. So does awful coding. But the two don’t have to go together.

  3. I use a few ESP8266 around the house to monitor power usage at the meter, water tank temperature and controlling my garden watering. I have created a web interface (a basic API) on each ESP8266 which is called from a central computer to retrieve readings or switch relays. The readings are pushed into a Influx database for graphing or switching.

  4. The thing here is that esp8266basic allows you to do simple stuff really easily. And remotely.
    Its pretty cool, was less difficult to set up that micropython , which I also like :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s