Closed xonu314 closed 4 years ago
You are using an old version of ssd1306.py. Go into the directory holding the copy of the MicroPython repo on your PC and issue
$ git pull origin master
This will update your sourcecode. You will find the new version in drivers/display - this line shows the feature whereby it is derived from framebuf.
I suggest copying the file to ports/esp8266/modules and rebuilding. That way it will be frozen as bytecode and will save RAM.
Thank you very much. You were right, I was indeed using an old version of ssd1306.py. Seems obvious now that you have mentioned it ;-) Using the new version in my modules directory for my custom firmware, I can now display custom fonts and so far I am not seeing any memory issues (although it is only running for about an hour or so). Thanks for your great support!
Hello,
first of all, thank you very much for providing these utilities, enabling to use custom fonts on an OLED with Micropython.
I have an OLED (128x64) connected to an ESP8266. Using the SSD1306 driver with the latest Micropython firmware (esp8266-20190529-v1.11.bin), I am able to use various fonts after "converting" them with your font_to_py script and to show them on the display using writer.py. I have some sensors (DHT22 and a light dependent resistor) connected to the ESP. I read the values and display the results on the OLED. Initially all works well. However, sooner or later I get following error:
MemoryError: memory allocation failed, allocating ... bytes
According to your comments from #11 I have compiled a custom firmware, in which I have included my font file (generated from font_to_py). I built the new firmware following this tutorial: https://www.youtube.com/watch?v=jG7WBY_vmpE
Using the custom firmware I do the following:
The last line causes:
Using the official firmware, the exact same lines do not cause any error and I am able to display text using
With the custom firmware I can show text with:
Following are the modules in my custom firmware:
Do you have any idea about what I am not doing correctly?
I don't have much experience with Micropython or ESPs and topics such as Framebuf are still "black boxes" to me, so if I am not seeing something obvious or if I am posting this at the wrong place, I do apologize.
Best regards, Sonu