Stool pigeon has three meanings:
A decoy bird, or a police informer, or criminal's look-out or decoy.
The first meaning was a decoy bird (1812). This then became a human decoy to trick or deceive others (1821). Finally, after becoming a decoy for the police (1859), it became a straight informer (1868).
Decoy bird and human decoy
I found an antedating earlier than 1830 for the avian decoy stool pigeon, in the 1812 History of Animals: Designed for the Instruction and Amusement of Persons of Both Sexes by famous lexicographer Noah Webster:
In this manner, the decoy or stool pigeon is made to flutter, and a flock of pigeons may be called in their flight from a great distance.
The second use I found in Google Books is from a 1821 court report where it is used figuratively, but still as a decoy rather than informant:
that the black was dressed very decently ; that he sometimes said that he was free ; that Van Ort made use of him as a kind of stool-pigeon, to decoy or persuade other blacks to go to the south with him.
Indeed this popular preacher, having been countenanced and caressed by the Presbyterians, appears to have sold himself to them for a tool, or rather a stool-pigeon to decoy other Methodists into the snare designed to entrap them for the Presbyterian clergy.
The next stool-pigeon in 1825 is a human decoy to lure others to Presbyterianism; an 1826 stool-pigeon seems to be a human decoy; 1829 is the literal avian decoy; 1829 is a lord "used by him as a stool-pigeon to betray the unwary".
Throughout the 1830s and 1840s we see a similar pattern with more uses applying to a human decoy to catch or trick others, often a less intelligent individual who didn't realise the scheme, manipulated by criminals, gangsters or politicians.
One 1846 New York assembly report on the establishment of the police mentions:
The infamous and now well known " stool pigeon" system, was discovered.
Acting as stool pigeon was included in the 1855 Revised Code of the District of Columbia as an offence against public policy.
Finally, as for the police informer meaning, The Phrase Finder says:
What we do know is that the current meaning of informer came into being in the USA around the middle of the 19th century. The Sheboygan Mercury printed a piece in August 1851 about the prevailing political situation in Italy:
"Everyone fears that his confederate may prove a traitor... and avoided as a Police stool-pigeon and spy."
The most likely explanation of the phrase's origin is that it was coined to describe those police informers who hung around bars (on stools no doubt) in order to pick up underworld gossip but that the name was influenced by the earlier, but as then unamed, hunting decoys.
Here's the source, but I think it still means decoy here, and the informer was a bit later.
How did the meaning transfer from decoy to informer? It seems likely that someone was a decoy for the police and would give the names, or as a decoy to bring people in. For example, from an 1853 court report:
I have used the party in Shelby as a stool-pigeon to bring you here, and having brought you here, I acknowledge upon the record I had no cause of action against my witness, but will litigate the case with you here, now I have got you here...
Also in 1853 we find a stool-pigeon working for the law, but still a decoy:
After the lapse of about a year, he hired himself to the District Attorney of the United States, in the occupation of what is called a stool pigeon, that is, one who for hire joins and leads villains in crime to betray them to justice; or, as it was described by the counsel for the prosecution, the business of " a rogue set to catch rogues."
A very clear indication of crossover is shown in the 1859 Dictionary of Americanisms:
STOOL-PIGEON. A decoy robber, in the pay of the police, who brings his associates into a trap laid for them.
STOOL-PIGEONING. The practice of employing decoys to catch robbers.
(Also note the preceding definitions of stool and stooling for artificial decoy ducks.)
In an 1868 House of Representatives report on election frauds in New York, we can find it used as a straight informer:
715. Q. Give us the names.
A. I do not want to have anything to do with giving names; it would be an injury to me in my district if I did such a thing; not only in my district but through the city.
716. Q. In what way?
A. I do not want to be a stool-pigeon for anybody.
717. Q. Would it create an influence against you that would be injurious?
A. Yes, sir; injurious to me and injurious to the party; they would put me down as an informer. I know numbers of men in the 7th ward who always voted the democratic ticket, and who now, through me, vote the republican ticket. I would be regarded as a " sucker," as they call it, vulgarly.
The above stool pigeon and stool-pigeon are used more or less interchangeably for the similar meanings. The first stoolpigeon I found is much later, in the index of an 1872 book on Americanisms, but then uses stool-pigeon inside. The next is not until 1893:
The deputy sheriff -- an anti-Vanderpoint man -- was aroused by the blast given him for letting a certain horsethief escape. It was the first time in his life that he had been branded (in print) as a "shyster," "an impecunious fraud, "a lazy stoolpigeon," and other such epithets.