Khogyani - A computer without a power cable, a spy camera with English instructions that no one can read, and water-logged accommodation - life on the frontline can be a long series of setbacks and challenges for Afghan soldiers.
In the eastern district of Khogyani, the war against Taliban militants is a day-to-day struggle for control of fields and villages just outside Jalalabad, one of Afghanistan's biggest and most strategic cities.
At one post, six soldiers live in a flimsy wooden shack made of planks, plastic sheets and sandbags, on alert 24 hours a day for attack from the surrounding rebel-held mountains.
They dry their clothes on a rope and spend their days on guard duty, listening to radio messages and passing on information to other units in the area.
"Of course, we are proud of our job," Shapoor Ahmadzai, aged 27, told AFP. "We are here to serve our country, and we are hopeful and optimistic about the future.
"But this place is an absolute mess. When it rains, water just comes into the room, so nobody can do his job, and we live in darkness when we don't have electricity."
Basic issues over equipment, living quarters, food supplies and vehicle maintenance are among the major problems facing the Afghan army as it fights a resilient enemy that controls swathes of the south and east of the country.
The 190 000 soldiers of the Afghan National Army (ANA) have largely taken over responsibility for the war against the Taliban after more than a decade in which well-equipped, well-trained Nato troops dominated the battlefield.
All 51 000 remaining Nato combat troops will pull out of the country by December.
"If they equip us with helicopters and fighter jets, and if they support us properly, we can perform our job the best way on our own," Ahmadzai said.
"But we are short of helicopters and planes, and without them it will be difficult for us."
Spartan army life
Soldiers at the post in Khogyani hang flak jackets by their beds at night in case of emergencies, and keep their sparse personal possessions on wooden beams in living conditions that boast few creature comforts.
Billions of dollars of foreign money - most of it American - is spent every year on Afghan security forces in the hope they will be able to secure the country and prevent a return to civil war after Nato troops leave.
The army has been built from scratch since 2002, and has made rapid progress, but it remains dogged by high desertion rates, ethnic imbalances and poor logistics.
Also looming over the ANA is the ever-present threat of "insider attacks", when soldiers - inspired either by the Taliban or personal grievances - turn their guns on their own colleagues.
The ministry of defence declines to give numbers for such incidents, but it became such a problem for Nato troops that "guardian angel" snipers were assigned to oversee joint-patrols.
"A few months ago, a soldier wanted to assassinate the general here," an Afghan intelligence officer told AFP.
"We were suspicious and tracked down explosives he had hidden in his car. Such a danger exists in all of Afghanistan."
The officer, who declined to be named, showed AFP the computer on which he was meant to gather reports.
It sat uselessly on a desk, with no power cable, and no electricity to plug it into.
He has also been supplied with a high-tech digital camera, but it doesn't have a memory card and no one can work out how to use it as the instructions are written in English.
At the base, joints of meat are butchered and cooked up in cauldrons set over open wood fires for lunch, which is served with rice and vegetables.
Soldiers pray at the mosque and attend religious lectures twice a week.
"Of course, we are afraid when we go out of the base," said Mursaleen, aged 21, who like many Afghans uses only one name.
"We are afraid of landmines, IEDs and ambushes. They plant bombs under trees where we might sit for a rest."
For Mursaleen, a monthly pay cheque of $215 makes joining the army worthwhile.
"I belong to a poor family, and could not find any job outside," he said. "Any work we do find pays less than the army. The salary I get, I send to my family."
Afghanistan's security forces face a difficult test in this summer's annual "fighting season" as they battle Taliban insurgents with the assistance of fewer and fewer Nato troops.
Last year Afghan army and police fatalities topped 100 every week at the peak of fighting, according to US officials.
Peace talks with the Taliban may well be explored after the ongoing presidential election, but Afghanistan will still need a professional and sustainable army to impose security in a country at war for more than 30 years.
The election campaign and polling day were not hit by any large-scale Taliban attacks - an achievement that Afghan and Nato leaders hailed as an unequivocal sign of the army's growing effectiveness.
Among those who express optimism in the local soldiers are the long-bearded American special forces' commandos who maintain a discreet presence at the base.
"We're here to give advice and assistance, including air support," one told AFP, declining to give his name.
"I'm confident and I'm very impressed. It's one of the more capable forces I've worked with, and that judgement is defined by what is happening here on the ground".