BASIC on Raspberry Pi Pico
  • BASIC Interpreter
  • BASIC with VGA Display
  • BASIC with WiFi & Internet

  • Maximite Family
  • Colour Maximite 2
  • Original Colour Maximite
  • Monochrome Maximite
  • The Maximite Story

  • Micromite Family
  • Micromite Summary
  • Standard Micromite
  • Micromite Plus
  • The Microbridge

  • Micromite LCD Backpack
  • Micromite LCD Backpack
  • Air Quality Monitor
  • DDS Signal Generator
  • Super Clock
  • Boat Computer MkII
  • Parking Assistant

  • Other Projects
  • Precision Analog Clock
  • Watering System Controller
  • Windows/DOS MMBasic
  • ASCII Video Terminal
  • Utility Power Supply
  • Precise Voltage Reference
  • ISM Band Scanner
  • Game of Pong
  • Simple GPS Based Clock

  • Useful Techniques
  • Measuring Capacitor ESR
  • Surface Mount is Easy
  • Programming PIC Micros
  • Custom PC Boards
  • The Gerber Format

  • General Articles
  • Problems in Open Source
  • Hantek DSO-2250 Scope
  • Rigol DS1000 Scope
  • Brickbats

  • WEB Site
  • Home
  • Old or Obsolete Projects
  • About



  •  

     

     

    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia (CC BY-NC-SA 3.0)

    Pico W with BASIC and WiFi support

     

    The WebMite is a Raspberry Pi Pico W running the free MMBasic interpreter. This is similar to the PicoMite running on the standard Raspberry Pi Pico but this version includes full support for the WiFi capability of the Pico W.

    Under control of the BASIC program you can serve Web pages, query resources on the Internet, send emails and much more. 

    This is in addition to the feature rich support in MMBasic for the hardware features of the Raspberry Pi Pico W such as serial, I2C or SPI communications, general purpose I/O, PWM output, etc.

    Additional WebMite features includes support for SD cards (FAT16 or FAT32), colour LCD displays, touch sensitive panels and more.

    MMBasic is a Microsoft BASIC compatible implementation of the BASIC language with floating point, integer and string variables, arrays, long variable names, a built in program editor and many other features.

    Program Development

    Program development is done using a terminal emulator on a PC (Windows, Linux or MacOS) connected via a serial over USB interface to the Pico W's USB connector or via Telnet.  No special software or hardware is required other than the terminal emulator which is free.  Over either of these interfaces the programmer can configure features, test BASIC commands, edit the program and run the program.

    When the program is complete it can be set to automatically run on power up.  The WebMite will then independently run its program forever.  The terminal emulator and PC can be reconnected at any time to modify or update the running program.

    The emphasis with MMBasic is on ease of use and development. The development cycle is very fast with the ability to instantly switch from edit to run. Errors are listed in plain English and when an error does occur a single keystroke will invoke the built in editor with the cursor positioned on the line that caused the error.

    The user manual runs to 178 pages and includes a detailed description of how to construct a web server, use the I/O features, etc.  A full tutorial in the BASIC language for beginners is also included.

    WiFi Connectivity Features

    The WebMite will connect to any 2.4GHz WiFi network using WPA-PSK security with either TKIP or AES encryption.  To enable this an OPTION command needs to be issued with the network's SSID and password. Within MMBasic the available WiFi networks can be discovered and listed.

    TFTP: Once connected the WebMite will automatically enable its TFTP server so that files can be copied to/from the WebMite over the WiFi network.

    Telnet:  A telnet server can be configured which will enable a remote connection to the BASIC console so that options can be set and the program on the WebMite can be edited and set running.

    NTP:  The NTP command in MMBasic can be used to get the time/date and set the internal clock within the WebMite

    A simple web page is VERY easy to construct and can display information in a simple and accessible format.

    With a bit more work you can add graphics showing real time data graphed in an easy to understand format.

    It is possible to build complex web pages with images, input fields, checkboxes, switches, etc.  A page like this can replace hardware switches and an LCD panel display - all in software at no cost.

    Web Server

    The WebMite includes the components for building a feature rich website.  This means that the traditional components of a project (switches, knobs, display panel, etc) can be replaced with Web pages with far more functionality.

    Even better, these Web pages can be accessed across the internet making it possible to control your project from anywhere.

    The images on the right are pages served by the WebMite and were captured from the browser that a user would be using.  They illustrate the range of features that can be implemented.

    The commands in MMBasic that are used to build the Web server are high level, so that you are not involved in the complexities of TCP/IP.  But at the same time they are flexible enough to allow the building of complex web pages.

    Web pages are written in HTML and are stored in the WebMite's internal file system.  When a page is requested by the remote browser the WebMite (under control of the MMBasic program) will send that file. 

    Web pages can include:

    The images on the right illustrate some of the real life possibilities using the WebMite.

    The first is a simple page displaying two items of data.  The Web page required consists of just three lines and the MMBasic program to manage the Web server would be about a dozen lines.

    The last example (on the right) is more complex and allows the user to set a multitude of options and features simply by clicking on the Web page in the browser.  The MMBasic code required to serve this page and to respond to the user's various inputs would be 100 to 150 lines.

    To see a complex example of using web pages to control an embedded application check out the Garden Watering Controller at geoffg.net/retic.html

    This was created in part to demonstrate what the Web Mite can do and is a great source of code and inspiration.  The program can be loaded onto a bare Pico W and run. You do not need to build anything to test it out.


    Other WiFi Features

    TCP Client:  A TCP client is included which can get data and communicate with a variety of Internet services such as weather forecasts, SMTP email relays, POP email servers, etc.

    MQTT Client: This can be used to post or retrieve messages on a MQTT broker.

    Ping:  The WebMite will respond to pings from the network.

    Hardware Support

    In addition to the WiFi support MMBasic also supports all the hardware features of the Raspberry Pi Pico W (serial, I2C, SPI, CPU clock, ADC, etc) and adds support for:

    All these features are built into the BASIC interpreter, there is no need to load libraries or write special code.

    Program and Data Storage

    The firmware will create a pseudo disk drive in the flash memory of the WebMite which acts the same as an SD Card.  You can use it to store and load programs and Web pages and access it using the normal BASIC file commands (LOAD, SAVE, OPEN, etc) including random access for database type functionality.  This is done automatically and it is always available.

    For removable storage SD cards can be connected with full support built into MMBasic including the ability to open files for reading, writing or random access and loading and saving programs. SD cards connect directly to the Raspberry Pi Pico and the firmware will work with cards up to 32GB formatted in FAT16 or FAT32. The files created can be read and written on personal computers running Windows, Linux or the Mac operating system.

    Compatibility

    MMBasic on the Raspberry Pi Pico W implements a large subset of Microsoft's GW-BASIC plus some more modern programming structures documented in the ANSI Standard for Full BASIC (X3.113-1987) or ISO/IEC 10279:1991.

    It is also compatible with the version of MMBasic running on the Micromite and most programs written for the Micromite can be run with little or no change.

    Credits

    Peter Mather led the project, ported the MMBasic interpreter to the Raspberry Pi Pico W and wrote the hardware device drivers. Geoff Graham wrote the MMBasic interpreter and the manual.  Many others on the Back Shed Forum contributed with code, testing suggestions and more.

    Help and Support

    Support questions should be raised on the Back Shed forum (http://www.thebackshed.com/forum/Microcontrollers) where there are many enthusiastic MMBasic users who would be only too happy to help. The developers of this firmware are also regulars on this forum.

    Source Code

    The compiled object code (the .uf2 file) for the WebMite is free software: you can use or redistribute it as you please. The source code is available from GitHub ( https://github.com/UKTailwind/PicoMiteWeb ) and can be freely used subject to some conditions (see the header on the source files).

    Downloads

    User Manual (approx 190 pages including a BASIC programming tutorial) DOWNLOAD
    WebMite firmware V5.08.00 (includes the above manual). DOWNLOAD
    Known bugs and issues DOWNLOAD

    Previous versions of the firmware can be found in the archive.

    Other Downloads

    Beta Test Version of the Firmware
    This is the latest test version of the next firmware release (may include bugs).
    DOWNLOAD
    MMEdit, a full featured editor for MMBasic (it runs on your PC).  By Jim Hiley WEB SITE