Skip to content

Instantly share code, notes, and snippets.

View hj91's full-sized avatar
:octocat:

Harshad Joshi hj91

:octocat:
View GitHub Profile
@hj91
hj91 / flow.json
Created April 9, 2024 15:53
A flow to visualize historic and live data obtained from MQTT broker and stored in InfluxDB. We will be using @flowfuse/node-red-contrib-dashboard and node-red-contrib-influxdb
[
{
"id": "dc1c7f4e5ddc86f8",
"type": "tab",
"label": "MING",
"disabled": false,
"info": "",
"env": []
},
{
@hj91
hj91 / FanucMTConnectTopics.txt
Created September 20, 2023 07:25
Topics data that are logged in Influxdb.
MTConnectFanuc/Device/d9006c59-58cc-57ff-b9a1-21ecb7559681
MTConnectFanuc/Device/f_sim
MTConnectFanuc/Observation/
MTConnectFanuc/Observation/d9006c59-58cc-57ff-b9a1-21ecb7559681/Events/Availability
MTConnectFanuc/Observation/d9006c59-58cc-57ff-b9a1-21ecb7559681/Events/DeviceAdded
MTConnectFanuc/Observation/d9006c59-58cc-57ff-b9a1-21ecb7559681/Events/DeviceChanged
MTConnectFanuc/Observation/d9006c59-58cc-57ff-b9a1-21ecb7559681/Events/DeviceRemoved
MTConnectFanuc/Observation/f_sim/Axes/Linear[X]/Condition/Actuator
MTConnectFanuc/Observation/f_sim/Axes/Linear[X]/Condition/Position
MTConnectFanuc/Observation/f_sim/Axes/Linear[X]/Condition/Temperature
@hj91
hj91 / MTConnect.array
Created September 18, 2023 16:08
Getting Topic and Payload as an array
["MTConnectFanuc/Device/d9006c59-58cc-57ff-b9a1-21ecb7559681",null]
["MTConnectFanuc/Device/f_sim",null]
["MTConnectFanuc/Observation/",3.2]
["MTConnectFanuc/Observation/d9006c59-58cc-57ff-b9a1-21ecb7559681/Events/DeviceChanged","UNAVAILABLE"]
["MTConnectFanuc/Observation/d9006c59-58cc-57ff-b9a1-21ecb7559681/Events/DeviceRemoved","UNAVAILABLE"]
["MTConnectFanuc/Observation/d9006c59-58cc-57ff-b9a1-21ecb7559681/Events/DeviceAdded","f_sim"]
["MTConnectFanuc/Observation/d9006c59-58cc-57ff-b9a1-21ecb7559681/Events/Availability","AVAILABLE"]
["MTConnectFanuc/Observation/f_sim/Controller/Path/Events/x:ProgramSize.Main","500"]
["MTConnectFanuc/Observation/f_sim/Controller/Path/Events/PartCount.All","1079"]
["MTConnectFanuc/Observation/f_sim/Controller/Path/Events/Block","4"]
@hj91
hj91 / parse.txt
Created September 15, 2023 12:25
Parser for data obtained from http://mtconnect.mazakcorp.com:5609/current
harshad@harshad-HP-Laptop-15q-ds0xxx:~$ node mt-parser-current.js
ComponentStream: base, Component: Axes
Condition:
Unavailable: N/A (timestamp: 2023-08-06T20:17:07.303223Z)
Unavailable: N/A (timestamp: 2023-08-06T20:17:07.303223Z)
ComponentStream: A, Component: Rotary
Samples:
AngularVelocity: UNAVAILABLE (timestamp: 2023-08-06T20:17:07.303223Z)
Load: UNAVAILABLE (timestamp: 2023-08-06T20:17:07.303223Z)
Angle: UNAVAILABLE (timestamp: 2023-08-06T20:17:07.303223Z)
@hj91
hj91 / config.toml
Created December 14, 2022 10:20
configuration file for opcua logger
# The OPCUA connection parameters. If you want to use anonymous auth,
# remove the username and password lines.
[opcua]
url = "opc.tcp://192.168.1.9:49320/KEPServerEX"
user = ""
pass = ""
# The InfluxDB connection parameters. Use a connection url containing all
# details, ie. http(s)://user:password@host:port/database
[influx]
@hj91
hj91 / opcua_server_to_gnusocial.py
Created April 7, 2022 16:31
Post opcua server variable data on GNUSocial
#opcua to GNUSocial Post
#(c) Bufferstack.IO Analytics Technology, 2021
from opcua import Server
from random import randint
from gnusocial import statuses
import time
server = Server()
@hj91
hj91 / esp32-opcua-server-log
Created December 10, 2020 11:54
This is esp32 server log
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4
@hj91
hj91 / pull_fb_notifications.py
Created May 2, 2011 12:18
Get Facebook Notifications on sms using Python
# This code is meant to show how to get latest notifications on sms using python-gammu library
# Very simple and primitive code..
# To Do - Create a mysql backend and run this program every 10 minutes. The notifications sent before shoudent be sent on sms again (i need someone to write code for that ;)
import feedparser
import gammu
import urllib2
import gammu
sm = gammu.StateMachine()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Full script used in blog post at http://h6o6.com/2013/03/using-python-and-the-nltk-to-find-haikus-in-the-public-twitter-stream
4-clause license (original "BSD License")
Copyright (c) 2013, h6o6
All rights reserved.
@hj91
hj91 / Gorillas.bas
Created June 25, 2011 17:07
QBasic Gorillas
' Q B a s i c G o r i l l a s
'
' Copyright (C) IBM Corporation 1991
'
' Your mission is to hit your opponent with the exploding banana