But Djokovic fell at the first hurdle with a shock loss to Japanese qualifier Taro Daniel, who sent the out-of-sorts Serb tumbling with a hard-fought 7-6 (7/3), 4-6, 6-1 victory.
Daniel, without any major wins on his record, beat Djokovic 7-6 (3), 4-6, 6-1 after two-and-half hours of torment for the Serbian, who gave the feeling of not being comfortable on the court at all.
Djokovic is making a cautious return to the ATP Tour after stopping his 2017 season following Wimbledon due to a right elbow injury.
Djokovic shut down his season after Wimbledon in 2017 and despite not being at his best, made a decision to play at this year's Australian Open where he was ousted by South Korea's Hyeon Chung in the fourth round.
As his form began to dip at the end of 2016, Djokovic admitted that he had been affected by off-court issues that he hasn't elaborated on.
Storm clouds rolled in just before the start of their match on Saturday and after a short delay to start the first set they managed to play until the heavy rains came in the second.
In late action, Croat second seed Marin Cilic beat Hungarian Marton Fucsovics 7-5, 6-3, while Canadian Milos Raonic defeated 17-year-old compatriot Felix Auger-Aliassime 6-4, 6-4.
After a closely fought first two sets, Daniel said he sensed Djokovic, still clearly lacking match fitness, was tiring at the start of the third.More news: Latest Analysts Research Reports About Barrick Gold Corporation (ABX), Momo Inc. (MOMO)
More news: Smart out indefinitely with torn thumb tendon
More news: Hubert de Givenchy, French fashion icon, dies at 91
Watch Full Match ReplaysAt No. 109 in the ATP Rankings, Daniel scored an impressive win over Mackenzie McDonald in the final round of qualifying and followed that up with a victory over an in-form Cameron Norrie on Friday.
Federer will now face 25th seed Filip Krajinovic in the third round.
"It feels insane. I mean, I'm still in shock", Anisimova said.
"Very weird - I just completely lost rhythm", Djokovic said.
"I have been sick for over a week and tried everything I could to get better".
The defending champion came through, though, reaching a tie-break before his class told and it became apparent that the weather had only delayed the inevitable.
Frenchman Gael Monfils survived a match point before beating big-serving American 15th seed John Isner 6-7 (5-7) 7-6 (7-3) 7-5. He defeats Federico Delbonis in straight sets after a rain delay and tough tiebreak.