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

Add optional LED Ring Mod #15

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

Add optional LED Ring Mod #15

wants to merge 2 commits into from

Conversation

psturm
Copy link

@psturm psturm commented Dec 30, 2020

This is PR adds an optional modification to add a LED ring to display the current platter position (like having a sticker on vinyl). Additional hardware required (LED ring and ESP8266).

Demo Video

Entrypoint for documentation is: mods/led_ring/README.md

As this is an optional mod, i'm not sure if it's desired to have this as part of the main repository. Would be easiest, as it requires changes on the core code, but i can totally understand if this repo should be kept simple and therefore this won't be merged.

Please let me know, if there is anything that can be optimized or which doesn't fit to your current project standards. Looking forward to get feedback!

Basic concept:

  • extend C code to send rotation angle in degrees on uart3-tx (J7 pin5) in form of a RPC

    format: r(<angle>)\r\n (e.g. r(270)\r\n)

  • a ESP8266 receives this RPC call and updates the attached ws2812 LED ring/stripe accordingly

See mods/led_ring/README.md for more details.

Code changes:

Disclaimer: i'm pretty new to all these topics, especially C coding. Please review this PR carefully. All feedback welcome!

  • Add new led_mod.c to read the platter angle and handle communication via UART3

    • Add new ledringenabled entry to settings (disabled by default)
    • Add player_get_position_angle method to software/player.c to read the platter angle in degrees (normalized)
  • Updated sc.tar and files in updater/tarball manually

    • os-version.mp3 to: "firmware version 1.6 with LED ring mod" (couldn't find the exact voice as used before tho)
    • Patched sun5i-a13-olinuxino.dtb to activate uart3 on PG9 (disabled power LED); J7-pin5 is uart3 TX now
  • Add setup for ESP8266 to handle LEDs

    • nodeMCU firmware
    • LUA software

@rasteri
Copy link
Owner

rasteri commented Dec 31, 2020

This looks great, thanks for your work! I think I have an LED ring that will work with it so I'll test it and merge if all goes well :)

@psturm
Copy link
Author

psturm commented Jan 2, 2021

Cool, looking forward. Please let me know if you encounter any problems or feel the documentation could be improved.

Sneak preview of next version: https://www.youtube.com/watch?v=n7ADMYWHwdQ

@DubbyLabby
Copy link

Searching solutions for multiple ASOM-AS5601 I2C sensors I found this "by accident"
https://github.com/Fattoresaimon/RGB_LED_Ring

Maybe worth a look...

Cheers!

@mag23rad
Copy link

Hi psturm,
I have had a bash at your LED mod, but have run into a problem.
Hardware installed and wired up.
I am getting as far as the initialisation routine -
and then the LED demo display,
but can not get "Sample Position to LED" working/triggered.
I have enabled it in settings.txt and seem to have the correct firmware.
Wonder what I am missing?
Hope you are still available to help, as it is such a good mod.
PEACE

@psturm
Copy link
Author

psturm commented Aug 21, 2021

@mag23rad Super cool, happy you're trying it!

With "LED demo display" you mean the hard coded debug rotation signal? If that's the case, you need to disable the DEBUG mode on the ESP by setting it to 0 in config.lua. In this mode it ignores the signal from SC.

Otherwise you might need to debug the UART signal coming from SC (J7 pin 5; requires an USB-TTL-serial-converter). Or attach to the ESP's UART and add some debug code. Hard to tell which side might be the issue here.

PS: Please tag me on Instagram, in case you get it to work! :)

@SaccoSVD
Copy link

SaccoSVD commented Aug 21, 2021

Uhh! I need to do this in oder to see where the sample start is while the fader is in off position. Right now you go pretty blind and is easy to miss the start point.

Can I have a step by step guide on what to do? Those LED rings are very easy to find around and I have experience with solder.

Would these work?
https://www.amazon.de/-/en/WS2812-24-Bit-Light-Integrated-Drivers/dp/B07QLMPV6S/ref=pd_sbs_3/259-8447985-2455259?pd_rd_w=LTkDJ&pf_rd_p=b1c388c3-48c2-4960-8532-fa8f1477aee9&pf_rd_r=T8QWEQ1RGFM8Z2D99M1J&pd_rd_r=e0557cb8-a3c3-4e02-aec5-9f6ba706be0c&pd_rd_wg=UzLsw&pd_rd_i=B07QLMPV6S&psc=1

And this ESP8266 ?

https://www.amazon.de/AZDelivery-NodeMCU-Lolin-V3-Parent/dp/B06Y1ZPNMS/ref=sr_1_1_sspa?dchild=1&keywords=ESP8266&qid=1629600269&sr=8-1-spons&smid=A1X7QLRQH87QA3&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExNlZMMlhDRlVYUjZWJmVuY3J5cHRlZElkPUEwNDAzNDA5MTFKWFBaWkZLU1dDRiZlbmNyeXB0ZWRBZElkPUEwNjIwOTIzMTZROVVPNEFLNkY5VCZ3aWRnZXROYW1lPXNwX2F0ZiZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU&th=1

I have no clue about programming so it would be awesome to have a build of 1.7alpha ready to work with the LED ring. (is it already included?)

@errolkokbas
Copy link

I have no clue about programming so it would be awesome to have a build of 1.7alpha ready to work with the LED ring. (is it already included?)

Pretty much in the same boat here. I'm about to order some sc500's from portability gear, and really want to do this mod, but I hardly know how to use github, let alone implement something like this...

@rasteri
Copy link
Owner

rasteri commented Aug 24, 2021

So I have no plans to merge this mod into the mainline firmware at present, I have very limited time just now. Perhaps in a few months.

@SaccoSVD
Copy link

Maybe psturm could make a build for us? (please?)

I wanna know how to hook everything up too. It doesn't seem like a hard mod.

@mag23rad
Copy link

mag23rad commented Sep 2, 2021

Hi psturm
I have ordered a USB-TTL-serial-converter for debugging.
Meanwhile..

I Flashed the ESP.
Edited and reloaded the config.lua (and all other .lua files)
Turned off the hard coded debug rotation signal.

Edited scsettings.txt file
ledringenabled=1

I get as far as..
-- Init ws2812 LEDs
print("[INIT] WS2812 ("..LED_COUNT.." LEDs) ..")
ws2812.init()
led_buffer = ws2812.newBuffer(LED_COUNT, BYTES_PER_LED)
led_buffer:fill(0, 0, 25) -- all LEDs blue to show it's initialized
ws2812.write(led_buffer)
dofile("led.lua")

.. My LEDS are all blue, still no angle/rotatation tracking.
But everything else works fine.
Waiting for the USB-TTL-serial-converter to be delivered.
I know I'm close and am probably missing something simple.

PEACE

@mag23rad
Copy link

Pstrum, thank you, I managed to implement your LED addition, works great, a bit busy at the moment but will post some video over the christmas break.

@SaccoSVD
Copy link

Please post a detailed guide on how the whole process goes. Please please!

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.

6 participants