Posts: 16
Joined: Sat Feb 23, 2019 1:07 am

Virtual I/O

Sat Mar 21, 2020 1:05 am

Have a Python Process that automatically loads with Raspbian at bootup ... this process monitors several Analog and Digital Inputs which in turn affect a display.

What I am looking to do is:

Provide Virtual I/P's that can override the current values of the physical Inputs

This can be done by externally updating a text file which the Boot Process could continually monitor ... but I am wondering if there is some other way to either

a) interchange/share data with the running process (similar to windows inter process messaging) ... would Threading have something like this or is Threading limited to Threads started within the same process


b) provide the ability to directly access some shared STATIC memory


Posts: 1642
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Virtual I/O

Sat Mar 21, 2020 1:23 am

Mqtt might be a useful tool for you to check out. it provides a mechanism for processes to publish data through a broker system which can be subscribed to by other systems and processes. http://www.steves-internet-guide.com/in ... on-client/

you can host a mqtt broker like mosquitto on your pi without any performance impact .

Using mqtt to publish your input data means you can switch to an alternate/virtual input source simply by changing the subscribing processes target topic.

Node Red injection nodes could provide you with a simple to configure source of virtual inputs that can be published to your custom schedule to emulate rl inputs.

Return to “Python”