This week I worked on the code for the nodes to execute the schedule they were given. The beginning of this week was mostly the team hashing out the details of how the schedule is structured so that we could all work in parallel. I referenced Arden’s code for the STP to learn how he got the nodes to communicate with each other, and used that as the starting point as that is likely the most difficult part of timing the schedule. I started with just printing statements about what the node should do in each time slot given a test schedule. I would check if the current time slot was a transmit slot, a receive slot, or if all the time slots had passed and it was time for the node to sleep. Once that was working, I used some of Arden’s functions for transmitting with the LORA to test if two nodes would communicate with each other according to the schedule. Initially I was calling a function to execute a time slot in the timer callback when tim16 interrupted. Arden was using the callback when tim2 interrupted to increment a counter used for timeouts in his LORA functions. Because of how the callback works, this meant the tim2 counter did not increment while my tim16 interrupt handler was running and if I called a LORA function to transmit or receive data in the handler it would not time out. I fixed this by moving the function into an infinite while loop in main, and have the tim16 interrupt set a boolean value to indicate the start of a timeslot. Now I have successfully gotten one node to send a packet to another node in a given time slot. Next I will make a packet structure that will be used to communicate to the gateway which nodes have detected fire and which are offline, and make it so parent nodes include data from their children in the packet they transmit. Once that is working, I will add in sensing for a fire during the transmit time slot and put the node into standby when the node is supposed to sleep. Then I will have to integrate my code with the rest of the team.