CITS4419 Sensor Networks Lab (week 3)
Concepts and Preparation
This lab is designed to introduce you to programming a MAC protocol.
You will use Arduino Unos with a LoRa radio shield for programming some simple message exchanges.
Before the lab you should review the lecture material on MAC protocols from week 2.
- Make a group of 4 people. Each group will need 2 Arduino Unos, 2 Dragino LoRa shields and 2 programming cables.
- This lab is based on Example4 -- LMIC-RAW-915 from
http://wiki.dragino.com. Read these notes and assemble your Arduino-Lora nodes.
- Download prepared Arduino code from
https://github.com/websense/LoraDraginoCode. Use this version of the code and LMIC library since the necessary changes to constants have already been done.
If you are working on your own laptop you will first need to install the Arduino IDE.
- Following the tutorial example 4 from
http://wiki.dragino.com load the given code onto each of both of your nodes. You should now start receiving messages on each one. Use the Arduino terminal to track the debug reports.
- Possible problem: You may experience problems from overhearing the other groups' messages.
If so try setting a slightly different value for
LMIC.freq = 915525000; (line 164).
- Experiment with the placement of your nodes so that their communication channel is OK but not perfect.
Use your experience from week 2 to decide on suitable positions.
- Once you know your set up is working, increase the time interval between messages
#define TX_INTERVAL 4000 (eg to 10000 or more) so that messages are sent less frequently.
- Now make some protocol modifications.
Instead of having a duplex channel, make one node a transmitter and one a receiver.
Change the message format so that the sender includes a sequence number in each packet, and
the receiver acknowledges this number. If the transmitter does not receive an acknowledgement it should resend its
last message. Record the number of messages received and lost using a reasonable time windows. (eg record the results for
every 10 or 20 transmitted messages).
- Modify the receiver so it remembers RSSIs of incoming packets.
Maintain a moving window average of RSSI values and report this value in each acknowledgement packet.
Also record these RSSI values for your results.
In the coming weeks we will consider how the transmitter could use this value to tune its transmission parameters.
- Next week we will experiment with the LoRa settings. But if you have time, try some changes now.
Write a short lab report documenting the results of your experiments.
- Describe your sensor network set up: the equipment used and your node positions.
- Describe the format of your packets. Record the packet reception rates you observed on your channel: that is the number of packets received vs number sent over a reasonable period of time.
- Describe the RSSI values you observed. How much did these values vary? What do your results tell you about the communication channel.
- Describe any other things that might have affected your experiment results. For example, what was the effect of other transmissions in the room? Did you need to adjust the frequency? How much did position of the nodes affect your results?
When you have completed your lab report, upload it to cssubmit (wk3 lab). Your report should be a single file in pdf format.
Labs do not count towards your assessed marks but I will provide formative feedback on your lab reports.
Submissions for the assessed project will be in a similar format.
Department of Computer Science and Software Engineering