Skip to content

thekosmix/gps-fuzzer-implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

gps-fuzzer-implementation

If you went through thetaonelab.com's blog and codebase, you might have realised that it's a little difficult to implement the gps-fuzzer due to instructions not being very clear. I have summarised the way to do it in a step-by-step guide below.

MQTT & Web-Socket (WS) implementation for demo of gps-fuzzer

install dependancies and projects

  1. nodejs & npm
  2. mosquitto
  3. checkout gps-fuzzer - backend server for producing random lat-long for front-end to consume
  4. checkout Implementation-of-gps-fuzzer

Configurigure to run locally

Changing the MQTT & WS address

  1. Go to Map.js file in Implementation-of-gps-fuzzer and replace existing var client = ... with your local mosquitto setup var client = mqtt.connect("ws://127.0.0.1:8080", {clientId: "dfndmnfnbsfb_client"})
  2. Go to server.js file of gps-fuzzer and replace existing var client = ... with your local mosquitton setup var client = mqtt.connect("mqtt://127.0.0.1", {clientId: "dfndmnfnbsfb_server"})

Enabling mosquitto to support WS

  1. Follow the instructions mentioned here
  2. Restart Mosquitto server

Running the applications

  1. Run backend server: cd gps-fuzzer && npm i && npm start
  2. start fuzzing by hitting the backend server
curl --location 'http://localhost:9999/fuzzgps' \
--header 'Content-Type: application/json' \
--data '{
        "payload":{ 
            "tripId":15, 
            "deviceId":123
        },
        "points":[{ "lati": 25.30, "longi": 88.30 }, { "lati": 24.30, "longi": 88.00 } , { "lati": 25.30, "longi": 89.00 }],
        "topic":"eyezon/livegps",
        "interval":400,
        "duration":4000,
        "loop":true
    }'
  1. Subscribe on command line to check if it's actually publishing: mosquitto_sub -h localhost -t eyezon/livegps --id dfndmnfnbsfb_cmd_client
  2. Run front-end: cd Implementation-of-gps-fuzzer && npm i && npm start
  3. The last command will open web-browser at port localhost:3000 and you'll see a small vehicle moving randomly
gps-fuzzer-demo.mov

Releases

No releases published

Packages

 
 
 

Contributors