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

Dev #41

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

Dev #41

wants to merge 15 commits into from

Conversation

bbkiwi
Copy link
Contributor

@bbkiwi bbkiwi commented May 20, 2017

Hi @cnlohr and @con-f-use

   I'll create this now. @con-f-use has given me a few pointers about working in dev. 
   I realize all this is a mix of many changes and it would have been better to make pull requests for
   separate issues.  

  The first commit has a long description which outlines what I have been doing.  The
   other commits tweak and fix up what I tried to do. 

   But I thought it finally time to start this discussion. At this point I've can drive the 18 LEDs
   of my banjo uke in a variety of patterns using your routines with mods I've made. Here is 
   a small clip where it is picking up the sounds of nearby instruments.
               https://youtu.be/mEXjZC2-_sA?t=1m33s

  What is not yet working is connecting to Stations. It makes an AP fine, but won't remember
      station info I put in the web gui. At this point I must first run a arduino sketch which sets
      up a   station.  Then when I flash it remembers the station info put in by that sketch.

  I'm happy to try and make things easy, so I could make a branch with the new sort routine
  etc. If that might help. 

  Cheers, Bill

For embeddedout.c FIXED SORT, new features, additional Update routine
Custom commands for these
More options for dummy_leds.c for embeddedlinux testing

changed embedded8266/esp82xx to most recent subproject
Improved UpdateLinearLEDs FIXING SORT_NOTES, adding rotation and shifting options
Added new update routine UpdateRotatingLEDs() to embeddedcommon/embeddedout.c
      with custom commands controling above  via web gui
Added improved dummy_leds.c to embeddedlinux so can compile to show a ring

colorchord2 .conf files changed to my sound sources, IP and LED setup

embedded8266/ccconfig.h now allows SORT_NOTES 1 as I fixed the option

modified embedded8266/user.cfg changed to my SDK, slowed baud rate for burning as mac needs slower

added code to embedded8266/user/custom_commands.c for two additional commands
    gCOLORCHORD_ADVANCE_SHIFT = 0;
    gCOLORCHORD_SUPRESS_FLIP_DIR = 1;

added code embedded8266/user/user_main.c and embeddedcommon/embeddedcc.c
    to handle the new features of embeddedout.c
       new global variable int framecount incremented in NewFrame() and used in the UpdateLinearLEDs and UpdateRotatingLEDs

in embeddedcommon/embeddedcc.c replaced Init() and InitColorChord()

embeddedcommon/embeddedout.c
    added three global variables: total_note_a_prev, diff_a_prev and rot_dir so this info will persist between
         calls to the Update routines.
    added printfs for debugging (only when using embeddedlinux, not on embedded8266)
    modified UpdateLinearLEDs()
	FIXED LIN_WRAPAROUND so ledFreqOUTold is not saved in case LIN_WRAPAROUND 0
       	computes total of note_peak_amps so can react to overall sound intensity
       	FIXED SORT_NOTES - removed old code from first loops
                          added new sort on local_peak_amp2 after the loop
				code can be improved to switch between keys
				TODO allow inc/dec sorting as param
				TODO sort uses pointer, but need to fix to handle both uint8_t and uint16_t
	added FEATURE code to rotate the display, speed and direction being controled by
              by these extern gCOLORCHORD_ADVANCE_SHIFT and gCOLORCHORD_SUPRESS_FLIP_DIR
	removed old commented out code
    added UpdateRotatingLEDs()
	new FEATURE code to rotate one LED at dominant color and amp (as in UpdateSameLEDs)
        the  speed and direction being controled by same parameters as above

embeddedcommon/embeddedout.h
    added extern variables and changed compiler directives

embeddedlinux
   mods of Makefile and ccconfig.h to suit my set up and test improved dummy_leds
   mods of dummy_leds.c to have a RING option
   mods of embeddedcc.c
	added comment is there a tool param?
	added debug printfs
	added global framecount
