courses

Lab 3

Due Date: 2025-11-26 23:59:59

Introduction

We often want to listen in on wireless communications to see what is being transmitted. In this lab, you will set up your Feather board with the OLED FeatherWing to display information about the LoRA radio as well as the IP address assigned to the Airlift FeatherWing when it connects to WiFi.

Tasks

  1. Using the combined code from Lab 2, set up your Feather board to listen for LoRA packets. When a packet is received, display the contents of the packet on the OLED display along with the RSSI (Received Signal Strength Indicator) value. Document this in your lab3.md file.
  2. Modify the code to also display the number of packets received so far. Each time a new packet is received, update this count on the OLED display. Document this in your lab3.md file.
  3. This is where things get more interesting. There are LoRA packets flying all over our building. Some of them are very simple – just ascii text message – while others are more complex, such as meshtastic coded data. Your task is to capture whatever packets there are, and push them over a secondary serial port to your computer, where you will ingest the packets via Wireshark or tcpdump. Document your approach in your lab3.md file, including any code you wrote to facilitate this.

    As shown in class, you’ll need a boot.py file to set up a secondary serial port. Here is an example boot.py that sets up a secondary serial port on the Feather RP2040 with RFM95 board:

    import usb_cdc
    
    usb_cdc.enable(console=True, data=True)
    

    And then in code.py, you can write to the secondary serial port like this:

    usb_cdc.data.write(b"Waiting for packets...\r\n")
    
    1. Make use of the pcap file format to write the captured packets.
    2. Make use of the pcap-ng format to write the captured packets.

    In either case, you will need to research the pcap and pcap-ng file formats to understand how to structure the data correctly. You can find the specifications for these formats online, or by using a hex editor to examine existing pcap files generated by Wireshark or tcpdump.

    You will also need timestamps for each packet. The Feather RP2040 does not have a real-time clock, so you will need to implement a simple timekeeping mechanism. One approach is to use the time module to track elapsed time since the board was powered on. You can use time.monotonic() to get a monotonically increasing time value. You can also sync to an NTP server over WiFi to get the current time when the board connects to WiFi, and use that as a reference point for your timestamps (in conjunction with time.monotonic()).

    Document your approach in your lab3.md file, including any code you wrote to facilitate this.

Submission

Once you have completed the above, you should have a markdown file in your repo called lab3/lab3.md that contains all the requested information. Commit and push this to your repo. Also commit and include the requested screenshots. Once you have done this, you can consider the assignment submitted.