Hi Esteve,
I use web2py, and also as a side project, I develop firmware for 
microcontrollers (with mbed OS, not arduino, but quite similiar). I didn't 
have the need of connecting both worlds, so take this as hints, not real 
tested experience.

First, let's check a couple of assumptions:
- I guess that you have a PC connected to your arduino though a serial port.
- That PC has a python script receiving data from the arduino

I would try with a REST API client for python, to connect the PC python's 
script with the server. After a quick search, I found this one: *Requests: 
HTTP for Humans* (http://docs.python-requests.org/en/latest/), that might 
be fine four your needs. Maybe *someone in this group could suggest a 
better option*
Just to be sure, I would implement some kind of buffering in the PC python 
script, i.e. some queue to store the received data from the arduino, until 
it is transmitted to the server. You could get some hints from this 
link: https://docs.python.org/2/library/io.html

At the server side, web2py, I would implement a REST API (see 
http://web2py.com/books/default/chapter/29/10/services#Restful-Web-Services) 
to receive the PC script's data and store it in a table.

Good luck and please report in this group your findings, just in case I 
need to do something like this sometime later, so that I can take advantage 
of your experience.
Best regards.

El domingo, 30 de abril de 2017, 16:19:53 (UTC+2), Esteve Martín escribió:
>
> Hi,
> I was recently introduced to web development so i'm stil quite a newbie 
> and i'm having difficulties to find the correct way the implement what i 
> want.
> At the moment i'm working in a project and I seem to have hit a wall. I 
> would appreciate some advice to get me on the right path.
>
> I have some arduinos that constantly send sensor data trough serial ports 
> to a python script and i would like this data to be uploaded to the server. 
> The server should then store it into the database and also plot it in 
> real-time. I would like the server to be capable to actuate on the arduino 
> as well, for example to change the value of some of its pins. 
>
> To implement this i thought of making a token based protocol over a 
> two-way communication channel between my python program and the web2py 
> application. The thing is that i have no idea how to do this. I have done 
> some research but i've been overflown with information. What would you 
> recomend? I've read websockets would do the trick but i would like some 
> council before getting into it.
>
> Thanks and sorry for my mediocre english,
>
> Esteve
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to