Light bar through M5StickC Plus

Question:
Setting up a light bar on a M5stickC Plus. Upon initial flash it works great. If disconnected or turned off in AGIO. Upon reconnect it locks the loop in the M5. The M5 is just an ESP32. I’m running hardwire serial. I’ve tried dumping the serial, reset the setup(). ESP.restart(). All to no avail. Unplugging the serial and plug back in will restart the loop, But no connection to AGIO. Try to reconnect and lock. Restart AGIO as soon as it trys to make connection it is locked. The only way I’ve found to restart it is to re flash it. Any thoughts?

Dear KentStuff, as far as I remember, the first one to use M5stickC was minolu-JP, I found a message from him, message number 33.

Hello KentStuff,
I use bluetooth with the M5stickC, USB was not working (and confirmed by minolu_JP).
You have to be choose the correct com port in AGIO otherwise it will hang AGIO and you have to delete the config to try again.
Once set, it is very stable on bluetooth.

Hi,
Agio send distance from line only if autosteer is enabled. So check settings (or set to manual turn on, or if button enabled - check pin)

Any of you tried converting to UDP and just run it in network?

No, my wifi was already used for internet for RTK corrections. It should work without problem.

Alright, I found a work around to get the USB working. I do not know if it will make a mess of other things. It takes a software edit inside of AGIO.

Those of you who want to edit it:

Inside AGIO, Loop, SerialComm.Designer

Inside the OpenSteerModulePort()

Comment out the two lines that contain
DtrEnable and RtsEnable.

Again, I have no idea what other things it may do, but my M5 is working now.

3 Likes

Hello everyone
Is there a beginners guide to setting up the led strip on the m5stick c + and operating via Bluetooth
I have the hardware ?

I chose UDP rather than Bluetooth. Aog was sending out the distances at one time UDP. Not sure if still does. Been much talk about changing the lightbar on screen to show steer angle not xte.

Hi
I have been trying to get the external lightbar to work on m5stickc plus 2
What configuration did you use ?

Here is some code for the M5. UDP over wifi. As is, no warranty or support.

Thank you,
This is much appreciated
I can install on the m5stick c2 without errors using VS, however the m5 stick seems to crash only showing a green power light nothing on the display etc
Any ideas what I am doing wrong
Thanks again

Likely there is a difference in the M5 you are using and the M5 plus. Had this problem in the reverse. The library we installed was not the plus and got similar errors.

m5stick c2 vs m5stick plus

@KentStuff is right. Look on M5’s and PlatformIO’s sites for the correct libraries and maybe environment. Update platformio.ini accordingly.

Also, I always used the arduino ide to compile and load the ino. Not sure it matters at all.

Thank you KentStuff and chri5k
I have tried both VS and Arduinio with M5stickc plus 2 libraries, with multiple errors which I will upload
Also tried harge’s previous version with no luck either

C:\Users\OneDrive\Documents\Arduino\main\main.ino: In function ‘uint8_t getBatCapacity()’:
C:\Users\OneDrive\Documents\Arduino\main\main.ino:93:13: error: ‘class m5::M5Unified’ has no member named ‘Axp’
93 | volt = M5.Axp.GetBatVoltage();
| ^~~
C:\Users\OneDrive\Documents\Arduino\main\main.ino: In function ‘void setup()’:
C:\Users\OneDrive\Documents\Arduino\main\main.ino:123:11: error: no matching function for call to ‘m5::M5Unified::begin(bool, bool, bool)’
123 | M5.begin(true, true, false);
| ^~~~~~~~~~~
In file included from c:\Users\OneDrive\Documents\Arduino\libraries\M5Unified\src/M5Unified.h:5,
from c:\Users\OneDrive\Documents\Arduino\libraries\M5StickCPlus2\src/M5StickCPlus2.h:4,
from C:\Users\OneDrive\Documents\Arduino\main\main.ino:65:
c:\Users\OneDrive\Documents\Arduino\libraries\M5Unified\src/M5Unified.hpp:305:10: note: candidate: ‘void m5::M5Unified::begin()’
305 | void begin(void)
| ^~~~~
c:\Users\OneDrive\Documents\Arduino\libraries\M5Unified\src/M5Unified.hpp:305:10: note: candidate expects 0 arguments, 3 provided
c:\Users\OneDrive\Documents\Arduino\libraries\M5Unified\src/M5Unified.hpp:312:18: note: candidate: ‘virtual void m5::M5Unified::begin(config_t)’
312 | virtual void begin(config_t cfg)
| ^~~~~
c:\Users\OneDrive\Documents\Arduino\libraries\M5Unified\src/M5Unified.hpp:312:18: note: candidate expects 1 argument, 3 provided
C:\Users\OneDrive\Documents\Arduino\main\main.ino: In function ‘void loop()’:
C:\Users\OneDrive\Documents\Arduino\main\main.ino:189:19: error: ‘M5_BUTTON_HOME’ was not declared in this scope
189 | if (digitalRead(M5_BUTTON_HOME) == 0) {
| ^~~~~~~~~~~~~~

exit status 1

Compilation error: ‘class m5::M5Unified’ has no member named ‘Axp’

IIRC the AXP chip is for power management. It is used to read the Stick battery voltage and display it.
Probably a different one in the Plus 2 vs the Plus. You will need to look up the driver / API for whatever chip the Plus 2 is using and adjust the sketch accordingly.

I have found the M5 libraries to be very model dependent. If you have any experience recoding the ino, then it is not a bad thing to convert. If you don’t have any, I would recommend buying the exact model M5 the ino was built for.

1 Like

This is my M5. There are many styles and rotations. I am not saying that this is the correct one for this ino. Just for comparison.