Welcome! Log In Create A New Profile

Advanced

Repetier with SSD1306 oled display 128x64 ?

Posted by Gigio2k 
Repetier with SSD1306 oled display 128x64 ?
May 11, 2015 05:15PM
I guys, i connect a 0.95" oled lcd to the i2c pin on ramps 1.4, upload a test sketch and works great, so... i try to "merge" the existing ui class to work with this lcd but nothing appen,

i setup the i2c port and

/**
What display type do you use?
0 = No display - do not use here. Set FEATURE_CONTROLLER 0 instead
1 = LCD Display with 4 bit data bus
2 = LCD Display with 8 bit data bus (currently not implemented, fallback to 1)
3 = LCD Display with I2C connection, 4 bit mode
4 = Use the slower LiquiedCrystal library bundled with arduino.
IMPORTANT: You need to uncomment the LiquidCrystal include in Repetier.pde for it to work.
If you have Sanguino and want to use the library, you need to have Arduino 023 or older. (13.04.2012)
5 = U8G supported display
*/
#define UI_DISPLAY_TYPE 3
...
#define UI_DISPLAY_I2C_ADDRESS 0x3C (yes is correct)

but after that i'm lost !!!
display is off , what i miss ?


how can i setup the data pin (SDA and SCL) ?


in this picture work with the adafruit library

...
#include SPI.h
#include Wire.h
#include Adafruit_GFX.h
#include Adafruit_SSD1306.h

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
...




Thanks in advance


Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
May 12, 2015 09:19AM
First, that display is not supported out of the box.

DISPLAY_TYPE 3 is 4x20 character display controlled over i2c, that is not what you have.

You need u8g_lib i guess with the addition of your driver and also change the initalization which is now for a st920 display. So maybe it is easiest to use display 11 as starting point which uses that and adjust initalization in ui.cpp and add driver in u8g_lib from the original u8g_lib package. Just paste it along with the other files I have already added in that file.

If you can use SPI instead of i2c interface. I see that display supports different modes or are this different models?


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Repetier with SSD1306 oled display 128x64 ?
May 12, 2015 10:12AM
Display 11 ?

I try to find 11 in the code but the only display i have in the firmware are :

/**
What display type do you use?
0 = No display - do not use here. Set FEATURE_CONTROLLER 0 instead
1 = LCD Display with 4 bit data bus
2 = LCD Display with 8 bit data bus (currently not implemented, fallback to 1)
3 = LCD Display with I2C connection, 4 bit mode
4 = Use the slower LiquiedCrystal library bundled with arduino.
IMPORTANT: You need to uncomment the LiquidCrystal include in Repetier.pde for it to work.
If you have Sanguino and want to use the library, you need to have Arduino 023 or older. (13.04.2012)
5 = U8G supported display
*/


Maybe is better the other solution using U8G so #define UI_DISPLAY_TYPE = 5

and change code where is needed.


about SPI, im not quite sure but i think this is only i2c


Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
May 12, 2015 01:02PM
if can help this is the right config for U8Glib

#include "U8glib.h"

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are SCK = 13 and MOSI = 11)


Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
May 13, 2015 12:21AM
More exactly

FEATURE_CONTROLLER 11
as defined in ui.h sets

UI_DISPLAY_TYPE = 5

and in ui.cpp you see it include u8glib_ext.h which is all required u8g lib files in one file concatenated. It may be possible that the driver is missing for that display type simple becaus eit wa snot needed before.

There is currently only one iniatalization U8GLIB_ for ST920 whcih you would need to replace with your version.

If I get the time I will see if I can improve the system a bit to support other u8glib drivers directly from uiconfig with type 5. I don't have other displays so I can not test if it will work, but I guess it will make things easier.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Repetier with SSD1306 oled display 128x64 ?
May 13, 2015 03:57AM
ok i'll try and let you know

following repetier naming i add :

//#define U8GLIB_ST7920 // Currently only this display from u8g lib is included.
#define U8GLIB_SSD1306

and now i'm following all the reference to U8GLIB_ST7920 and duplicate/modify for U8GLIB_SSD1306

my only dubt is the initializzation of the display :

in a u8g sample is :

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are SCK = 13 and MOSI = 11)

and that became :


