The smiling part is weird I was told to smile at strangers passing by and I do this quite often. But it depends on the context your in. And maybe your gender as well
I was raised in the country side and it’s completly normal to greet people with “Guten Tag” “Hallo” or something similar or at least give them a slight smile and a nod. I know it’s uncommon in bigger cities and I don’t do it there. People are minding their own business so not interrupting them is polite. Whereas when you’re out hacking and you meet people in the woods or fields it’s unpolite to not greet them
As I try to explain it I realize how complex it is
I’m always on the friendly side, so I say hello and bye to cashiers and wish them a nice week/day/weekend and may talk to them a bit. But this isn’t common, I would say it’s more a 50/50 thing. So cashiers won’t start talking to you, if you don’t stark talking to them, because germans will feel “interrupted” or “harrassed” if somebody just starts a conversation while you’re busy minding our own stuff. We feel REALLY uncomfortable if some stranger just starts a conversation. Like shop assistants will ONLY ask, if you need help, if you seem to be searching something specific or if you ask them. This might seem as bad customer service, but we germans like to be left alone. We ask, when we need something and as long as we don’t ask, we’re fine doing on our own and asking us if we need help is “insulting” and “annoying”.