OledDisplay ERROR : Painting error

I can’t get any basic samples working with my Hydra and Seeed OledDisplay. I installed the prerequisites and the GHI NETMF v4.1 and .NET Gadgeteer Package with the OSH.

I can create the project and run it with the ProgramStarted method empty. I can even call

oledDisplay.DebugPrintEnabled = false;

but an calls to

oledDisplay.SimpleGraphics

such as

oledDisplay.SimpleGraphics.ClearNoRedraw();

throws an exception:


Program Started
    #### Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (1) ####
    #### Message: 
    #### Gadgeteer.Modules.Seeed.OledDisplay::Paint [IP: 0014] ####
    #### Gadgeteer.Modules.Module+DisplayModule+SimpleGraphicsInterface::Redraw [IP: 000b] ####
    #### Gadgeteer.Modules.Module+DisplayModule+SimpleGraphicsInterface::Clear [IP: 003c] ####
    #### Gadgeteer.Modules.Module+DisplayModule+SimpleGraphicsInterface::.ctor [IP: 0028] ####
    #### Gadgeteer.Modules.Module+DisplayModule::get_SimpleGraphics [IP: 000b] ####
    #### GadgeteerApp4.Program::ProgramStarted [IP: 0018] ####
    #### GadgeteerApp4.Program::Main [IP: 0015] ####
A first chance exception of type 'System.NullReferenceException' occurred in GTM.Seeed.OledDisplay.dll
OledDisplay ERROR : Painting error

I am a hardware n00b but i thought the point of the gadgeteer initiative was to make this stuff more approachable for code monkeys like me :wink:

Thanks in advance for any help or suggestions.

Hi Jimmy,

Welcome to the forum!

Sorry to hear you’re having trouble. I have the Seeed OLED display module, and I’ve been able to use it successfully. The project where I used it was very simple, just reporting the values from the Seeed Compass and GPS modules. Here’s an example of the code I used:

oledDisplay.SimpleGraphics.BackgroundColor = GT.Color.White;
oledDisplay.SimpleGraphics.DisplayTextInRectangle("Now running!", 2, 2, 120, 20, GT.Color.Black, Resources.GetFont(Resources.FontResources.NinaB));

I’m assuming from the fact that you’re using the default name that you have the Seeed OledDisplay module drivers installed, and that you dropped the module onto the design surface, and connected it to a socket with a letter matching the letter(s) on the module?

Given that this module is made by Seeed Studio, you might also want to check on their forums to see if you can find any info on the error there:

[url]http://www.seeedstudio.com/forum/[/url]

Andrew-

I think I must have set things up incorrectly or used an out of date GHI installer. Originally only the FEZ Spider libraries were installed and it was really hard to find the GHI package with the OSH libraries. I will probably not be able to try again until this weekend.

-Jimmy

This will be taken care of, the new SDK (non-beta) will finally be out this week :slight_smile:

Yay! I would be happy to test anything if you need it.

Gus-

I have downloaded the new 1/5 release and updated my hydra firmware using MFDeploy. When I have the OledDisplay attached to socket 4 (which is the socket it does when using the auto connect in the GUI) I get a hardware error even with a new empty solution. If I reconnect to socket 3, I can get an empty solution to build and deploy without error. If I attempt to do any rendering to the display, it crashes.

You can get my solution and log here: http://cl.ly/2q1E1t2D3D2y3E2n0X14

The package includes our version of compiled seeed drivers. please install it as explained here (this will eb automated tomorrow morning so no one needs to do this in future)
http://www.tinyclr.com/forum/12/5358/#/2/msg51244

Now, make a NEW project and only add OLED to your main board. If you have any issues, do not do anything, just let us know.

:frowning:

I installed the seed msi as you instructed. While get did get some fancy new designer modules in my toolbox.

Still the same hardware error if on socket 4 and null ref error if on socket 3.

Socket 3 log: http://cl.ly/1W3T231q0n3H343l102A
Socket 4 log: http://cl.ly/010q183a1M2Y1m3R1D1D

What can I do to get you more helpful diagnostic information?

That is all we need. This maybe a bug in Hydra.

My money is on user error. I have done enough tech support to know that is usually the case, especially with so many positive responses to the latest build.

I just installed VS C# Express et al on a different laptop with the same results. I also changed the connecting ribbons just in case.

I give up for now. If there is any other helpful things I can do, let me know.

@ Jimmy

After updating to the latest SDK and updating the firmware on my Hydra, I tried one of my existing projects that used the OLED display on my Spider board, and swapped it over to use the Hydra.

Unfortunately, I’m getting the same “Painting error” you are, which means that the good news is that it’s likely not user error (either that, or both of us are making the same error).

The bad news is that this means it’s likely a problem with Hydra and the OLED display module.

@ Gus, have you guys had a chance to test Seeed’s OLED module with Hydra? If so, can you point us to a working sample?

@ Jimmy

Do you only have the Hydra mainboard, or do you have a Spider as well? If you’re willing to make a trek to my neck of the woods (or we could meet somewhere nearby), I’m happy to let you test your OLED module on my Spider mainboard, which might help further confirm whether this is a Hydra-specific issue (though that seems very likely given that I’m experiencing the same issue when I try the OLED module with my Hydra board).

It was only tested on spider but this will change tomorrow morning.

This is a confirmation that OLED display is not working on hydra. We tried to squeeze this in today but we ran out of time.

No worries, we will make it work in a way or another, stay tuned :slight_smile:

Hey guys; just FYI I think there might be a socket issue as well.

If I plug my OLED into Socket 3 I get the same error as Jimmy.

HOWEVER, if I plug it into Socket 4 I get this

Using mainboard GHIElectronics-FEZHydra version 1.0
    #### Exception System.ArgumentException - 0xfd000000 (1) ####
    #### Message: 
    #### Microsoft.SPOT.Hardware.HardwareProvider::NativeGetSpiPins [IP: 0000] ####
    #### Microsoft.SPOT.Hardware.HardwareProvider::GetSpiPins [IP: 0013] ####
    #### Microsoft.SPOT.Hardware.SPI::.ctor [IP: 0019] ####
    #### Gadgeteer.Interfaces.SPI::.ctor [IP: 00c4] ####
    #### Gadgeteer.Interfaces.SPI::.ctor [IP: 0012] ####
    #### Gadgeteer.Modules.Seeed.OledDisplay::.ctor [IP: 0065] ####
    #### GadgeteerApp1.Program::InitializeModules [IP: 0006] ####
    #### GadgeteerApp1.Program::Main [IP: 0010] ####
A first chance exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll

And boo for not being able to use both LCDs at the same time. I’ll have to see if I can pester Seeed into making a version that won’t have Gadgeteer throw a fit.

You can use both :slight_smile: let me make a video to make to smile.

That would make my day because Studio is yelling at me saying

Using mainboard GHIElectronics-FEZHydra version 1.0
INVALID HARDWARE CONFIGURATION: Cannot use more than one display if one of them uses the LCD controller hardware

And I’m really looking forward to a little 2 screen action. :smiley:

I think we are all forgetting that gadgeteer is 100% open source so there is nothing you can’t do. Let me write something up to show how easy it is.

If its in c# and the stuff is in an svn, hg, or git repo, I’d be happy to try and debug my problem.