SHWotever / SimHub

Multi sim dashboard, bass shaker driver, ....
http://www.simhubdash.com/
781 stars 97 forks source link

Arduino Micro w/ Nextion & LEDs - LEDs Not working #395

Closed mcalderon16 closed 5 years ago

mcalderon16 commented 5 years ago

Hello everyone!

I recently decided that I wanted to attempt to make a SimHub dash using the Arduino Micro with the W2128B LEDs and a display using the Nextion Display as a walk-through foundation.

Surprisingly I made it pretty far just researching and attempting different things. As of right now though I am out of ideas on how to get the LEDs to work. I was able to create a dash on the SimHub Nextion Editor, upload it and run it on iRacing with no major problems. So the dash is working, it's the LEDs giving me a hard time.

I did go into the Nextion Micro Bridge and enabled the lights (uncommented the line) set the pin to 6 just like on the board and uploaded it to the Micro. On SimHub>Arduino>LEDs I made a basic LED RPM gauge, nothing fancy and went into the Nextion Display settings and also showed "LEDs 16," however not sure about the "from." Nonetheless I have set the "From" to a variety of values with no luck.

I did notice two interesting things, one being if I set LEDs to 0 on the Nextion Display in SimHub the majority of them turn on while the display is on the idle page and but skips random lights though.

The other thing I did was upload a fresh sketch to the Micro using SimHub>Arduino>myHardware and just put the LEDs in the profile. Only then did they work on iRacing as intended. This helped me verify it was not a wiring/soldering/polarity issue.

It seems as if SimHub was not recognizing the lights via the Arduino Micro Bridge sketch? Or maybe I missing another line of code somewhere? Nonetheless the walk-through was extremely useful!

Any help would be appreciated! :)

SHWotever commented 5 years ago

Hi! This looks like a powering issue. Could you try some of the following clues :

LEDs must be set to the number of LEDs plugged (typically 8 or 16) From can be left to 1, it notifies simhub the position of the leds to be displayed from the leds settings, in order to allow typical arduino + nextion mixing

Let me know if it helped.

SHWotever commented 5 years ago

I've seen on discord that you were using a 7" display, clearly you must have some powering issues,. Also take care 7" is not supported and will have bad performances : https://github.com/zegreatclan/SimHub/wiki/Nextion-Display#warning-

mcalderon16 commented 5 years ago

Thank you for your response! I have not tried dimming the LEDs to see if that helps any so I can try that tonight hopefully.

Currently I do not have any USB hubs in the mix.

I too thought it could be power related! So what I had ended up doing was powering the LEDs off a nano board on a separate USB plug and port while keeping the data pin for the LEDs on the same one as the Nextion, however this resulted in the same outcome as before. No lights. I did notice though they were brighter when put into test mode so you are correct that somewhere along there is a powering issue

mcalderon16 commented 5 years ago

So I didn’t have an extra plug that was within spec to power the 7” Nextion, so I ended up just powering it via a separate Arduino and left the TX/RX on the Micro with the LEDs, surprisingly no lights.

I also ended up, one more time, disconnecting everything and just left the LEDs on the Micro and uploaded a Sketch from the My Hardware page. The test LED powered on all green once uploaded however the LEDs would not work in iRacing. Looking back at the hardware page I can see that it says “received: xx” while the other 2, corruption and I forget what the last one is called were 0.

Before my whole LCD debacle this function worked standalone with no issues. I am starting to wonder if maybe I should try a “lite” reset of SimHub ?

mcalderon16 commented 5 years ago

So just to recap on this, I was able to get the LEDs working by “unselecting” in the LED layout the “common layout part”