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

New PlatformIO listener client #358

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open

Conversation

MatteoGheza
Copy link
Collaborator

@MatteoGheza MatteoGheza commented Jan 25, 2022

I wrote this new listener client to migrate every ESP32/ESP8266-based listener client to the same codebase, and for using PlatformIO.
It's compatible with the Arduino IDE (currently, renaming a file is needed, fixing this soon), and it support build configuration.

Every feature/piece of code is configurable (WiP), so you can enable or disable certain features on a custom build, for example, enabling tally light status output on the M5Atom (turning on a GPIO pin on bus status).

Why did I do this?

There are 4 different firmwares for M5Atom and similar devices, and maintaining them is becoming a nightmare.
There are a lot of PR, and when a listener is uupdated we should apply the same patch (or similar) to the other 3.
Using PlatformIO, configuring build flags and running tests, or even emulations, is easier.
PlatformIO has a build cache, and it uses them when you re-compile the code after a change. With this cache, compiling requires only a few seconds.

TODOs:

  • Connect to server and handle device status change
  • Save preferences and display settings into the WiFi selection page
  • Implement tally status GPIO output
  • Add settings reset support
  • Add settings and info page (and button navigation)
  • Replace old logo with the new logo (and update the TTGO platform code)
  • Display errors with icons and message on devices with a screen (for example when the WiFi connection fails, when the device needs to be configured, etc)
  • Support ESP8266 data saving
  • "Porting" PRs-added features here
  • Add documentation
  • Static code analysis and firmware compiling on Github Actions Workflow

Implement M5Stick and similar platforms looking at the old listeners:

  • Adafruit NeoPixel
  • M5AtomMatrix
  • TTGO_T
  • m5stickc

@wrldtvlr
Copy link
Contributor

Cool! Look forward to trying it out.

@josephdadams
Copy link
Owner

Amazing as always, @MatteoGheza !

@mg-1999
Copy link
Contributor

mg-1999 commented Jan 25, 2022

Looks awesome! Hit me up when you need testing on the clients.

@mg-1999
Copy link
Contributor

mg-1999 commented Jan 27, 2022

How do you plan on adding all the features of the different clients without the 'main' file getting complicated to work in?

Copy link
Collaborator

@JTF4 JTF4 left a comment

Choose a reason for hiding this comment

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

I flashed the listener to one of my M5 Stick c Pluses and it get stuck in booting because WiFi manager still has stored settings from the other version of the software.

I think that it needs to have a way of having its WiFi credentials and other settings reset to keep it from getting stuck in a boot loop.

@MatteoGheza
Copy link
Collaborator Author

MatteoGheza commented Feb 8, 2022

I flashed the listener to one of my M5 Stick c Pluses and it get stuck in booting because WiFi manager still has stored settings from the other version of the software.

I think that it needs to have a way of having its WiFi credentials and other settings reset to keep it from getting stuck in a boot loop.

I implemented a reset menu, but it works only when the device is configured (no WiFi configuration).
I tested it a lot on the TTGO.
Currently, if you click the button (M5 button) once, it opens the info page.
If you click it twice, it opens a page with the IP Address of the device and you can go to the settings web page (for configuring WiFi, TA server and updating the device OTA).
If you long-press it, then you long-press it again, the device will reset.

What do you think about enabling this menu when the device is not configured (eg. reset the device if button pressed while turning on the device, like opening BIOS page on a computer).

What do you think about changing the M5StickC configuration to use the Action button instead of the M5 button for this (and using the M5 button for enabling sleep mode like on the TTGO)?

@mg-1999
Copy link
Contributor

mg-1999 commented Feb 8, 2022

Both option sound like a solid idea.

Copy link
Collaborator

@hrueger hrueger left a comment

Choose a reason for hiding this comment

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

To be honest, I don't know embedded at all, so I'm just gonna approve this 😀👍

@MatteoGheza
Copy link
Collaborator Author

I flashed the listener to one of my M5 Stick c Pluses and it get stuck in booting because WiFi manager still has stored settings from the other version of the software.

I think that it needs to have a way of having its WiFi credentials and other settings reset to keep it from getting stuck in a boot loop.

Done. Now, for resetting the device if it isn't configured, you should press (without releasing) the menu button (M5 button in this case) while turning on the device.

@MatteoGheza MatteoGheza requested a review from JTF4 February 8, 2022 15:13
@mattv8
Copy link
Contributor

mattv8 commented Mar 2, 2022

I love this, thank you for taking this on @MatteoGheza! I'll bring in my initial discussion #269 here for context. Let me take a look at this and see if I can yield any suggestions.

Copy link
Collaborator

@JTF4 JTF4 left a comment

Choose a reason for hiding this comment

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

Did some quick tests on my M5StickC and C+ devices. Looks like it works great!

@JTF4
Copy link
Collaborator

JTF4 commented Mar 14, 2022

Sorry it took a month to get this review in. Life got super busy and I'm just getting back to TA

@mattv8
Copy link
Contributor

mattv8 commented Mar 15, 2022

Sorry it took a month to get this review in. Life got super busy and I'm just getting back to TA

@JTF4 I know the feeling! 😅

@MatteoGheza
Copy link
Collaborator Author

Sorry it took a month to get this review in. Life got super busy and I'm just getting back to TA

It's the same for me...

@MatteoGheza
Copy link
Collaborator Author

Can someone help me testing this and writing documentation (I only documented the build flags)?
This should be prod-ready.

@mattv8
Copy link
Contributor

mattv8 commented May 18, 2022

@MatteoGheza I may have some time to look into testing/documentation. I'm still currently working on my custom tally PCB (working on v2), so I'm hoping to adapt this to it and test this PR in the process.

@MatteoGheza
Copy link
Collaborator Author

@MatteoGheza I may have some time to look into testing/documentation. I'm still currently working on my custom tally PCB (working on v2), so I'm hoping to adapt this to it and test this PR in the process.

Thanks. When everythings works well, we should implement an update system.

@MrFobwatch
Copy link

Hey, I just discovered this program today and I am a big fan of PlatformIO. I decided to clone the repo and try and build code and got some errors. After doing some digging I found the issue is due to a breaking change in ArduinoJSON

https://arduinojson.org/news/2022/12/26/arduinojson-6-20-0/#removed-support-for-char-and-char

I am still learning my way around the source so I am not sure of where all this effects but the fix I used in the short term to get the code to build is to modify platformio.ini to force version 6.18.5
bblanchon/ArduinoJson@=6.18.5

@JTF4
Copy link
Collaborator

JTF4 commented Dec 14, 2023

I think it should be a relatively easy fix. I'll have to see if I've got time to look into it.

@Jocke4f
Copy link
Collaborator

Jocke4f commented Dec 29, 2023

What is the status of this PR? Trying to understand if there is something that I can help with.

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.

9 participants