This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import minimalmodbus | |
import time | |
import paho.mqtt.publish as publish | |
instrument = minimalmodbus.Instrument('/dev/ttyUSB0', 1, debug = False) | |
instrument.serial.baudrate = 9600 | |
# This probably doesn't need setting but I was getting timeout failures | |
# rather than wrong data address when I had the registers wrong | |
instrument.serial.timeout = 2 | |
# An example read for long |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.WebUtilities; | |
using Microsoft.Net.Http.Headers; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Threading.Tasks; | |
public class ETagMiddleware | |
{ |