Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft PR to support new device unPhone #3530

Closed
wants to merge 20 commits into from
Closed

Draft PR to support new device unPhone #3530

wants to merge 20 commits into from

Conversation

garethhcoleman
Copy link
Contributor

@garethhcoleman garethhcoleman commented Apr 1, 2024

Hello

I've been encouraged on Discord to put in this early PR, so I can get feedback without going too far wrong!

I have helped develop the unPhone (website shop link). It's got a 480x320 touchscreen, RFM95W 868MHz LoRa, battery, accelerometer/compass, sd card, RGB and IR LED's, & vibration feedback. Now I am porting the rather fantastic Meshtastic firmware to our device.

I've got the screen, radio and sd card (seemingly) working in this PR. I had to make very minor changes to files in /graphics to use large fonts, a small bit of setup in main.cpp because our device has the backlight on a I2C expander. The main additions in this PR are the creation of a new variant.h and platformio.ini file for the new device, and a new driver configuration in graphics/TFTDisplay.cpp (using the existing LovyanGFX pattern).

I am requesting advice and guidance to make integrating these changes in the best way possible. For example, I believe the patterrn I have used for implementing HX8357 support for our device could be re-used by others.

Please accept my apologies if I've missed some guidance in preparing this PR - I am very keen to do this 'right' so just let me know if I should re-work anything etc!

We can supply hardware (gratis no obligations) to developers if that would be useful.

@CLAassistant
Copy link

CLAassistant commented Apr 1, 2024

CLA assistant check
All committers have signed the CLA.

@caveman99 caveman99 marked this pull request as draft April 1, 2024 17:15

build_flags = ${esp32_base.build_flags}
-D PRIVATE_HW
-D UNPHONE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a technicality - once this is finished, please register a proper device identifier in our protobufs here. The PRIVATE_HW is only for development or unpublished ports. You can probably lose the UNPHONE define this way too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I wondered if I should do that now or later.... I'll go and put in a PR to that repo now. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR against the protobufs submitted here

Wire.write(0x04); // Backlight on
Wire.write(0x22); // G&B LEDs off
Wire.endTransmission();
#endif
Copy link
Member

@caveman99 caveman99 Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to propose a wider scope for the use of port expanders in meshtastic. Which chip do you use exactly?
Suggestion would be to leave this as-is and replace later with proper handling of port expanders.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That feels like a much better solution than the hacky way I have implemented it so far. Unphone uses TCA9555 which is a popular choice of expander.
I would be happy to help implementing this correctly.

Issues.txt Outdated
Utilise RGB led for notifications modules/ExternalNotificationModule.cpp AmbientLightingThread.h
Utilise Vibration for notifications modules/ExternalNotificationModule.cpp
Use accelerometer/compass Configuration.h, main.cpp, add library
use IR leds new code!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure the Todo list is not in the final commit :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

facepalm!

@jp-bennett
Copy link
Collaborator

So far this is looking great. Support for a compass module is something we're already looking at adding, so some great cross-pollination there. It would probably be good to get a unit to a developer or two.

garethhcoleman added a commit to garethhcoleman/protobufs that referenced this pull request Apr 2, 2024
@garethhcoleman
Copy link
Contributor Author

So far this is looking great. Support for a compass module is something we're already looking at adding, so some great cross-pollination there. It would probably be good to get a unit to a developer or two.

Thanks, sorry I was mistaken and it's only an accelerometer and gyroscope not a full compass, sadly.

We will email you to setup sending out a couple of units to developers.

thebentern added a commit to meshtastic/artifacts that referenced this pull request Apr 2, 2024
@garethhcoleman
Copy link
Contributor Author

Thanks for the advice and suggestions, I will now close this draft and prepare another PR incorporating the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants