weatherbox:gateway:gateway_simulation

This is an old revision of the document!


Gateway Simulation Module

The “Gateway Simulation Module” is a means to test the ability of the Gateway to correctly handle the various types of packets. The current simulation module includes the following packets: Heartbeat, Apple, Cranberry, Dragonfruit, and Bad Packet. If you wish to add more packets, follow the instructions below under “Capturing New Packets.”

To test the Gateway with simulated packets, first download or clone the repository at https://github.com/scel-hawaii/data-gateway. For best results use a linux machine. Windows machines are incompatible.


Edited: 09/29/16

The following documentation denotes how to test packets with the packet_tester.py without hardware on a Linux machine.

Required materials:

  • Configured packet_tester.py (used for testing incoming packets)
    • See documentation regarding setup here
  • test_data.py (used for writing preset packet to serial)
  • socat (used for creating virtual serial ports)
    • more info on socat here

Step 1: Install socat with the following command

sudo apt install socat

Step 2: Run socat with the following command

socat -d -d pty,link=./ttyV1,raw,echo=0 pty,link=./ttyV2,raw,echo=0

This command allows for the use of ttyV1 and ttyV2 as virtual serial ports

Step 3: Run the test_data.py program with the following command

python test_data.py

The program will then prompt the user to enter the serial port being used. You will enter the following string:

ttyV1

The program will begin writing fake packets to the serial port

Step 4: Run the packet_tester.py program with the following command

python packet_tester.py

The program will then prompt the user to enter the serial port being used. You will enter the following string:

ttyV2

The program will begin reading the packets and outputting the result to the terminal

Step 5: Congratulations you have successfully tested packets without hardware!


//Socat// Usage


  • weatherbox/gateway/gateway_simulation.1479261705.txt.gz
  • Last modified: 2021/09/19 21:59
  • (external edit)