[Microbit-Python] Microbit and Wifi

M.-A. Lemburg mal at egenix.com
Sun Feb 7 09:04:15 EST 2016


Just a bit of an update on my progress so far. Not much, but
I'm slowly getting there...

I've ordered an ESP8266, the ESP-12E variant to be exact (there
are lots of variants available) and have soldered everything
together.

I then found that even the board now fits a breadboard, it
needs two breadboards to connect cables, since it completely
covers the breadboard.

Next was trying to find some good documentation for the ESP8266.
There are tons of documentation snippets on the net, but nothing
really concise. The many different available variants of the ESP8266
don't make this easier.

I figured out that in order to start the chip, you need to
connect the chip enable pin to VCC as well.

I then tried to connect it to the UART pins 0 and 1. Unfortunately,
using the MicroPython REPL, you lose the console output once
you switch on UART usage, so that's not a good way to run
experiments.

So I turned to a serial USB cable... not much success there either,
since those typically run with RS232 voltages (+/- 3V-15V), but
the ESP8266 can only handle 3.3V.

I'll have to order a more suitable adapter which outputs only 3.3V.
I found one based on the CP2102 chip, which appears to do exactly
this. With this I should then also be able to flash the
ESP8266 with updated firmware (or even MicroPython).

I guess I could also use a RasPi for interfacing to the ESP8266,
since the RasPi pins also use 3.3V UART levels:

    http://elinux.org/RPi_Low-level_peripherals

While reading up on the ESP8266 I also started to wonder whether
using the AT command interface is really such a good approach.
A native program running on the ESP8266 as Radomir suggested may
be better to simplify the connection to the Microbit.

I guess the main use of the wifi connection would be to send
data somewhere, rather than receiving data on the MB, so perhaps
a simply client interface for the MB would be enough to get
things going.


On 20.01.2016 21:21, Radomir Dopieralski wrote:
> The micropython port is in a kind of unfinished experimental state, but
> there is a tutorial on how to compile and upload it here:
> 
> https://learn.adafruit.com/building-and-running-micropython-on-the-esp8266/
> 
> I also worked a bit on the documentation for it, so it should be mostly
> up to date. Unfortunately, due to the way it is organized, it's not
> possible to make it available on readthedocs or similar service, so you
> will have to build it with Sphinx locally.
> 
> Other than that, there is also an Adroid core for that board, so you can
> use the Arduino IDE to program it, which gives you a much more complete
> control over the board.
> 
> The AT commands are plain-text, but you can of course write your own
> program that communicates with the Micro:bit in any way you want. If
> you use the I²C interface, for instance, you will still have the REPL
> available on the serial console. You could have a HTTP server running
> on the ESP8266, for instance...
> 
> 
> On Wed, 20 Jan 2016 20:53:34 +0100
> "M.-A. Lemburg" <mal at egenix.com> wrote:
> 
>> On 20.01.2016 18:46, Radomir Dopieralski wrote:
>>> Perhaps you should try ESP8266, it's all the rage these days.
>>> If you pick the ESP-01 version, it has 2.54mm pitch pins which
>>> you can connect with standard dupont cables.
>>>
>>> The module comes with a firmware that lets you send and receive
>>> data over wifi using simple AT commands, but you can also program
>>> it yourself. There is even a port of micropython for it.
>>
>> Thanks, Radomir. Do you have the URL for the MicroPython port ?
>>
>> I found that device too after I had posted the RN1723 email
>> below when trying to find related things on Amazon. There is
>> a *lot* of information available for it on the net and it only
>> costs EUR 3 or so when shipped from China. The major advantage
>> I see is that it plugs directly into the breadboard without
>> any soldering.
>>
>> The interfacing is not as easy as for the RN1723, though,
>> which uses clear text commands, whereas the ESP8266 uses
>> cryptic AT commands.
>>
>> ESP8266 Specs:
>> http://espressif.com/en/products/esp8266/
>>
>> ESP8266 Docs:
>> http://bbs.espressif.com/viewtopic.php?f=67&t=225
>>
>> I guess I'll give the ESP8266 a try first and then fall back
>> to the RN1723.
>>
>>
>>> On Wed, 20 Jan 2016 17:57:44 +0100
>>> "M.-A. Lemburg" <mal at egenix.com> wrote:
>>>
>>>> Hello all,
>>>>
>>>> I've been chatting a bit with Nicholas about the Bluetooth
>>>> support in the MB and the problems with the stack using
>>>> too much RAM, so I looked around a bit for alternatives
>>>> and found this neat little device:
>>>>
>>>> RN1723:
>>>> http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385
>>>> http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723
>>>>
>>>> Data sheet:
>>>> http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf
>>>>
>>>> Programming guide:
>>>> http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf
>>>>
>>>> It's fairly cheap, tiny, uses very little power when it's
>>>> idle and comes with a really nice network stack to easily
>>>> get a connection to a wifi network.
>>>>
>>>> Now, I'd love to play with this and see whether I can get
>>>> it working, but need some help from someone who can point
>>>> me to resources showing how to connect the pin casing to
>>>> a breadboard. Even soldering looks like a problem, since the
>>>> pins are tiny.
>>>>
>>>> Is there some kind of adapter I could order with the device
>>>> to get me going ? Ideally one which doesn't require soldering.
>>>>
>>>> The closest I could find was this page:
>>>>
>>>>     http://www.sm-breadboard.eu/
>>>>
>>>> but none of those will fit the RN1723 case.
>>>>
>>>> PS: My electronics days are long over, so I'm using the Microbit
>>>> as a bit of an excuse to slowly get into things again :-)
>>>>
>>>> Cheers,
>>>
>>>
>>>
>>
> 
> 
> 

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Experts (#1, Feb 07 2016)
>>> Python Projects, Coaching and Consulting ...  http://www.egenix.com/
>>> Python Database Interfaces ...           http://products.egenix.com/
>>> Plone/Zope Database Interfaces ...           http://zope.egenix.com/
________________________________________________________________________

::: We implement business ideas - efficiently in both time and costs :::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
                      http://www.malemburg.com/



More information about the Microbit mailing list