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 optionJust 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
EDIT:
I forgot to mention that you might need two threads at the PC side: one to receive arduino's data through serial port, and another to send that data to the server using REST API, so that you can keep both tasks running simultaneously, as far as the python threads allow concurrency.
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.