PDA

View Full Version : BASIC is NOT dead!!



Heckler
- 25th November 2015, 05:33
OK BASIC aficionados! Listen up here... :D
This is, to me, a game changer!

If you are interested in the little ESP8266 modules you just HAVE to check out www.esp8266basic.com

over on his (mmiscool) website there is very active development in implementing a form of BASIC that runs on several models of the ESP8266 including the -01 and -12 and the "nodemcu" model. (I have so far only tried the -01)

You need only view the demo video and download the flasher.
this will install the BASIC OS on your module
all code development (IDE) runs in a webpage served up by the module itself!!!
they are adding BASIC command statements daily making it better and better
development is mostly by "mmiscool", but he does have a little help AND LOOKING FOR MORE HELP

please note since development is VERY active some of the documentation is lacking
you must click over to the forum and read most everything there... especially "NEWS" where most of the new commands are announced.

below is my setup... and a very AMAZINGLY simple program that is very powerful. (Not written by me, just the provided example code with pin numbers changed to match the -01 module)
It is a full blown thermostat! using an ds18b20 and an LED (with integral current limiting resistor) to represent ON/OFF of the thermostat.

If you really like BASIC (or, like me, can only really only write code in BASIC) then you really owe it to your self to give it a go. Well and also want to bring in WiFi to your projects.

Since the IDE is completely implemented within the module itself and accessed from a webpage then what could be more simple?
In the image below showing my ESP8266-01 module take note of the pull-up 5K resistor soldered between the data and +V pin (and as noted earlier the LED has a built in current limit resistor)

I highly recommend the USB ftdi module in the picture as it has built in 3.3v regulation and is extremely easy to use.
you can get one here http://www.ebay.com/itm/CP2102-USB-To-UART-converter-Supports-ESP8266-/262000791994?hash=item3d0076d1ba:g:BnQAAOSwBahVAS3 9

also if you are going to buy an esp8266-01 module I have read that the ones on blue pcb have 512K mem and the ones on black pcb have 1 meg so you probably want the black ones (banggood.com has them) (but YMMV)

again this is a work in progress and the only way to get through is to read over on the forum as well as try some of the examples both on his home page and over on the forum.

I do not personally know "mmiscool" but he is really hitting the mark with BASIC, at least from my perspective.

8097
8098

Sorry for the bad handwriting...
8099

In this picture the module is mounted on the USB ftdi interface and communicating both serially to putty terminal and via wifi to my pc's web browser!
8102

this photo shows the putty serial terminal window and the output from the module as well as the webpage from the module itself showing the values and temperature setpoint.
8100
8101

Please excuse all the effusive verb-ology (is that a word??) but I really can't contain myself!!

mackrackit
- 25th November 2015, 17:05
Very nice!!!

I will promote this to an article on the WIKI.

mark_s
- 25th November 2015, 17:14
That looks handy! Thanks for posting..

Under the basic is not dead, here's another tool for those who want to use pic32 and pic24. It uses a VB style coding

http://www.firewing.info/

richard
- 26th November 2015, 03:11
this does look promising , I had been getting flaky results and nearly given up in disgust --- turns out the power supply for the esp8266 is far more critical than I thought . 3.3v seems to work much better than 3.0 (was having the flash the memory not always updating and sometimes becoming corrupt after saving files).
the 3v regulator on all of my usb-tty adapters has proved to be inadequate for the task of running esp8266 modules

Heckler
- 29th November 2015, 17:10
I appears the source for the USB adapter board that I posted is no longer available or out of stock.

Here is a link to one on Tindie.com
https://www.tindie.com/products/AprilBrother/usb-to-uart-converter-that-support-esp8266/

That I believe is the same thing but updated to use a micro usb instead of the standard usb.

and I found the original here...
http://aprbrother.en.alibaba.com/product/60218078011-800966870/CP2102_USB_To_UART_module_converter_Supports_ESP82 66.html

I've never ordered anything from alibaba.

