i have raspberry pi collecting data break beam sensor wish use part of developed laravel application. wondering best way transfer data be.
i thinking of creating json file uploading directory running cron job hourly pick on new files before running them through laravel controller update database , send emails.
i pass data through laravel application rather sending python management purposes. see issues way/ know better way?
your approach sounds fine - caveat not have "real time" data. rely on schedule of cron jobs sync data around - of course every minute if wanted to, minimize of effect of delay.
the other option expose api in laravel application can accept json payload python script , process immediately. approach offers benefits of real-time processing , less processing overall because it's on demand, requires secure api endpoint wouldn't need cron based approach.
for record, highly recommend using json data transfer format. unless need implement schema validation (in case possibly xml), using json easy on both php , python's side.
Comments
Post a Comment