Skip to content

Instantly share code, notes, and snippets.

View ChristianTremblay's full-sized avatar

Christian Tremblay ChristianTremblay

View GitHub Profile
@ChristianTremblay
ChristianTremblay / BokehRenderer.py
Last active December 16, 2015 17:24
BokehRenderer problem
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 by Christian Tremblay, P.Eng <christian.tremblay@servisys.com>
#
# Licensed under LGPLv3, see file LICENSE in this source tree.
"""
This module allows the creation of threads that will be used as repetitive
tasks for simulation purposes
"""
> bugin bacpypes.netservice.NetworkServiceAccessPoint
handler to bacpypes.netservice.NetworkServiceAccessPoint added
> read 2:5 analogInput 1 presentValue
DEBUG:bacpypes.netservice.NetworkServiceAccessPoint:indication <bacpypes.apdu.ConfirmedRequestPDU(12,1) instance at 0x7f41868c78d0>
<bacpypes.apdu.ConfirmedRequestPDU(12,1) instance at 0x7f41868c78d0>
pduDestination = <Address 2:5>
pduExpectingReply = 1
pduNetworkPriority = 0
apduType = 0
> read 2:5 analogInput 1 presentValue
DEBUG:bacpypes.appservice.ApplicationServiceAccessPoint:sap_indication <bacpypes.apdu.ReadPropertyRequest(12) instance at 0x7ff1bae8a6d8>
<bacpypes.apdu.ReadPropertyRequest(12) instance at 0x7ff1bae8a6d8>
pduDestination = <Address 2:5>
pduExpectingReply = 1
pduNetworkPriority = 0
apduType = 0
apduService = 12
objectIdentifier = ('analogInput', 1)
propertyIdentifier = 'presentValue'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
C:\Users\ctremblay.SERVISYS\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyhaystack\client\ops\grid.py in _do_auth_attempt(self, event)
116 try:
--> 117 self._session.authenticate(callback=self._on_authenticate)
118 except: # Catch all exceptions to pass to caller.
C:\Users\ctremblay.SERVISYS\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyhaystack\client\session.py in authenticate(self, callback)
97 # Already done
---> 98 return callback(auth_op)
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 16 18:13:39 2016
@author: CTremblay
"""
import fysom
from ..crc import calc_incr_header_crc, data_crc
@ChristianTremblay
ChristianTremblay / Niagara4 Scram exchange
Created April 25, 2017 01:54
Extract from wireshark TCP flow
GET /prelogin?clear=true HTTP/1.1
Host: 192.168.210.10:88
User-Agent: python-requests/2.7.0 CPython/3.4.3 Linux/4.4.50-v7+
Connection: keep-alive
Accept: */*
Accept-Encoding: gzip, deflate
HTTP/1.1 302 Found
Set-Cookie: JSESSIONID=29d3613a82dc65dc7eab15c94d40d9e487ffe25aa868d7d84d;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
@ChristianTremblay
ChristianTremblay / bacpypes_karen
Created September 26, 2018 02:34
Code example for MockServer using bacpypes
from bacpypes.debugging import bacpypes_debugging, ModuleLogger
from bacpypes.consolelogging import ConfigArgumentParser
from bacpypes.core import run, stop, deferred, enable_sleeping
from bacpypes.iocb import IOCB
from bacpypes.pdu import Address
from bacpypes.primitivedata import Real
from bacpypes.object import get_datatype, AnalogValueObject, Property, register_object_type
from bacpypes.apdu import ReadPropertyRequest
@ChristianTremblay
ChristianTremblay / Meteo.py Example
Created October 19, 2019 19:41
Example of using BAC0 to create a BACnet device. (Meteo parser not included)
import atoma, requests
import BAC0
import re
from meteo_parser import MeteoGC
from bacpypes.basetypes import EngineeringUnits, DateTime
from bacpypes.primitivedata import CharacterString, Date, Time
from BAC0.core.devices.create_objects import (
create_AV,
#!/usr/bin/env python
"""
Rebuilt Commandable
"""
from bacpypes.debugging import bacpypes_debugging, ModuleLogger
from bacpypes.consolelogging import ConfigArgumentParser
from bacpypes.core import run
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.