meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
3.3k stars 800 forks source link

[Bug]: Improved Display Compatibility for Heltec Wireless Stick V3 (64x32) - Bluetooth Code Display #3345

Closed JanisPlayer closed 3 months ago

JanisPlayer commented 6 months ago

A notice:

I bought this Heltec from MoonMall Store, I thought it was an official reseller. In any case, even the documentation for the Heltec Wireless Stick V3 states that it has a 128x64 pixel display. So I think it's not Heltec's fault, but the shop's fault. I think I was sold an imitation, which you can find on Amazon with a 64x32 pixel display. By the way, the screen really does slip, as the Amazon reviews say for products that have a 64x32 pixel display. I have now contacted the dealer and manufacturer and hope they can tell me whether the Heltec Wireless Stick V3 was really original. I'm thinking about sending it back, so I don't know if I'll take the time to adapt it to such small displays. I will close the issue if it turns out that I received the wrong product here. I'm leaving the warning here so that people who encounter the same problem know what they're dealing with. I'll make an update when I know more and the dealer and manufacturer have responded. But from the product photos I now know that there are several versions, so be careful so that you get the right one. Despite the description of 128x64, I got a 64x32 pixel display. (Edit: I recreated what was shown in the picture, same dealer, looks the same, except that my display is a little further down, so I have no idea, let's see what the manufacturer says or maybe you have that too and you know more. This is supposed to be mine according to the Heltec search and it says 128x64 pixels again. Wireless_Stick_V3/HTIT-WS_V3(Rev1.0).pdf) So since it's probably not really worth complaining about the display in China, I might even keep it here if the manufacturer says that there are no other differences. I can of course advise against buying it, which is why a lot of the example code doesn't run. By the way, if your display moves, the flex cable will hold it. Otherwise it was loosely attached to me. Whether the board can work with Mashtastic functions, yes, probably. But you have to make an IF query whether the display is smaller than 64 in height, if so then the corresponding code must be executed. What you should perhaps also add would be smaller fronts, these exist, they don't look as nice, but they are better than the text constantly moving. In the programming example code I strangely found the resolution 64x32, so it's either Heltec's fault or the owners' fault or there are many versions. In any case, as a customer I would have been happy if Heltec or the dealers had provided the information correctly. But as I said, I can only assume here. Sorry that the note was so detailed, but maybe it will help someone who has the same problem.

Category

BLE

Hardware

Heltec V3

Firmware Version

2.2.25.9d37a8d1

Description

I noticed that the Heltec wireless-stick-v3 has a display error. This seems to be because the information on the manufacturer's website is incorrect. The page: https://heltec.org/project/wireless-stick-v3/ states that it has a 128x64 pixel display, but it is actually a 64x32 pixel display.

I made some changes to https://github.com/meshtastic/firmware/blob/master/src/graphics/Screen.cpp, and at least I was able to display the Bluetooth code. Are there any plans for adapting to such small screens on your end? I am aware that this would involve displaying texts on small screens in a special way, such as moving texts, and programming the recognition of these displays. I have adapted the code on my end so that, for now, only the Bluetooth code is displayed correctly. Such an adjustment is possible with the current code without as many changes as I made.

My test changes:

static void drawFrameBluetooth(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
    int x_offset = display->width() / 2;
    int y_offset = display->height() <= 32 ? 0 : 16;
    display->setTextAlignment(TEXT_ALIGN_CENTER);
    display->setFont(FONT_SMALL); 

    display->drawString(x_offset + x, y_offset + y, "Bluetooth");

    y_offset += FONT_HEIGHT_SMALL;

    display->drawString(x_offset + x, y_offset + y, "Enter this code");

    String displayPin(btPIN);
    String pin = displayPin.substring(0, 3) + " " + displayPin.substring(3, 6);
    y_offset += FONT_HEIGHT_SMALL - 5;

    display->drawString(x_offset + x, y_offset + y, pin);

    String deviceName = "ID: ";
    deviceName.concat(getDeviceName());
    y_offset += FONT_HEIGHT_SMALL - 5;

    display->drawString(x_offset + x, y_offset + y, deviceName);
}

Issue: https://meshtastic.discourse.group/t/heltec-wireless-stick-v3-with-0-49-oled/9158/7

Screenshots: Oled64x32

caveman99 commented 6 months ago

I have one of these incoming and will take a stab at it. Thanks for the initial work. No promises though :-)

JanisPlayer commented 6 months ago

@caveman99 Thank you for the information; now I know that it's probably normal with the resolution. It seems like the product description and documentation might be incorrect.

That's cool! If it works out and they manage to do it, I'll be excited. I've found alternative fonts that can further reduce the text size. With such a small display resolution, displaying only the essentials is necessary, and dealing with long texts requires shortening or making the text move. It's indeed a complex task; I wish you much success. But I believe as long as the Bluetooth code is displayed, it's already sufficient. :)

DrBlackross commented 3 months ago

putting battery life, node count and or signal strength on other screen that are toggle-able with the usr button would be cool

(trying to find screen settings in the rest of the code is a bit tricky so far)