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

M5stack Core with W5500 PoE module #77

Open
GSAL85 opened this issue Feb 2, 2023 · 11 comments
Open

M5stack Core with W5500 PoE module #77

GSAL85 opened this issue Feb 2, 2023 · 11 comments

Comments

@GSAL85
Copy link

GSAL85 commented Feb 2, 2023

Hi,

I got the tally light working on several M5Stack modules (Core, Core2 and StickC Plus, all ESP32). All using WiFi to connect to the Atem.
In some situations however, the Wifi signal is unreliable, and therefore the tallies are not always working flawless.
As a backup we wanted to make the system work on a M5Stack Core with an w5500 Ethernet / PoE module, so make it a wired system.
However, when connected to the network via a wire, no connection to the Atem can be made.. It crashes after the atemSwitcher.begin(ip).
Does anybody have experience with this, connecting an M5Stack unit wired to an Atem??

@AronHetLam
Copy link
Owner

Sadly i have no experience withe the MStack modules, but i might be able to point you in the right direction.
In the ATEMbase lib it's specified to use the WifiUDP lib instead of EthernetUdp if it's compiled for the ESP8266 or ESP32

#if defined ESP8266 || defined ESP32
#include <WifiUDP.h>
#else
#include <EthernetUdp.h>
#endif

@GSAL85
Copy link
Author

GSAL85 commented Feb 3, 2023

Hi Aron, Thanks for the reply. Indeed that was one of the first things i found and altered in the ATEMmin en ATEMbase. Even tried with the EthernetUdp2 instead of EthernetUdp. But no luck so far. It does compile, but when running it wont make connection to the Atem and starts to reboot the M5Core unit. Somehow the initialization of the Atem doesn't work properly.
If anyone else has a bright idea, i would love to hear.

@AronHetLam
Copy link
Owner

Hmm.. any idea how far it gets through the initialization process? You can make it print more debug info or put some extra print statements in yourself.

@AronHetLam
Copy link
Owner

Also, are you able to get UDP working over ethernet with other Arduino programs?

@commputethis
Copy link

@GSAL85 I am currently using Tally Arbiter for our Tally lights with M5Sticks, but would like to reduce the complexity a little and remove the server component and use this one with the M5Sticks. What did you have to change to get this to work with M5Sticks?

@AronHetLam
Copy link
Owner

@GSAL85 How much do you know about programming arduino? Basically you need to replace/add to the code that updates the LEDs with code that updates the display or M5Stick LED instead.

I just double checked, and got it working on my ESP32 dev module (not M5Stick). There were some errors, but they are fixed in what i just pushed. I'll update the release version. Be sure to replace the libraries as well.
It should run on the M5Stick modules as well, and I'm able to compile the code for the M5Stick. You can try to upload the code to it, and see if you can access the setup page.

@commputethis
Copy link

@AronHetLam I got it to compile after changing the references to WiFiUdp.h from WifiUDP.h. Now to figure out how to change the screen color and turn on the built in red led.

@commputethis
Copy link

well, I found a bit of info. The internal red LED is pin G10 and the screen color can be set by doing something like M5.Lcd.fillScreen(TFT_RED);, but I am not sure where in the code to put them in the code.

@AronHetLam
Copy link
Owner

AronHetLam commented Aug 16, 2023

Nor sure why you need to change it to WifiUdp.h, however, this is where the actual color change happens here

One way is to put M5.Lcd.fillScreen(TFT_RED); in each case statement with the correct color, but it will call it twice in most cases, as that method is called once for each of the two LEDs. You could then remove the calls to it for led2, so the screen is only updated once each time.

Another approach is to do it like I did for the led strip. It's a little more advanced, but I think it's nicer. Essentially I've defined a list with colors here, that I use to lookup the correct value here
If you make a list called color_lcd, with the display colors in correct order, you'd end with something like M5.Lcd.fillScreen(color_lcd[color]); in the setSTRIP function.

@GSAL85
Copy link
Author

GSAL85 commented Aug 17, 2023

@commputethis Sorry for the late reply. I do agree with Aron on why you would need to change the WiFiUDP. For me that wasn't necessary.

With the M5Stack units it is convenient that they have the screens which you can change in any color you want, so a separate light / LED isn't required anymore. Using the code from Aron indeed you need to change it in the case statements. But you also need some additional lines in the setup and the loop to start and update the use of the screen. Check some of the examples of the Stick to see which ones are required.

Also, there is an other item on Github that might help.

@commputethis
Copy link

commputethis commented Aug 17, 2023 via email

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

No branches or pull requests

3 participants