[ui.cpp ]
void initializeLCD()
{
...

#ifdef U8GLIB_SSD1306
u8g_InitI2C(u8g_t *u8g, u8g_dev_ssd1306_128x64_i2c, uint8_t options); /* use U8G_I2C_OPT_NONE as options */
#endif

right ?


device reference : [code.google.com]


Edited 1 time(s). Last edit at 05/13/2015 03:59AM by Gigio2k.

Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
May 13, 2015 07:49AM
Nothing new !
display stay off, i think i miss a pin definition somewere.

should i replace the partial content of u8glib_ex.h with a official u8glib.h ?

Ok here step by step the diff :
#define FEATURE_CONTROLLER was 11 (i used before a reprap full graphics display, now i have removed it and connect the mini display to 4 i3c pins)



Set display on 5 (u8g) and define a new var



implements the new initialize stuff



here the test-firmare
Repetier-Firmware-2015-05-03__FUNZIONANTE__2.rar

here a working u8g example for test display connection :
GraphicsTest.pde

Thanks

Edited 2 time(s). Last edit at 05/13/2015 11:35AM by Gigio2k.

Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
May 13, 2015 11:38AM
UPDATE :

i start add stuff to u8glib_ex and resolve all the error till that :



here the diff file :

diff_u8glib.ex.txt

and i'm stuck here !


Any help would be great (y)


Thanks


Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
May 16, 2015 01:30AM
Ok I have added SSD1306 support for I2C and software SPI. So all you now should need to do is in uiconfig.h setting

#define U8GLIB_SSD1306_I2C

instead of the ST920 driver. Everything else should be changed already, also untested. AllI could test was that it compiles, so no function are missing and all conversions were added. Hope it works now.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Repetier with SSD1306 oled display 128x64 ?
May 16, 2015 03:43AM
yawning smiley you are the best !

i'll try asap !!

Edited 1 time(s). Last edit at 05/16/2015 03:52AM by Gigio2k.

Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
May 16, 2015 05:25AM
Noooooooooooo sad smiley YOU HAD THE WRONG DISPLAY !!!

This is the most common :

u8g_dev_ssd1306_128x64_i2c not the 2x version so:

ui.cpp:770
u8g_InitI2C(&u8g,&u8g_dev_ssd1306_128x64_i2c,U8G_I2C_OPT_NONE);


also now you need import the class u8g_pb8v1.c in u8glib_ex.h
and at the end when u try to compile u'll get the same error as me :/


and also that u miss a thing in define the vars :



Patch the definition in ui.h:513
//#define U8GLIB_ST7920
#define U8GLIB_SSD1306_I2C



ok now the code in good for the wrong display sad smiley

in the next post i show u my try to fix


Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
May 16, 2015 06:13AM
So, now is compiling with the wrong display so, i change the initializzation:



add the "buffer" definition missed



from u8blib v1.11
added - u8g_pb8v1.c class and define a missin var:

#define U8G_DEV_MSG_SET_COLOR_ENTRY 60
#define U8G_DEV_MSG_SET_COLOR_INDEX 60




now i feel like this :/




Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
May 16, 2015 09:30AM
Ok, did not know that is a different thing. Have fixed it (i guess) also I did not define

#define U8G_DEV_MSG_SET_COLOR_ENTRY 60
#define U8G_DEV_MSG_SET_COLOR_INDEX 60

which were already there. I guess you copied you changes at the beginning so it came before the definition. Anyhow it now compiles the right driver so i guess it will also work for you.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Repetier with SSD1306 oled display 128x64 ?
May 16, 2015 11:24AM
you are the best (2) ! smileys with beer smileys with beer smileys with beer




Edited 1 time(s). Last edit at 05/16/2015 11:25AM by Gigio2k.

Gigio2k - [Pescara] - RepTrash grinning smiley -=Delta G2K=-
| My Thingverse stuff | Vi aspettiamo su Stampanti 3D Italia su Facebook |
Re: Repetier with SSD1306 oled display 128x64 ?
December 09, 2015 06:07AM
I try to implement ssd1306 in the arduino due Repetier Firmware.
If i scan the i2c ports of the due, i get these adresses:
Scanning...
I2C device found at address 0x3C !
I2C device found at address 0x50 !
done

I think, the display is the 0x3C
If i use U8gblib, i use one of these lines:
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE|U8G_I2C_OPT_DEV_0);
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0|U8G_I2C_OPT_NO_ACK|U8G_I2C_OPT_FAST);
//U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);
With the examples, the display works...

I got not compilation errors now, but i can't get the display working sad smiley
Re: Repetier with SSD1306 oled display 128x64 ?
December 09, 2015 06:46AM
I got This Error now, so i think, there are missing some files in the u8glib_ex.h


