Unlike "bum," "hobo" is not necessarily derisive. While a bum is a shiftless person, a habitual loafer, a hobo is a vagrant or a migratory worker. My grandmother told me that hoboes were common during the Great Depression, when many, many displaced workers traveled with their few belongings from town to town, seeking available temporary work. They would often knock on her door, asking for employment, and she fed many a hungry hobo.

Per Webster's, "hobo" arises from a rhyming compound based on the greeting ho, beau. Origins A Short Etymological Dictionary of Modern English agrees: "...hobo represents ho! bo, ie ho! beau (for hello! beau), known to have been a tramps' formula of address in the 1880s and 1890s.

Charles Funk, in A Hog on Ice, observes this interesting relationship between bum and hobo:

One may be feeling "on the bum" when he's not OK physically. It is an American expression, dating back fifty years [ie, to 1907] or so. George Ade was the first to use it in print, but it comes from a dialectal English use of "bum," which for four hundred years has been a childish word for drink [!]. The American phrase thus first signified the condition one is in or the way one feels after overindulgence in drink.

But "on the bum" also means itinerant, living the life of a hobo. This second American use derives from a slang term which was current in San Francisco about a hundred years ago [ie, 1857], or during the gold rush. A "bummer" was a worthless loafer; later, during the the Civil War, a deserter who lived by raiding the countryside. Maybe the word was derived from the German Bummler, an idler, a loafer.

And how "bummer" came to mean a cause for disappointment or unhappiness...? Dictionary of Slang and Euphemism says that it came to designate any bad experience by extension from meaning a bad drug experience, but does not explain the drug usage.