Amraresh
Posts: 6
Joined: Tue Mar 06, 2018 10:48 am

Raspberry pi-web server query regarding IoT project

Sun Apr 08, 2018 2:26 pm

I am a beginner. To send or receive data between pi and web, should we need to interface python code ( in pi ) with java node js or python code ( in pi ) with data base of web . Please find the images for much clarity. Let me know which one is feasible and better between them.
Attachments
m1.JPG
m1.JPG (38.28 KiB) Viewed 1098 times
m2.jpg
m2.jpg (39.62 KiB) Viewed 1098 times

ejolson
Posts: 5474
Joined: Tue Mar 18, 2014 11:47 am

Re: Raspberry pi-web server query regarding IoT project

Mon Apr 09, 2018 3:59 pm

Amraresh wrote:
Sun Apr 08, 2018 2:26 pm
I am a beginner. To send or receive data between pi and web, should we need to interface python code ( in pi ) with java node js or python code ( in pi ) with data base of web . Please find the images for much clarity. Let me know which one is feasible and better between them.
I like the first diagram. It fits on the page better and there won't be lock contention for the database between the Python and Java code.

Heater
Posts: 16091
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspberry pi-web server query regarding IoT project

Mon Apr 09, 2018 6:31 pm

I like the first diagram as well.

Except:

Scratch Java. Make life simple and use "Middle ware Node.js" Where the "Node Middle ware" is your web server and anything else it needs to do.

Scratch Angular. Make life simple and use React. Or even nothing. Vanilla JS with CSS is fine for many things.

Scratch "Python" from the "Raspberry Pi Python Code" box. Keep life simple and replace with node.js and Javascript.

Your plan should work just fine.
Memory in C++ is a leaky abstraction .

User avatar
davidcoton
Posts: 5083
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Raspberry pi-web server query regarding IoT project

Mon Apr 09, 2018 8:28 pm

Heater wrote:
Mon Apr 09, 2018 6:31 pm
I like the first diagram as well.

Except:

Scratch Java. Make life simple and use "Middle ware Node.js" Where the "Node Middle ware" is your web server and anything else it needs to do.

Scratch Angular. Make life simple and use React. Or even nothing. Vanilla JS with CSS is fine for many things.

Scratch "Python" from the "Raspberry Pi Python Code" box. Keep life simple and replace with node.js and Javascript.

Your plan should work just fine.
Scratch "Earth" and run it all on "Mars". :lol:
Signature retired

Heater
Posts: 16091
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspberry pi-web server query regarding IoT project

Tue Apr 10, 2018 9:20 am

davidcoton,
Scratch "Earth" and run it all on "Mars".
Nah, the latency would seriously degrade the user experience :)
Memory in C++ is a leaky abstraction .

User avatar
davidcoton
Posts: 5083
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Raspberry pi-web server query regarding IoT project

Tue Apr 10, 2018 4:39 pm

Heater wrote:
Tue Apr 10, 2018 9:20 am
davidcoton,
Scratch "Earth" and run it all on "Mars".
Nah, the latency would seriously degrade the user experience :)
The location of the OP User has not yet been defined. From your suggestions I was fairly certain your User was not Earthed in reality. :roll:
Signature retired

Return to “General programming discussion”