Using the ssd1306.py driver on the ESP8266

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
MicroPythoneer
Posts: 2
Joined: Sat Aug 13, 2016 6:18 pm

Using the ssd1306.py driver on the ESP8266

Post by MicroPythoneer » Sat Aug 13, 2016 6:27 pm

Hi,

I've flashed the `ESP8266` version of `MicroPython` to my `ESP8266` development board (Amica) and I'm trying to use the official `ssd1306` driver found in `micropython/drivers/display/` directory on the GitHub page (here:
https://github.com/micropython/micropyt ... ssd1306.py) to drive my OLED display using I2C.


My problem is that I can't load the library on my ESP8266. I've tried at the python prompt on my board:

from SSD1306 import ssd1306
from drivers import ssd1306
import ssd1306
import SSD1306

but the error every time is "... module <x> not found".

How can I use the ssd1306 official driver on my ESP8266 board? Thanks!

Sebastian
Posts: 18
Joined: Sat Oct 24, 2015 8:09 pm

Re: Using the ssd1306.py driver on the ESP8266

Post by Sebastian » Sun Aug 14, 2016 7:05 am

What version are you using? I'm using 1.8.3 and import ssd1306 works for me on a Wemos D1 mini.
Can you import e.g. onewire?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Using the ssd1306.py driver on the ESP8266

Post by deshipu » Sun Aug 14, 2016 7:56 am

If you are compiling your own firmware, you need to symlink the file to esp8266/scripts for it to be included. Alternatively, you can copy the file onto the board with WebREPL after flashing -- either will work.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Using the ssd1306.py driver on the ESP8266

Post by pythoncoder » Sun Aug 14, 2016 8:04 am

If you're using a release build of firmware I think you need to use esp8266-20160809-v1.8.3.bin rather than the latest nightly build. It seems that the nightly builds don't include the libraries. Alternatively copy the file as suggested by @deshipu.
Peter Hinch
Index to my micropython libraries.

Post Reply