I'm developing a little project with arduino, using a small web page to show data. Well, I have been develop the web page and the small code to communicate with arduino board in my local computer and all work fine. But, after, i uploaded the code to a Raspberry Pi and then the problems appear. This is very strange, because when I execute the code inside a WSGI like django (in my case is other, webapp2) the code works well. I call a specific URL and this WSGI call a method inside a class that communicated with the arduino board through serial port, so far, so good. The problem appears when I decided build a method to execute the lines that do the communication, in this moment arduino does not response and only lights the led number 13 and the 'L' led twice (the led inside the board).
I don't understand why this happens. The code is exactly the same. Any idea?
For the other hand, because í don't have GUI in the raspberry I don't can view the serial port communication easy. Do you know any way to view or debug the serial communications between a pc and arduino without GUI, over the command line?
This is the code:
# -*- coding: utf-8 -*- import serial import time arduino=serial.Serial('/dev/ttyACM0', baudrate=9600, timeout=3.0) arduino.close() arduino.open() sensorTemp='' arduino.write('a') while arduino.inWaiting() > 0: sensorTemp+=arduino.read(1) print sensorTemp
Thanks you so much. Any idea is welcome.