SC1000
SC1000 copied to clipboard
Add optional LED Ring Mod
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).
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 tosoftware/player.c
to read the platter angle in degrees (normalized)
- Add new
-
Updated
sc.tar
and files inupdater/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
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 :)
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
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!
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
@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! :)
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?)
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...
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.
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.
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
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.
Please post a detailed guide on how the whole process goes. Please please!