dhouston
- 2nd December 2015, 18:16
I haven't explored ESPBasic in depth but do know of a more powerful Basic for use with the ESP8266 and with Atmel chips including those used by Arduinos.
http://www.zbasic.net/ (http://http://www.zbasic.net/)

Heckler
- 3rd December 2015, 05:35
I took a look over at zbasic and really can't (from the quick look I took there) make any comparison, it may be more powerfull..

BUT I can say that I have found the ESPBASIC to be extreemly easy to try out. I also found it to be amazingly easy to do some very complex things like...

> generate an email or text message
> get time from an NTP time server
> parse the NTP time value into individual components HH, MM, SS, year, day of week, etc.
> generate a webpage with buttons to change gpio pins
> create input fields on a web page for temperature set points, text or value entry fields.
> read the temperature from a ds18b20 temp sensor

and all of the above things can be communicated back to you via a web page or (if you choose) to your microcontroller or terminal window via its tx/rx serial interface at 9600 baud (or both!!)


The IDE is built into the OS and resides on the esp module.
The module starts out as an AP with no credentials required which allows you to easily locate it and connect to it from any wifi enabled device like a smart phone, tablet, laptop or PC with wifi capabilities. Then you can easily enter credentials for your local network wifi and then the module will, upon reset, connect to that network and provide its DHCP acquired IP address via the serial port that you used to flash the BASIC OS into it. So if you open a terminal window and watch the COM port of the USB adapter you used to flash it with you will see it attempt to connect to the network and it will print out the newly acquired IP address.

And as a fall back, if for some reason it can not make a successful connection using the credentials you provided it, the module will default back to an AP so you can reconnect to it directly and review/correct its settings.

You program and upload your code directly from an internal web page IDE on the module. NO ADDITIONAL SOFTWARE REQUIRED ON YOUR PC other than the initial small flashing program.

I must say I have been trying to reach this level of capability with these little ESP8266-01 modules for almost a year now and this ESPBASIC has hit a home run for me.

Now, keep in mind that the espbasic is certainly not going to be anywhere near as capable as our beloved? PIC Basic. But for me that is not the point. I can now easily add wifi capability to any of my microcontroller projects or create simple projects like temperature alarms that can generate an email/text msg and many, many others.

For anyone like me who undersands BASIC and struggles with C, python, LUA, or 'fill in the blank' language then this has opened a new door.

but I should add... YMMV :D

Give it a go, and I'd be happy to share any of my test code. There are also several example programs listed on his website, which is separate from the forum that he links to.

dhouston
- 7th December 2015, 13:31
ESPBasic does appear simple but I would prefer to know more about what's going on behind the curtain. The interpreter seems to be doing a great deal that is hidden and is undocumented. From the documentation I've seen, it isn't clear that you are accessing an NTP server - it might be the Wizard of Oz. Plus, it seems to require a great deal and ever growing amount of memory - more than 1M in the latest version. Still, it may well be useful for augmenting PIC based devices where you just want to add WiFi connectivity.

ZBasic is compiled (i.e. no interpreter) so only your compiled application uses memory. ZBasic also works with most Atmel AVR chips, can import/export C, can import Arduino code, use inline assembly language and much, much more. The free version supports the ESP8266. With something like the NodeMCU v1.0 (4M), many applications will have no need for a PIC or AVR relying instead on the processing power of the ExpressIf SoC.

dhouston
- 28th December 2015, 16:35
While programmable with LUA, Arduino, ZBasic, ESP8266Basic and more, one drawback of the ESP8266, to quote email from Don Kinzer who created ZBasic, is...

It doesn't have any means to do highly accurate timing. Further, the ESP8266 has non-maskable interrupts and servicing them also interferes
with the timing.

This means you will need a PIC or other MCU to supplement the ESP8266 for many, many applications.

Here's a bit of hardware that simplifies that...
http://www.wemos.cc/wiki/doku.php?id=en:d1_mini

You can design shields that stack atop it a la Arduino.