My robot (still don't have a name for him) went for it's first stroll tonight. I was stuck for over an hour because I wasn't able to successfully able to upload a sketch to the Arduino Mega. Since the Arduino Mega is connected to the Raspberry pi via USB, I am able to program it straight from the Raspberry Pi. I do this by installing the Arduino IDE, and VNC Server on the Raspberry Pi. Then I downloaded the TightVNC Client to my windows machine. I start the vnc service on the RPI and then boot up the client on my windows machine which takes me to the UI interface that RPI has. I can then access the Arduino IDE just like I do on Windows.
There is a caveat to this setup. Because I'm using the 'php_serial.class.php" so the webServer can write to the RPI's serial port, I need to put a capacitor between the 'reset' and the 'gnd' on the Arduino to keep it from resetting each time the PHP serial class closes it's connection. This is interfering with my communication between the webServer and the Arduino. I was successfully getting the command from the webServer to the Ardino, but I wasn't able to read my acknowledgement back from the Arduino to the server so I could display it. So this work-around works and it was the capacitor that was not allowing me to properly upload my sketch from the IDE to the Arduino. I finally realized it, pulled the capacitor long enough for it to upload and put it back on. Works like a charm now.
No comments:
Post a Comment