UpdateLinearLEDs can now use LIN_WRAPAROUND while rotating LEDs
UpdateRotatingLEDs now has code to have LED arc length proportional to amp2
                   can have constant intensity or related to amp2
    SORT_NOTES is now controllable via web gui
       0 no sort, 1 sort inc by freq, 2 sort dec by amps, 3 by amps2
    LIN_WRAPAROUND now controllable via web gui 0 no, else yes
    ESP8266 now running much slower 32 HZ before 200 Hz
      not sure why. Code shouldn't be that much slower
  changes in embeddedout.c to shift computed display around the LED
      ring by using a modular frame count gFRAMECOUNT_MOD_SHIFT_INTERVAL
           and putting the shift into global gROTATIONSHIFT
  added few more comments
  tidied indents
    UpdateLinearLEDs() modified to make a linear pattern on USE_NUM_LIN_LEDS leds
        then place this pattern as an arc into a ring with NUM_LIN_LEDS leds
        the placement can be shifted so that it rotates

    A few more comments. Refactor some names to reflect their purpose better

    TODO UpdateRotatingLEDs() is almost a special case of UpdateLinearLEDs
         with a few more improvements they can be combined
   Since no sound should give 127 on ADC slider
   fixed to expand display around that value rather than just multiply

   added extra column to note display so have note number
     expanded factor for showing amp and amp2
@cnlohr
Copy link
Owner

cnlohr commented May 20, 2017

Woah there's a lot of stuff going on here. @con-f-use I am unfamiliar with how this would work on a project without a pre-existing "dev" branch. Can I safely hit merge then test in post?

Also, @bbkiwi one major thing I wanted to note is now esp82xx supports binary websockets, you can transfer full-on binary data. (just fyi)

@con-f-use
Copy link
Contributor

con-f-use commented May 20, 2017

I'd test it via git clone --recursive https://github.com/bbkiwi/colorchord.git -b dev . You could also create a dev branch and then merge it into that or you can merge it into master and revert, or undo the commit, if it's not to your liking. Last think is frowned upon because it fucks up repositories cloned after the merge. TMTOWTDI™

Btw. it would've been helpful telling us, that you were working on colorchord all this time, not just the vanilla esp82xx.

@cnlohr
Copy link
Owner

cnlohr commented May 20, 2017

Got it. This may also be the time to add support for RGBY LEDs.

@cnlohr
Copy link
Owner

cnlohr commented May 20, 2017

Also @bbkiwi I think I know why you're having issues with connecting to another station and will work on that.

@bbkiwi
Copy link
Contributor Author

bbkiwi commented May 21, 2017

Hi @con-f-use
This all started with issue #37 where I describe problems I was having with colorchord. I only started to look at esp82xx when it seemed some of the problems were coming from it. At the start of issue #37 I explain my (lack of) background to all this, so I apologize if I don't quite know the best way to communicate. Any suggestions appreciated.

Cheers, Bill

@bbkiwi
Copy link
Contributor Author

bbkiwi commented May 21, 2017

Hi @cnlohr

 Solving the connection problem would be great. It is happening when I test the basic project in esp82xx/master. 

@opus506
Copy link
Contributor

opus506 commented May 21, 2017

Anyone try merging everything yet?
I'm going to try and merge to a dev branch tonight if not.

@cnlohr
Copy link
Owner

cnlohr commented May 21, 2017

gaah I didn't get to testing this tonight. Please try and check.

@cnlohr
Copy link
Owner

cnlohr commented May 21, 2017

I did get to checking the new esp82xx... but... not cc.

Also, we really need to make sure cc and esp82xx are updated in pair.

@bbkiwi
Copy link
Contributor Author

bbkiwi commented May 21, 2017

if I try cc/dev with all my changes using most recent esp82xx/dev overflows by 1292 bytes.

