Forum.

 

Need help or have a question? Join the conversation in our community topics and share your ideas, tips, or challenges—we’d love to hear from you! Before posting, be sure to check our

 

?

Troubleshooting the...
 
Benachrichtigungen
Alles löschen

[Gelöst] Troubleshooting the OLED Screen

7 Beiträge
2 Benutzer
0 Reactions
5,721 Ansichten
AgentKnopf
(@agentknopf)
Eminent Member
Beigetreten: Vor 3 Jahren
Beiträge: 27
Themenstarter  

I am not sure if this is the right place but in case its not feel free to move the topic :) . Long story short - there is an OLED screen in the emote pack and in fact it has been working for me on several occasions. However - right now i am trying to execute a simple OLED Screen routine (see attached screenshot):

  1. The OLED is connected to Port 3 (my information is that it currently only works on Port 3) so in the code I select the port (3)
  2. I also selected the "Show" block because i don't know what it means xD and it looks like it could mean the screen needs to be ON
  3. Then I picked the eyes...
  4. and the mouth and then I wait for 2 seconds

Now In the Monitor I get the following output:

Warning: I2C(-1, ...) is deprecated, use SoftI2C(...) instead                                                                                                                                           
Traceback (most recent call last):                                                                                                                                                                      
  File "<stdin", line 7, in <module                                                                                                                                                                     
  File "ottooled.py", line 10, in __init__                                                                                                                                                              
  File "ssd1306.py", line 112, in __init__                                                                                                                                                              
  File "ssd1306.py", line 38, in __init__                                                                                                                                                               
  File "ssd1306.py", line 73, in init_display                                                                                                                                                           
  File "ssd1306.py", line 117, in write_cmd                                                                                                                                                             
OSError: [Errno 116] ETIMEDOUT       
 
I am connected via USB and it looks like it cant access the OLED screen for some reason (OSError: [Errno 116] ETIMEDOUT). Any way I can troubleshoot this? thank you!


   
Zitat
Schlagwörter für Thema
Camilo
(@cparrapa)
Developer Admin
Beigetreten: Vor 3 Jahren
Beiträge: 112
 

Hi @agentknopf you found a bug in the recent update we moved the "default" OLED connection to #1 as default according to the manual, the "setup block" you are using there is to change the connector number in case you want to have it in different to # accommodate other components.

the generator is not deleting the original GPIO declaration:

oled = OttoOled(19, 18) # Connector 1
 
oled = OttoOled(21, 22) # Connector 3
 
We will fix that, meanwhile just connect your OLED to #1 and you wont even need to use the "setup block"
 
Thanks!


   
AntwortZitat
AgentKnopf
(@agentknopf)
Eminent Member
Beigetreten: Vor 3 Jahren
Beiträge: 27
Themenstarter  

@cparrapa I confirm this as fixed - works in port 1 no issues :) thank you !



   
AntwortZitat
AgentKnopf
(@agentknopf)
Eminent Member
Beigetreten: Vor 3 Jahren
Beiträge: 27
Themenstarter  

Hi there i wanted to follow-up on the OLED issue (see image attached with code and error message). I wanted to ask if the fix has been published so i can chose the port myself now for the oled screen using the setup block? I am asking because i wanted to do the following:

  • OLED in port 3
  • Proximity sensor in port 1 (Because i dont think i can set the port for it manually? And it does not work in Port 3)
  • MP3 Player in Port 2

Thank you :) 



   
AntwortZitat
Camilo
(@cparrapa)
Developer Admin
Beigetreten: Vor 3 Jahren
Beiträge: 112
 

Hi @@agentknopf

We had put the setup block at the end of all display blocks because of the I2C settings it  must be put at the end of the block code in order to delete the default connection (for now is the best solution for changing the placement of the oled with blocks).

Your code can work if is done as the attachment, sorry for the late response we have been busy with the Advent calendar and promos. :D



   
AntwortZitat
AgentKnopf
(@agentknopf)
Eminent Member
Beigetreten: Vor 3 Jahren
Beiträge: 27
Themenstarter  

@cparrapa thank you for getting back to me - I tried out your suggestion (see attachment) but I am getting an error and I noticed that the widget suddenly has two ports instead of one like in your screenshot - is it a bug? I mean the settings block for OLED: In your screenshot it has one option to select a port, which makes sense. But in my version of the wordblock editor (web) it has 2 for some reason which seems odd :) 

Also - dont be confused by my code, i defined functions but i am not calling them anywhere yet - which should not be a problem i guess - the issue is already simply with defining the i2c

I tried port 3, error message:

Traceback (most recent call last):                                                                                                                                                                      
  File "<stdin", line 3, in <module                                                                                                                                                                     
NameError: name 'SoftI2C' isn't defined  (I updated the Otto libraries a few days ago)
 
Python code:
import array # Needed for polygons
from ssd1306 import SSD1306_I2C
i2c = SoftI2C(sda=Pin(21), scl=Pin(22))
oled = SSD1306_I2C(128, 64, i2c)
import machine, time                       #importing machine and time libraries
from time import sleep                     #importing sleep class
from machine import Pin, ADC, PWM, SoftI2C #importing classes


   
AntwortZitat
Camilo
(@cparrapa)
Developer Admin
Beigetreten: Vor 3 Jahren
Beiträge: 112
 

@agentknopf 

Two ports showing fixed, We have a current silly bug that when function brackets are above the start block it puts all definitions up in the code, that is why the error shows 'SoftI2C'  becase it is defined after the gipio declaration of the oled. For now you can just move the function at a level below the start block. We will check how to avoid that.



   
AntwortZitat
Nach oben scrollen
Sie werden nach der Produkteinführung verfügbar sein.