weatherbox:gateway:gateway_simulation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
weatherbox:gateway:gateway_simulation [2016/11/16 02:28]
tbyers
weatherbox:gateway:gateway_simulation [2017/03/08 04:28]
tbyers
Line 1: Line 1:
 ====== Gateway Simulation Module ====== ====== 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."​+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 "Adding ​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. 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. The following documentation denotes how to test packets with the packet_tester.py without hardware on a Linux machine.
Line 47: Line 45:
  
 **Step 5: Congratulations you have successfully tested packets without hardware!** **Step 5: Congratulations you have successfully tested packets without hardware!**
 +----
 +====== Adding New Packets ======
 +If at some point you need to add more packets to the simulation, here is how to do it.
 +
 +**Prerequisites:​ You need to have a working box transmitting the packets you would like to capture to an XBee device connected to your computer via USB.
 +
 +**Step 1: After cloning the data-gateway repository, move to the "​test"​ directory**
 +
 + cd test
 +
 +**Step 2: Open the fake_packet.py file with the editor of your choice and make sure the "first block" of code is not commented out and the "​second block" of code is commented out, if that is not the case make it so**
 +
 +{{ :​weatherbox:​gateway:​gateway_test_code_2.png?​300 |}}
 +
 +**Step 3: Run fake_packet.py while a weatherbox is transmitting the packets you wish to replicate, and an XBee is connected to your computer.**
 +
 + python fake_packet.py
 +
 +**Step 4: Reopen fake_packet.py and make sure the "first block" is now commented out and the "​second block" is not commented out**
 +
 +{{ :​weatherbox:​gateway:​gateway_test_code_1.png?​300 |}}
 +
 +**Step 5: Run fake_packet.py again**
 +
 + python fake_packet.py
 +
 +**Step 6: The packet is now in the packet_data file. Now you can add the values from this file to the test_data.py script following the format existing there**
 +
 +**NOTE: This process should be improved**
 +
 ---- ----
 ====== Socat Usage ====== ====== Socat Usage ======
  • weatherbox/gateway/gateway_simulation.txt
  • Last modified: 2021/09/19 21:59
  • (external edit)