>>> Join Us in the Fight Against Air Pollution

AirGradient Forum

Library code for DIY Pro not working correctly with the display

Hi,

I just got a couple DIY Pro presoldered, and they work fine out of the box, but I’d like to change the APIROOT as well as set it to fahrenheit instead of celsius.

The online flashing works fine if I want to change it to fahrenheit, but if I want to use the library code to update the APIROOT, and I use the default for the display:

// Display bottom right
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

then the display is upside down.

If I use the other code:

// Replace above if you have display on top left
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R3, /* reset=*/ U8X8_PIN_NONE);

Then the text is rotated 90 degrees and is truncated (since it’s not laid out for portrait).

Is the code that is used in the web flashing available to grab somewhere to edit?

Also, the instructions for the pre soldered DIY pro still says:
“Once it is installed, go to File, Example, AirGradient and select the PM OLED code”

instead of “DIY Pro” code.

It looks like U8G2_R2 is what you want (instead of R3)

There are two build instructions with the orange flash button. One for the presoldered kit and one for the normal one which has the window on a different place.
Please flash the presoldered one with this instruction: The AirGradient DIY Air Quality Sensor (Pro Presoldered-Version)

To get the code to change the API endpoint just follow the same instructions and go to section " Manual Flashing with the Arduino Software"

@Achim_AirGradient yeah, I used those instructions, but the _R3 in the library is incorrect, it has the display rotated 90 degrees from where it should be. I’ll attach an image of what it looks like with _R3

Once I changed it to _R2 everything worked as expected.

The presoldered instructions still say “select the PM OLED code” as well, instead of DIY_PRO, FYI

I agree, the current code is wrong.
Please update the code to _R2 to confuse less experienced people!
also please update the name of the Example to be loaded to DIY Pro, the website still says PM Display…

anyway, thanks for this nice device:)

Just updated the library. Version 2.0.2 should address these issues.
Also added the code for the TVOC module SGP40 that we currently test.

1 Like