ui.cpp.o: In function `initializeLCD()':
C:\Users\Matze\AppData\Local\Temp\build7932113526837095422.tmp/ui.cpp:712: warning: undefined reference to `u8g_SetRot180'
C:\Users\Matze\AppData\Local\Temp\build7932113526837095422.tmp/ui.cpp:725: warning: undefined reference to `u8g_dev_ssd1306_128x64_i2c'


Please help me sad smiley
Here is a Link to my modified repetier due.
[www.dropbox.com]

Edited 1 time(s). Last edit at 12/09/2015 06:46AM by mw2matze.
Re: Repetier with SSD1306 oled display 128x64 ?
December 09, 2015 07:02AM
Please use a more recent version of repetier. u8g was extended by many new devices and yours seems also to be included now. As well as rotate function.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Repetier with SSD1306 oled display 128x64 ?
December 09, 2015 07:16AM
Thanks, but where can i find the latest version? tongue sticking out smiley
Re: Repetier with SSD1306 oled display 128x64 ?
December 09, 2015 07:35AM
I found it smileys with beer
But with the new version i get this error:


ui.cpp.osad smiley.data.u8g_dev_ssd1306_128x64_i2c+0x8): warning: undefined reference to `u8g_com_null_fn'
Re: Repetier with SSD1306 oled display 128x64 ?
December 09, 2015 09:18AM
The file containing u8g_com_null_fn is not included. Copy it to u8glib_ex.h and it will compile.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Repetier with SSD1306 oled display 128x64 ?
December 10, 2015 11:10PM
I don't know, what the problem is. sad smiley
Everything compiles now, but the display shows nothing.
If i use U8gblib, i use one of these lines:
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE|U8G_I2C_OPT_DEV_0);
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0|U8G_I2C_OPT_NO_ACK|U8G_I2C_OPT_FAST);
//U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);
And it works at every line.

My current modified repetier is in my dropbox. Please take a look at it, if you have some time. sad smiley
[www.dropbox.com]
Re: Repetier with SSD1306 oled display 128x64 ?
January 14, 2016 12:34PM
I'm trying to build he same setup:
Arduinon DUE + Ramps FD + OLED display over I2C + Repetier firmware 0.92

I tried sample from Adafruit lib and it works fine.

Now I'm trying to get display working with Repetier.
I set:
FEATURE_CONTROLLER 11
UI_DISPLAY_TYPE = 5

Enable SSD1306
//#define U8GLIB_ST7920
#define U8GLIB_SSD1306_I2C

Display is off. Can't make it work ((

Does anybody successfully connected oled with Repetier 0.92?
Re: Repetier with SSD1306 oled display 128x64 ?
January 14, 2016 09:43PM
Downloaded latest code from githab.

Found interesting thing - if feature controller =11 - all data from uiconfig.h is ignored.
So, I changed FEATURE_CONTROLLER 1.

After that I get compilation error about undefined reference to `u8g_com_null_fn'. Copied it from ug8 lib.

Now it's compiled but OLED still doesn't work.
Re: Repetier with SSD1306 oled display 128x64 ?
January 16, 2016 09:07AM
You can not simply use controller 11. Also that uses u8g it uses a different chip.
#ifdef U8GLIB_SSD1306_I2C
    u8g_InitI2C(&u8g,&u8g_dev_ssd1306_128x64_i2c,U8G_I2C_OPT_NONE);
#endif
#ifdef U8GLIB_SSD1306_SW_SPI
    u8g_InitSPI(&u8g,&u8g_dev_ssd1306_128x64_sw_spi,  UI_DISPLAY_D4_PIN, UI_DISPLAY_ENABLE_PIN, UI_DISPLAY_RS_PIN, U8G_PIN_NONE, U8G_PIN_NONE);
#endif

Are the 2 ways to use your chip. So make your own controller and define U8GLIB_SSD1306_I2C or define it uiconfig.h with the right controller. As you see it uses no options so it shares hardwere i2c with eeprom. Uses your display also 3.3v i2c or 5v? What about the speed, is it compatible or causes it even problems, Using same protocol with several devices often introduces new problems. Try software spi if possible.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Repetier with SSD1306 oled display 128x64 ?
July 19, 2017 07:34PM
TinyOLED is already doing this and work with Marlin, please try go to www.hkmakers.hk or www.facebook.com/hkmakers.hk for details

Sorry, only registered users may post in this forum.

Click here to login