I want to use Raspberry Pis to communicate collected Data via Python (Modbus TCP and RTU) scripts to a Database. These scripts are constantly running on the Pi and are connected to the Products where the data is coming from. Consequently, we have to ship the already set up Raspberry Pi to the Customer. Now the Problem occurs, that the Database Credentials are stored in the Python Scripts running on the Raspberry Pi. Is there a possibility to overcome this Problem?
1 Answer
Naive solution: Store database credentials on your server (or somewhere on internet) so every time Raspberry Pi run the script, it connect to the server to get the credentials first.
My recommended solution: Create an API (may be web API) to communicate with database and Rasp Pi only work with this API. By this way, the client side doesn't know about database's credentials and some private things you want to hide also.
2 Comments
benni0108
Thanks for the quick answer! The Problem is, that the User is still able to catch the database credentials. An API would be a better approach I think. Is node js the way to go?
Bách Văn Khoa
@benni0108 this is simple task, you can choose any language you familiar with!