... /home/bill/82XX-projects/colorchord/embedded8266/esp82xx/toolchain/esp_nonos_sdk/lib -o image.elf
...
region `iram1_0_seg' overflowed by 1292 bytes

@cnlohr
Copy link
Owner

cnlohr commented May 22, 2017

@con-f-use do you mind making sure my merging here won't wreck things up?

Also @bbkiwi AFASF#$#(%G#%(G#(#(D@)C(ASD(V I thought we had enough memory recovered in the custom SDK I had pieced together. UGH.

@bbkiwi
Copy link
Contributor Author

bbkiwi commented May 23, 2017

I wasn't sure if AFASF ... was an acronym or just your left hand going mad :-).
I watched a bit of your youtube hack fest on Sat and noticed that git submodules give you some grief too :-)

Looking issue #35 where make all embedd8286 overflowed by 288 bytes.
I just tried to compile using be144 commit from colorchord master with submodules esp82xx newest (51c38) commit of cnlohr/esp82xx master and newest commit (7d66f) for esp_nonos_sdk and still get `iram1_0_seg' overflowed by 288 bytes.

Note I only have tested my changes to embeddedcommon for embedded8266 (with 18 LEDs) and embeddedlinux. I have not way to try it for the other two embedded devices.

@cnlohr
Copy link
Owner

cnlohr commented Sep 11, 2017

@bbkiwi are you up for pursuing this again? I don't know any way around it other than manually implementing most of these changes. Is that something I should do?

Will you always have a separate trunk without that?

@bbkiwi
Copy link
Contributor Author

bbkiwi commented Sep 11, 2017 via email

@cnlohr
Copy link
Owner

cnlohr commented Aug 4, 2018

Just wondering... what came of all of this? I thought it was mostly integrated another way.

@Fireflaker
Copy link

colorchord.zip
Colorchord.exe for ones who suffer to see it working.

@cnlohr
Copy link
Owner

cnlohr commented Aug 4, 2018

Do you mind elaborating more? I don't really understand what happened with this still.

@con-f-use
Copy link
Contributor

con-f-use commented Aug 4, 2018

From what I can see most of the stuff that changed something in esp82xx has been merged into esp82xx. At least cnlohr/esp82xx#77 shows no diff and is a PR from head of his esp82xx branch to ours.

@bbkiwi
Copy link
Contributor Author

bbkiwi commented Aug 4, 2018

Hi @cnlohr and @con-f-use, I lost track a bit about all this and had not done much for a long time, but just recently started again. Also my repo was screwed up so a clone of it couldn't bring in the submodule using my fork of exp82xx correctly. However I think I've fixed that all.

In my cc fork bbkiwi@0717767 I'm using newfeatures branch which uses esp82xx submodule from my fork of esp82xx at the top of branch tmp. I've compared bbkiwi/esp82xx@75b0773 with cnlohr/esp82xx@b7fc6f637ae9c3302195f54572e1cc5d007124f1and there are some differences but the only one I notice that might affect the interaction of ADC and wifi is that I call StartHPATimer in GoAP in commonservices.c. Other changes I made were to add an option to assign fixed IPs. Other changes are more cosmetic.

At this point using my fork on branch newfeatures is working well and I will probably continue using it.
I've mainly made changes to embedded8266 as my interest is using cc on the ESP8266.

It is stable tested on 5 Nodemcu and Weimos too, I can connect to a specified IP, I've used it with LED rings from 16 to 60.

I've added a 'glitch' filter to get rid of interferance of sockets with the ADC.
I have tweaked the gui considerably adding slider controls for many new configuration parameters giving finer control to how notes are generated (there were a few 'bugs' in finding notes in the sense that the code did not produce what comments seemed to suggest was happening) and displayed. 16 different sets of parameters can be saved in flash, the number of leds to be used (upto 256) is now a parameter, so re compiling is not necessary for this.

I'm not sure it will be easy to make pull requests for these as the changes are not easily isolated.
I'm almost done documenting all this which will explain in more detail.

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.

5 participants