In the Python plugin framework the fastest heartbeat is 1 second.
Is it possible to create an event or heartbeat with a interval of 300 ms for polling.
I've tried to solve it with a threading.Timer but this is working in a standalone Python program outside Domoticz but not inside Domoticz.
Search found 5 matches
- Friday 27 October 2017 23:29
- Forum: Python
- Topic: Python plugin framework heartbeat 300 ms
- Replies: 0
- Views: 526
- Tuesday 03 October 2017 17:22
- Forum: Python
- Topic: How to set serial parameters in Python plugin framework
- Replies: 6
- Views: 1599
Re: How to set serial parameters in Python plugin framework
Dnpwwo, many thanks for your reply on this topic (and PM).
The defaults of the serialport are:
- Parity = NONE
- Stopbits = 1
- Charactersize = 8
- Flowcontrol = NONE
Lucky for me this is what I need, so I don't need to change it.
bool CPluginTransportSerial::handleConnect()
{
try
{
if ...
The defaults of the serialport are:
- Parity = NONE
- Stopbits = 1
- Charactersize = 8
- Flowcontrol = NONE
Lucky for me this is what I need, so I don't need to change it.
bool CPluginTransportSerial::handleConnect()
{
try
{
if ...
- Thursday 28 September 2017 22:39
- Forum: Python
- Topic: How to set serial parameters in Python plugin framework
- Replies: 6
- Views: 1599
Re: How to set serial parameters in Python plugin framework
Thanks again zak45.
Your example makes it possible to define the baudrate in the hardware GUI of domoticz.
But I am searching for a way to define the parity and the number of stopbits.
In the python plugin framework the port and the baudrate can be set with:
Domoticz.Transport("Serial", PORT ...
Your example makes it possible to define the baudrate in the hardware GUI of domoticz.
But I am searching for a way to define the parity and the number of stopbits.
In the python plugin framework the port and the baudrate can be set with:
Domoticz.Transport("Serial", PORT ...
- Thursday 28 September 2017 14:04
- Forum: Python
- Topic: How to set serial parameters in Python plugin framework
- Replies: 6
- Views: 1599
Re: How to set serial parameters in Python plugin framework
Thanks zak45.
The example in my first post was pyserial code and this is working in a standalone python program.
In the plugin framework you're bound to the given structure.
def onStart():
Domoticz.Transport("Serial", Parameters["SerialPort"], 9600)
Domoticz.Connect()
return
The question is ...
The example in my first post was pyserial code and this is working in a standalone python program.
In the plugin framework you're bound to the given structure.
def onStart():
Domoticz.Transport("Serial", Parameters["SerialPort"], 9600)
Domoticz.Connect()
return
The question is ...
- Thursday 28 September 2017 10:10
- Forum: Python
- Topic: How to set serial parameters in Python plugin framework
- Replies: 6
- Views: 1599
How to set serial parameters in Python plugin framework
in the python plugin framework it's possible to set the serialport and the baudrate with:
Domoticz.Transport("Serial", Parameters["SerialPort"], 19200)
Is it also possible to change other serial parameters like:
ser = serial.Serial(
port='/dev/pts/81',
baudrate=19200,
parity=serial.PARITY_NONE ...
Domoticz.Transport("Serial", Parameters["SerialPort"], 19200)
Is it also possible to change other serial parameters like:
ser = serial.Serial(
port='/dev/pts/81',
baudrate=19200,
parity=serial.PARITY_NONE ...