Wireless sensor networks (WSNs) are widely applied in battlefield surveillance, where the data collection (e.g. target tracking or contention zone observation) employed by local sensor nodes needs to send to military bases for tactical decisions. Since data transmissions are susceptible to malicious attacks, jammers of adversaries can successfully block their victim's communications by transmitting interfering signals to legitimate transmissions. Nowadays, owing to the ability to reconfigure the wireless propagation medium, reconfigurable intelligent surface (RIS) is regarded as an effective tool to enhance transmission performance, especially in the jamming context. This paper considers the anti-jamming communication tactical scenario of a solar-powered RIS network, in which the RIS is used to improve the uplink transmission performance between a wireless device (WD) and a base station (BS). We investigate the long-term anti-jamming communications of the WD powered by a solar energy harvester. Our objective is to jointly assign the optimal amount of transmission energy and the RIS phase shifts to maximize the data rate of the system in the long run. To this end, we formulate an anti-jamming communication optimization problem as a Markov decision process (MDP) framework and then design a deep Q network (DQN)-based algorithm to generate an optimal policy. As a result, the optimal resource allocation is achieved through trial-and-error interactions with environment by observing the predefined rewards and the network state transition. The Python simulation results conducted by averaging 10 4 time slots show that the proposed algorithm is not only able to learn from environment, but also yields better performance than baseline schemes under network changes. Moreover, the performance of RIS communication schemes is verified to be superior to that of without-RIS communication schemes in the jamming context.INDEX TERMS reconfigurable intelligent surface, deep reinforcement learning, markov decision process, solar-powered network, jamming attack, battlefield surveillance.