GithubHelp home page GithubHelp logo

devicetrace's Introduction

devicetrace

Requirements

  • Python modules in requirements.txt installed
  • gcloud CLI installed and authenticated for both CLI and application default credentials (gcloud auth login and gloud auth application-default login) with IAM permissions for required Pub/Sub Subscription, IoT Registry, and Cloud Logging
  • Cloud logging enabled

Usage

Config Updates

Update device config (and publish to topic so it's in the traces generated by config.py) python3 config.py PROJECT_ID AHU-1 ZZ-TRI-FECTA us-central1 udmi_target config1.json

Message Traces

View PUB/SUB Message log and store messages for given device ID's (will match ANY device with the device ID) python3 trace.py PROJECT_ID gama2 AHU-1

python3 trace.py PROJECT_ID gama2 GAT-100,ACT-1 .

2022-09-01 14:03:29.407000+00:00  GAT-100    ZZ-TRI-FECTA    event_pointset
2022-09-01 14:03:34.529000+00:00  GAT-100    ZZ-TRI-FECTA    event_system
2022-09-01 14:03:39.788000+00:00  GAT-100    ZZ-TRI-FECTA    state
2022-09-01 14:03:44.798000+00:00  ACT-1      ZZ-TRI-FECTA    event_pointset
2022-09-01 14:03:49.811000+00:00  ACT-1      ZZ-TRI-FECTA    event_system
2022-09-01 14:03:54.936000+00:00  ACT-1      ZZ-TRI-FECTA    state
2022-09-01 14:04:00.220000+00:00  GAT-100    ZZ-TRI-FECTA    event_pointset
2022-09-01 14:04:05.312000+00:00  GAT-100    ZZ-TRI-FECTA    event_system

GCP Device Logs (Cloud Logging)

View GCP Logs for given device ID's (refreshes every 10 seconds to try and keep items in order, but not always possible. Will match any device with the given device ID) python3 log.py daq1-273309 GAT-100,ACT-1

2022-09-01 14:34:57.540163+00:00  GAT-100    ZZ-TRI-FECTA    PUBLISH EVENTS
2022-09-01 14:35:02.654997+00:00  GAT-100    ZZ-TRI-FECTA    PUBLISH EVENTS
2022-09-01 14:35:07.496057+00:00  GAT-100    ZZ-TRI-FECTA    PUBACK CONFIG
2022-09-01 14:35:07.496122+00:00  GAT-100    ZZ-TRI-FECTA    CONFIG 
2022-09-01 14:35:07.626950+00:00  GAT-100    ZZ-TRI-FECTA    PUBLISH STATE
2022-09-01 14:35:07.677668+00:00  GAT-100    ZZ-TRI-FECTA    PUBLISH STATE (RESOURCE_EXHAUSTED The device "2582332477650079" could not be updated. Device state can be updated only once every 1s.)
2022-09-01 14:35:07.679536+00:00  GAT-100    ZZ-TRI-FECTA    DISCONNECT  (RESOURCE_EXHAUSTED The device "2582332477650079" could not be updated. Device state can be updated only once every 1s.)
2022-09-01 14:35:19.115078+00:00  GAT-100    ZZ-TRI-FECTA    CONNECT 
2022-09-01 14:35:23.637210+00:00  GAT-100    ZZ-TRI-FECTA    SUBSCRIBE /devices/GAT-100/config
2022-09-01 14:35:23.653924+00:00  GAT-100    ZZ-TRI-FECTA    SUBSCRIBE /devices/GAT-100/commands/#
2022-09-01 14:35:23.654129+00:00  GAT-100    ZZ-TRI-FECTA    SUBSCRIBE /devices/GAT-100/errors
2022-09-01 14:35:24.491455+00:00  GAT-100    ZZ-TRI-FECTA    PUBACK CONFIG
2022-09-01 14:35:24.491506+00:00  GAT-100    ZZ-TRI-FECTA    CONFIG 
2022-09-01 14:35:24.632056+00:00  GAT-100    ZZ-TRI-FECTA    PUBLISH STATE
2022-09-01 14:35:25.094994+00:00  ACT-1      ZZ-TRI-FECTA    ATTACH_TO_GATEWAY GAT-100

devicetrace's People

Contributors

noursaidi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.