[Microbit-Python] SPI APIs on BBC micro:bit and ESP8266

Radomir Dopieralski microbit at sheep.art.pl
Sun Nov 20 11:30:29 EST 2016


It may be still a little problematic, because MicroPython on the ESP8266
doesn't have an implementation of I2C slave (and neither does
Micro:bit).

On Sun, 20 Nov 2016 16:05:39 +0000
Mark Shannon <mark at hotpy.org> wrote:

> Hi,
> 
> If you use the latest firmware, you can use any of the pins for I2C.
> Hope that helps.
> 
> Cheers,
> Mark.
> 
> On 20/11/16 15:04, M.-A. Lemburg wrote:
> > Hello,
> >
> > over the weekend, we tried to get a connection from a BBC Microbit
> > to an ESP8266, both running the latest MicroPython for the resp.
> > platform, established via SPI.
> >
> > We found several problems with this:
> >
> > * the SPI APIs on the ESP8266 are all non-blocking and return
> >   whatever is currently in the buffer (using 0x00 for missing data
> >   and 0xff in case no connection is available)
> >
> > * the SPI APIs on the Microbit are all blocking, only returning
> >   if all data is sent / received
> >
> > * the connection is rather unreliable: we had lots of data loss or
> >   data corruption, with bytes not being transmitted or with lost
> > bits
> >   - we tried several different baud rates without success
> >
> > On the plus side, we did get SPI to work fine between two Microbits,
> > but that's not really what we were after, since we wanted to get
> > one of the Microbits in our mesh network connected to a WLAN and
> > work as gateway.
> >
> > The blocking nature of the MB APIs make it difficult to write
> > interfaces which aim at being fault tolerant and work as
> > gateways. Having non-blocking versions would be better for this
> > sort of application.
> >
> > Are there better ways to connect MBs and ESP8266 ?
> >
> > We also tried I2C, but gave up, since the pins on the MB for
> > accessing I2C were too tiny to connect to without a breakout
> > board.
> >
> > BTW: We were impressed by the new radio module. Getting MBs
> > to connect using these low level radios is really easy.
> >
> > Cheers,
> >  
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit


-- 
Radomir Dopieralski


More information about the Microbit mailing list