1

on my Embedded Linux system I have local Web/RESTFul Microservice (Nginx + Gunicorn & Flask) to manage a connected sensor. A second local Python Sensor application gathers every 10 seconds data from that sensor and also expose functions to read that data, write sensor config.

What might be a good and lightweight approach to exchange data between both processes in both directions?

I assume I need some kind of client-server infrastructure whereas the Python sensor app plays the role of the server and the Flask Microservice the role of the client.

Thanks

Janusz Piwek
  • 69
  • 1
  • 4
  • 1
    Redis may be an option... https://stackoverflow.com/a/58521903/2836621 – Mark Setchell Jul 04 '20 at 11:16
  • Mark, thanks! I will look into it. Redis supports queues, pub/sub , ....looks promising for what I traying to achieve. Also unix sockets are an lightweight option. – Janusz Piwek Jul 04 '20 at 13:53
  • 1
    If the second application exposed a REST interface, they could exchange API calls (taking care to avoid loops). – Dave W. Smith Jul 04 '20 at 18:30
  • Hi Dave, I am sharing data between both application using JSON files. The Python sensor app prodcues data and the Microservice Flask REST API consumes it on REST API request. What is best pratice to share file and folder definitinons between 2 applications processes? Environment variables? In my case I need some kind of parent config file which defines the path definition where to find the files. My current app folder struct looks like this: /home/user/app/sensor_driver /home/user/app/rest_service – Janusz Piwek Jul 06 '20 at 13:49

0 Answers0