It originated in the South. That's the hospitality out there. Nodding is a part of life.
To elaborate. Remember that during the post-slavery and Reconstruction peroid many poor blacks worked as sharecroppers for their previous slave owners.
Noticed how everyone wore hats. (1900-1920s)
I'm 100x percent sure this came from everyone wearing hats and the typical hat nod that you used to see in the South a lot. It's how people greeted each other back then.
As blacks moved out of the south it sort of stayed with them. Here is a picture of some newly-arrived blacks in Chicago during the Great Migration. (1930's-40s)
Around the 1960's hats fell out of popularity with blacks during the Civil Rights movement. This is around the time where blacks went out of their way to aknowledge each other as apart of the struggle. This is where I really think the modern nod of solidarity came into effect.